Can you keep a secret?
summary
Hard-coded keys leak fast — a paper shows median discovery on GitHub is 20 seconds (as low as 0.5 seconds, max ~4 minutes). Keep config in environment variables, load per-project with direnv/.envrc or virtualenv activate scripts, and set defaults in code. Encrypt sharable secrets with git-secret (PGP; use git secret hide/reveal), block commits with git-secrets regex hooks, and scan repos or PRs with git-leaks in CI. Aim to remove secrets from code in minutes and automate checks to prevent regressions.
AI-written summary · about
chapters (11)
- 0:00Introduction and setup
- 3:32Why secrets leak in code
- 6:1812-factor apps and config
- 8:51Environment variables in Python
- 11:23Managing env vars with direnv
- 13:00Sharing secrets securely
- 14:12Git Secret for encrypted files
- 17:50Git Secret access management
- 19:25Git Secrets for commit scanning
- 23:31Git Leaks for post-push checks
- 25:24Summary and best practices
