adriannoes/awesome-agentic-ai/integrating-sast-into-github-actions-pipeline
Claude Code and agent skill by adriannoes/awesome-agentic-ai
- community
Checking that the SKILL.md file is still in the repository.
'This skill covers integrating Static Application Security Testing (SAST)
Install
npx vskill@latest install adriannoes/awesome-agentic-ai/integrating-sast-into-github-actions-pipelineSKILL.md
Integrating SAST into GitHub Actions Pipeline
When to Use
- When development teams need automated code-level vulnerability detection on every pull request
- When security teams require consistent SAST enforcement across all repositories in an organization
- When migrating from manual or periodic security reviews to continuous security testing
- When compliance frameworks (SOC 2, PCI DSS, NIST SSDF) require evidence of automated code analysis
- When multiple languages coexist in a monorepo and need unified scanning under one workflow
Do not use for runtime vulnerability detection (use DAST instead), for scanning third-party dependencies (use SCA tools like Snyk), or for infrastructure-as-code scanning (use Checkov or tfsec).
Prerequisites
- GitHub repository with GitHub Actions enabled
- GitHub Advanced Security license (required for CodeQL on private repos; free for public repos)
- Semgrep account for managed rules and Semgrep App dashboard (free tier available)
- Repository code in a supported language: Python, JavaScript/TypeScript, Java, C/C++, C#, Go, Ruby, Swift, Kotlin
Workflow
Step 1: Configure CodeQL Analysis Workflow
Create a CodeQL workflow that runs on pull requests and on a weekly schedule to catch vulnerabilities in existing code.
Step 2: Add Semgrep Scanning for Custom Rules
Semgrep complements CodeQL with faster scans and support for custom pattern-based rules. Configure it to upload SARIF results to the same GitHub Security tab.
Step 3: Create Custom Semgrep Rules for Organization Patterns
Write organization-specific rules to catch patterns unique to your codebase, such as deprecated internal APIs or insecure configuration patterns.
Step 4: Establish Quality Gates with Branch Protection
Configure branch protection rules that require SAST checks to pass before merging, preventing vulnerable code from reaching production branches.
Step 5: Tune and Suppress False Positives
Manage false positives through CodeQL query filters and Semgrep nosemgrep annotations to maintain developer trust in scan results.
Step 6: Aggregate and Report Findings
Use the GitHub Security Overview dashboard and configure notifications for security alerts across repositories.
Key Concepts
| Term | Definition | |
|---|---|---|
| SAST | Static Application Security Testing — analyzes source code without executing it to find security vulnerabilities | |
| SARIF | Static Analysis Results Interchange Format — standardized JSON format for expressing results from static analysis tools | |
| CodeQL | GitHub's semantic code analysis engine that treats code as data and queries it for vulnerability patterns | |
| Semgrep | Lightweight static analysis tool using pattern matching to find bugs and security issues across many languages | |
| Security Extended | CodeQL query suite that includes additional security queries beyond the default set for deeper analysis | |
| Quality Gate | Automated checkpoint that blocks code from progressing through the pipeline unless security criteria are met | |
| False Positive | A scan finding that incorrectly identifies secure code as vulnerable, requiring suppression or tuning |
Tools & Systems
- CodeQL: GitHub's semantic code analysis engine with deep dataflow and taint tracking analysis
- Semgrep: Fast, lightweight pattern-matching SAST tool with 3000+ community rules and custom rule support
- GitHub Advanced Security: Platform providing code scanning, secret scanning, and dependency review in GitHub
- SARIF Viewer: VS Code extension for reviewing SARIF results locally during development
- GitHub Security Overview: Organization-level dashboard aggregating security alerts across all repositories
Common Scenarios
Scenario: Monorepo with Multiple Languages Needs Unified SAST
Context: A platform team manages a monorepo containing Python microservices, TypeScript frontends, and Go infrastructure tools. Security reviews happen manually every quarter, missing vulnerabilities between reviews.
Approach:
- Configure CodeQL with a matrix strategy covering Python, JavaScript, and Go languages
- Add Semgrep with
--config autoto detect language automatically and apply relevant rulesets - Create path-based triggers so only changed language directories trigger their respective scans
- Upload all SARIF results to GitHub Security tab with unique categories per tool and language
- Set branch protection requiring all SAST jobs to pass before merge
- Schedule weekly full-repository scans to catch issues in unchanged code from newly published CVE patterns
Pitfalls: Setting CodeQL to analyze all languages on every PR increases CI time significantly. Use path filters to trigger only relevant language scans. Semgrep's --config auto may enable rules that conflict with CodeQL findings, creating duplicate alerts.
Scenario: Reducing Alert Fatigue from High False Positive Rate
Context: After enabling SAST, developers ignore findings because 40% are false positives, undermining the security program.
Approach:
- Export all current alerts and categorize them as true positive, false positive, or informational
- Create a custom CodeQL config excluding noisy query IDs that produce the most false positives
- Write
.semgrepignorepatterns for test files, generated code, and vendored dependencies - Establish a weekly triage meeting where security and development leads review new rule additions
- Track false positive rate as a metric and target below 15% for developer trust
Pitfalls: Over-suppressing rules to reduce noise can create blind spots. Always validate suppressions against the OWASP Top 10 and CWE Top 25 to ensure critical vulnerability classes remain covered.
Output Format
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/integrating-sast-into-github-actions-pipeline/SKILL.md
Popularity
- Repository stars
- 63
- Repository forks
- 18
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/adriannoes/awesome-agentic-ai/integrating-sast-into-github-actions-pipeline)