Back to all scenarios
Scenario #275
Security
Kubernetes v1.23, On-Prem
Admin Kubeconfig Checked into Git
A developer accidentally committed a kubeconfig file with full admin access into a public Git repository.
Find this helpful?
What Happened
During a code review, a sensitive kubeconfig file was found in a GitHub repo. The credentials allowed full control over the production cluster.
Diagnosis Steps
- 1Used GitHub search to identify exposed secrets.
- 2Retrieved the commit and verified credentials.
- 3Checked audit logs for any misuse.
Root Cause
Lack of .gitignore and secret scanning.
Fix/Workaround
• Rotated the admin credentials immediately.
• Added secret scanning to CI/CD.
• Configured .gitignore templates across repos.
Lessons Learned
Accidental leaks happen—monitor and respond quickly.
How to Avoid
- 1Never store secrets in source code.
- 2Use automated secret scanning (e.g., GitHub Advanced Security, TruffleHog).