Interview Prep/Ansible/Security and Secrets

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'
All Ansible questions Roadmap: Ansible

More on Security and Secrets