How do SSH certificates improve automation security?
AdvancedProductionSecurity and Secrets
Answer
With an SSH certificate authority, servers trust the CA public key (TrustedUserCAKeys) rather than individual keys. The pipeline requests a short-lived certificate (minutes) signed by the CA, such as from HashiCorp Vault's SSH secrets engine, and uses it for the run. There are no long-lived private keys to leak and no authorized_keys to manage.
You can also sign host keys, so clients trust hosts through @cert-authority and StrictHostKeyChecking can stay on without manual known_hosts entries.
[all:vars]
ansible_ssh_private_key_file=/tmp/run/id_ed25519
ansible_ssh_extra_args='-o CertificateFile=/tmp/run/id_ed25519-cert.pub'
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