Open tejasp04 opened 3 years ago
Hi , can some one pls assist on it
I'm not sure I've ever gotten a winrm connection to a CIS benchmark 2 server. That said, the issue is that a hardened image is explicitly meant to prevent unauthorized connections. Here's some context for you that may be helpful.
https://github.com/hashicorp/packer/issues/8093#issuecomment-530079184 https://github.com/hashicorp/packer/issues/9110 https://github.com/test-kitchen/kitchen-ec2/issues/408
I'd recommend downloading the actual checklist of security changes made to windows servers, and look over the ones that have to do with remote connections.
If I had to guess, I'd suspect that a level 2 benchmark may not like self-signed certificates.
we are experiencing the same issue even with the CIS level 1: CIS Microsoft Windows Server 2016 Benchmark v1.2.0.7 - Level 1-* , everything worked fine until version v1.2.0.6, but after just changing the version to v1.2.0.7, started getting the error about WinRM timeout `2021/04/29 11:37:26 packer-builder-amazon-ebs plugin: Using host value: 18.184.205.217
2021/04/29 11:37:26 packer-builder-amazon-ebs plugin: [INFO] Attempting WinRM connection...
2021/04/29 11:37:26 packer-builder-amazon-ebs plugin: [DEBUG] connecting to remote shell using WinRM
2021/04/29 11:37:56 packer-builder-amazon-ebs plugin: [ERROR] connection error: unknown error Post "https://18.184.205.217:5986/wsman": dial tcp 18.184.205.217:5986: i/o timeout
2021/04/29 11:37:56 packer-builder-amazon-ebs plugin: [ERROR] WinRM connection err: unknown error Post "https://18.184.205.217:5986/wsman": dial tcp 18.184.205.217:5986: i/o timeout ` packer version: v1.7.0 ( also tried with v1.7.2(latest) -> same behaviour ) instance type : t2.xlarge configuration is almost the same as mentioned above by @tejasp04
We have also approached to CIS support about the changes in the latest version (v1.2.0.7), and here is the official answer from their side : "After some more testing on our end with the Windows Server 2016 Level 1 (v1.2.0.7) image, everything seems to work as expected for us. We are able to WinRM the same as before successfully."
PS: with simple revert to previous version v1.2.0.6 everything works fine, but this is not an option for us because we need the latest patches...
any updates for this issue?
I hit this issue as well now.
II can start this again, since we have winrm problems with our builder -- just hanging. Our AMI is for windows 2019
I'm also running into a similar trouble. I'm trying to create an image out of the CIS Hardened Windows Server 2022
. However, I am able to establish a connection with my userdata
bootstrap script. But, the caveat is that I'm losing the connect after a reboot.
Issue : We are getting below error when we try to build AMI using packer .
Error logs: 2021/03/05 12:51:20 packer-builder-amazon-ebs plugin: [DEBUG] connecting to remote shell using WinRM 2021/03/05 12:51:50 packer-builder-amazon-ebs plugin: [ERROR] connection error: unknown error Post "https://13.211.157.185:5986/wsman": dial tcp 13.211.157.185:5986: i/o timeout 2021/03/05 12:51:50 packer-builder-amazon-ebs plugin: [ERROR] WinRM connection err: unknown error Post "https://13.211.157.185:5986/wsman": dial tcp 13.211.157.185:5986: i/o timeout 2021/03/05 12:51:55 packer-builder-amazon-ebs plugin: Using host value: 13.211.157.185 2021/03/05 12:51:55 packer-builder-amazon-ebs plugin: [INFO] Attempting WinRM connection...