Interview Prep/Ansible/Security and Secrets

How do you secure the supply chain of collections and roles?

AdvancedProductionSecurity and Secrets
Answer
  • Pin exact versions in requirements.yml and commit it, never latest.
  • Mirror what you need in a private Galaxy/Automation Hub and install only from it (galaxy_server list in ansible.cfg).
  • Verify integrity with ansible-galaxy collection verify, and require GPG signatures for collections that provide them.
  • Bake approved versions into execution environment images, scan them (Trivy, Grype), and sign images.
  • Review roles from Galaxy before use. Their tasks run as root on your hosts.
ansible-galaxy collection install community.general:10.1.0 \
  --keyring ~/.ansible/pubring.kbx --required-valid-signature-count 1
All Ansible questions Roadmap: Ansible

More on Security and Secrets