How do you secure Windows management over WinRM?
IntermediateProductionSecurity and Secrets
Answer
Use HTTPS (port 5986) with valid certificates, not plain HTTP on 5985 with AllowUnencrypted. For domain machines prefer Kerberos; for local accounts use NTLM over HTTPS, and CredSSP only when you need credential delegation (double hop).
[win:vars]
ansible_connection=winrm
ansible_port=5986
ansible_winrm_transport=kerberos
ansible_winrm_server_cert_validation=validate
Alternatively use OpenSSH on Windows with keys (ansible_connection=ssh, ansible_shell_type=powershell), which unifies Linux and Windows access models. Store credentials in vault or credential plugins and use a dedicated service account with only the rights it needs.
More on Security and Secrets
How do you set up a secure automation user and SSH access?BeginnerHow do you give the automation user sudo with least privilege?IntermediateWhat are the alternatives to Ansible Vault for secrets, and when do you use them?IntermediateHow do you read AWS Secrets Manager and SSM parameters in a playbook?IntermediateHow do you integrate HashiCorp Vault with Ansible?AdvancedHow do you stop secrets from leaking into logs and output?Beginner