GitHub's security tooling splits into a few genuinely distinct features: Dependabot (automated alerts and pull requests for vulnerable dependencies), secret scanning (detects credentials and API keys accidentally committed, with push protection able to block a commit containing a detected secret before it ever lands in the repo), and CodeQL code scanning (semantic analysis of your actual code for vulnerability patterns).
- Enable push protection for secret scanning specifically, since it blocks a leaked credential at commit time rather than just alerting after it's already in the repo's history
- CodeQL code scanning is free for public repositories, but private repositories need a GitHub Advanced Security license to use it
- Treat Dependabot alerts and CodeQL findings as different signals -- Dependabot flags known vulnerabilities in dependencies you use, CodeQL flags patterns in your own code, and you need both, not just one
Use cases
Intro
- Enable dependency scanning on push in GitHub
- Run static code analysis within GitHub actions
- Detect exposed secrets in pull requests on GitHub
- Generate compliance reports inside GitHub
- Enforce security gates before merges in GitHub
Closing
