Interview Prep/Ansible/Security and Secrets

A vault password or SSH key has leaked. What do you do?

AdvancedProductionSecurity and Secrets
Answer
  1. Contain: revoke the leaked credential (remove the key from authorized_keys via a quick exclusive: true play, or disable the CI token), and restrict access paths if compromise is suspected.
  2. Rotate: change the vault password with rekey and, crucially, rotate every secret the vault protected, because anyone with the repo history and the old password can read earlier versions.
  3. Investigate: check audit logs (AWX activity stream, sudo/auth logs, CloudTrail) for use of the credential.
  4. Fix the cause: how did it leak (logs, laptop, chat)? Add a control such as a secret scanner or short-lived credentials.
  5. Document the incident and the new rotation process.

Speed matters most in step 1, and completeness in step 2.

All Ansible questions Roadmap: Ansible

More on Security and Secrets