Interview Prep/DevSecOps/Secrets management: Vault, External Secrets and SOPS

A Vault root token is found pasted in a Slack channel

AdvancedTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → Someone generated a root token for setup or break-glass work and never revoked it.

Diagnose →

vault token lookup <token>               # policies: [root], creation_time
# Search audit logs for the token's HMAC
vault write sys/audit-hash/file input=<token>
grep <hmac> /vault/audit/audit.log

Fix → Revoke it immediately with vault token revoke <token>. Review everything it touched in the audit log, and rotate any secrets it read or policies and auth methods it changed. Delete the Slack message and check Slack's export or retention settings.

Prevent → No standing root tokens. Generate one only when needed with vault operator generate-root under the unseal-key quorum, and revoke it in the same session. Admins should use OIDC login with named policies.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS