Interview Prep/DevSecOps/Certificates, TLS and security incident response

A production DB password used by 30 services leaked, and it has to be rotated without an outage

IntermediateTroubleshootingCertificates, TLS and security incident response
Answer

Likely causes → A single shared static credential with no rotation design.

Diagnose → List every consumer: secret-manager access logs, DB connection logs (pg_stat_activity grouped by usename and client_addr), and code search.

Fix → Rotate with dual credentials. Create a new DB user or password, update the secret store, and roll the services in batches. Watch for authentication errors, then disable the old credential and check the DB logs for any remaining use. If active abuse is suspected, cut over immediately and accept some errors.

Prevent → One credential per service, managed rotation (Secrets Manager rotation or Vault dynamic credentials), and apps that reload credentials without a redeploy.

All DevSecOps questions

More on Certificates, TLS and security incident response