Run this quarterly, and additionally whenever somebody leaves the team, a credential is suspected of exposure, or a new external secret store is introduced. Run it from a clean checkout of the default branch, on a machine that holds the production vault password - the decryption item cannot run anywhere else.
Set VAULT_PASS_FILE to the path of your vault password file before running
the decryption sweep; the command reads it from the environment rather than
having a path baked in.
What a failure means
There are two shapes of failure here and they need different responses.
A finding in the working tree - an unencrypted vault file, a task with no
no_log, a plaintext default - is a defect to fix. Fix it and move on.
A finding in the log, the shell history or the Git history is an exposure. The credential has already been written somewhere it should not be, and cleaning up the file does not undo that. Rotate the credential; treat the cleanup as secondary.
Access this needs
The repository scans need a checkout only. The decryption sweep needs the vault password. The log scan needs read access to the Ansible log, which on most controllers means the automation account. Nothing here writes anything, and the two commands that could print a secret - the log scan and the shell history scan - both mask the value before printing.
Where the evidence goes
Record the date, the person who ran it, the findings and their disposition in the security review record. For any item that is attested rather than commanded
- the holder list, the escrow, the leaver removals - record who attested it. Those three are the ones an auditor will ask about, and “we check it” is not an answer without a name and a date.
Sign-off
- Reviewer: ________________ Date: ___________
- Security owner: ___________ Date: ___________