Git & GitHub Interview Question #131
What is secret scanning on GitHub?
Security, Team Workflows, Troubleshooting & Senior Git/GitHub Scenarios Senior Advanced
Quick Interview Answer
Secret scanning detects supported credential patterns in repository content and can alert repository owners or providers when potentially exposed secrets are found. Available capabilities depend on repository and account configuration.
Detailed Explanation
Secret scanning detects supported credential patterns in repository content and can alert repository owners or providers when potentially exposed secrets are found. Available capabilities depend on repository and account configuration.
Secret scanning is a defense-in-depth control, not permission to commit credentials. Developers should prevent secrets from entering Git history and rotate any credential that has been exposed.
Code Example
# Keep secrets out of tracked files.
git status
git diff --staged
# Review staged content before every sensitive commit:
git diff --cached