Pcornel
Security · Secrets Management

Secrets Leakage

Cheat sheet · https://pcornel.dk/topic.php?topic=5069

Back to the Topic

Answer

Secrets leakage happens when credentials end up in Git repositories, logs, container images, tickets or chat. Use secret scanning, revoke and rotate immediately on discovery, and check for misuse.

Remember

  • Revoke first, then clean up.
  • History in Git keeps the secret.
  • Check whether it was used.

First checks

  • gitleaks detect --source . --log-opts=--all — full history scan
  • GitHub secret scanning alerts — provider detection
  • Incident procedure: revoke, rotate, investigate — response

Verify in this order

secret exposed → detected → revoked/rotated → investigated

Where it usually breaks

First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5069

Confirmation

Confirm action

Continue?