Interview Prep/Ansible/Security and Secrets

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.

All Ansible questions Roadmap: Ansible

More on Security and Secrets