Back to Glossary
SecurityPopular

Code Scanning

Automated analysis of code to find security vulnerabilities, bugs, and code quality issues, typically integrated into CI/CD pipelines.

Definition

Code scanning is SAST (Static Application Security Testing) integrated into development workflows. GitHub Code Scanning uses CodeQL, a semantic analysis engine that queries code like a database. GitLab has SAST templates, and platforms like Snyk and SonarCloud offer similar features. Scans run on pull requests and block merging when critical issues are found. Results appear as PR annotations for easy developer action.

Why It Matters

Code scanning catches vulnerabilities before production, when they're cheapest to fix. GitHub's Advanced Security has found over 50,000 CVEs in open-source code. By scanning every PR, teams maintain a security baseline and prevent regression. It's a key component of shift-left security.

Example

A developer opens a PR with SQL concatenation. GitHub Code Scanning detects the SQL injection risk, adds a warning annotation on the vulnerable line, and blocks the PR merge until the issue is fixed.

Related Terms

code scanningGitHub code scanningCodeQLsecurity scanningautomated security

Automate Code Review with diffray

Multi-agent AI system for code review. Automatically finds bugs, security vulnerabilities, and architecture issues.