
SAST Configuration
FreeStreamline your static application security testing setup.
Free · Opens the source repo
What SAST Configuration does
The SAST Configuration skill facilitates the setup and configuration of Static Application Security Testing (SAST) tools, allowing developers to automate vulnerability detection in their application code. This skill is particularly useful for teams implementing DevSecOps practices, as it helps integrate security scanning into CI/CD pipelines seamlessly. With support for tools like Semgrep, SonarQube, and CodeQL, it provides a comprehensive approach to ensuring code security across various programming languages.
Users can create custom security rules tailored to their specific codebases, configure quality gates, and establish compliance policies. The skill also emphasizes performance optimization, helping to reduce false positives and improve the efficiency of security scans. By integrating multiple SAST tools, users can adopt a defense-in-depth strategy, enhancing their overall security posture.
The skill includes detailed guidance on configuring each SAST tool, from setting up Semgrep for pattern matching and custom rule creation to optimizing SonarQube for code quality tracking. CodeQL analysis is also covered, enabling users to develop custom queries for in-depth vulnerability research. This makes the SAST Configuration skill suitable for developers and security teams looking to enhance their application security processes without reinventing the wheel.
In addition to setup instructions, the skill provides best practices for managing false positives, incremental adoption of security rules, and team enablement through training and documentation. This comprehensive resource is designed for teams at various stages of their security journey, whether they are just starting with SAST or looking to refine their existing processes.
When to use it
Use this skill when setting up security scanning in your CI/CD pipeline or when creating custom security rules for your codebase.
When not to use it
This skill may not be suitable for teams not yet ready to implement SAST tools or those with very specific, unsupported tools.
What you can build with it
Setting Up SAST for a New Project
Quickly configure SAST tools for a new project by following the provided setup scripts and guidelines.
Creating Custom Security Rules
Develop tailored security rules for your organization’s coding standards using the skill's custom rule development features.
Integrating SAST into CI/CD Pipelines
Seamlessly integrate SAST scanning into your CI/CD workflows to ensure continuous security checks during development.
How to install SAST Configuration
View source1. Install with the skills CLI
npx skills add wshobson/agents/sast-configuration --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by wshobsonSAST Configuration
Static Application Security Testing (SAST) tool setup, configuration, and custom rule creation for comprehensive security scanning across multiple programming languages.
Overview
This skill provides comprehensive guidance for setting up and configuring SAST tools including Semgrep, SonarQube, and CodeQL. Use this skill when you need to:
- Set up SAST scanning in CI/CD pipelines
- Create custom security rules for your codebase
- Configure quality gates and compliance policies
- Optimize scan performance and reduce false positives
- Integrate multiple SAST tools for defense-in-depth
Core Capabilities
1. Semgrep Configuration
- Custom rule creation with pattern matching
- Language-specific security rules (Python, JavaScript, Go, Java, etc.)
- CI/CD integration (GitHub Actions, GitLab CI, Jenkins)
- False positive tuning and rule optimization
- Organizational policy enforcement
2. SonarQube Setup
- Quality gate configuration
- Security hotspot analysis
- Code coverage and technical debt tracking
- Custom quality profiles for languages
- Enterprise integration with LDAP/SAML
3. CodeQL Analysis
- GitHub Advanced Security integration
- Custom query development
- Vulnerability variant analysis
- Security research workflows
- SARIF result processing
Quick Start
Initial Assessment
- Identify primary programming languages in your codebase
- Determine compliance requirements (PCI-DSS, SOC 2, etc.)
- Choose SAST tool based on language support and integration needs
- Review baseline scan to understand current security posture
Basic Setup
# Semgrep quick start
pip install semgrep
semgrep --config=auto --error
# SonarQube with Docker
docker run -d --name sonarqube -p 9000:9000 sonarqube:10.8-community
# CodeQL CLI setup
gh extension install github/gh-codeql
codeql database create mydb --language=python
Integration Patterns
CI/CD Pipeline Integration
# GitHub Actions example
- name: Run Semgrep
uses: returntocorp/semgrep-action@v1
with:
config: >-
p/security-audit
p/owasp-top-ten
Pre-commit Hook
# .pre-commit-config.yaml
- repo: https://github.com/returntocorp/semgrep
rev: v1.45.0
hooks:
- id: semgrep
args: ['--config=auto', '--error']
Best Practices
-
Start with Baseline
- Run initial scan to establish security baseline
- Prioritize critical and high severity findings
- Create remediation roadmap
-
Incremental Adoption
- Begin with security-focused rules
- Gradually add code quality rules
- Implement blocking only for critical issues
-
False Positive Management
- Document legitimate suppressions
- Create allow lists for known safe patterns
- Regularly review suppressed findings
-
Performance Optimization
- Exclude test files and generated code
- Use incremental scanning for large codebases
- Cache scan results in CI/CD
-
Team Enablement
- Provide security training for developers
- Create internal documentation for common patterns
- Establish security champions program
Common Use Cases
New Project Setup
./scripts/run-sast.sh --setup --language python --tools semgrep,sonarqube
Custom Rule Development
# See references/semgrep-rules.md for detailed examples
rules:
- id: hardcoded-jwt-secret
pattern: jwt.encode($DATA, "...", ...)
message: JWT secret should not be hardcoded
severity: ERROR
Compliance Scanning
# PCI-DSS focused scan
semgrep --config p/pci-dss --json -o pci-scan-results.json
Troubleshooting
High False Positive Rate
- Review and tune rule sensitivity
- Add path filters to exclude test files
- Use nostmt metadata for noisy patterns
- Create organization-specific rule exceptions
Performance Issues
- Enable incremental scanning
- Parallelize scans across modules
- Optimize rule patterns for efficiency
- Cache dependencies and scan results
Integration Failures
- Verify API tokens and credentials
- Check network connectivity and proxy settings
- Review SARIF output format compatibility
- Validate CI/CD runner permissions
Related Skills
Tool Comparison
| Tool | Best For | Language Support | Cost | Integration |
|---|---|---|---|---|
| Semgrep | Custom rules, fast scans | 30+ languages | Free/Enterprise | Excellent |
| SonarQube | Code quality + security | 25+ languages | Free/Commercial | Good |
| CodeQL | Deep analysis, research | 10+ languages | Free (OSS) | GitHub native |
Next Steps
- Complete initial SAST tool setup
- Run baseline security scan
- Create custom rules for organization-specific patterns
- Integrate into CI/CD pipeline
- Establish security gate policies
- Train development team on findings and remediation
Frequently asked questions about SAST Configuration
Similar skills
GitHub Actions Hardening
Enhance the security of your GitHub Actions workflows.
Sensitive Logging Audit
Audit and fix sensitive data exposure in Python logging.
Android App Static Analysis
Automate security assessments of Android apps with MobSF.
Integrating DAST with OWASP ZAP
Seamlessly integrate dynamic security testing into CI/CD pipelines.
Implementing Runtime Security with Tetragon
Enhance Kubernetes security with eBPF-based observability.
Implementing Mobile Application Management
Secure enterprise data on mobile devices with app-level controls.
