static-analysis
💡 摘要
一个用于检测安全漏洞的静态分析工具包,使用 CodeQL、Semgrep 和 SARIF 解析。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
该工具包可能执行外部命令并访问文件系统,存在命令注入和数据泄露的风险。确保适当的输入验证并限制权限。
Static Analysis
A comprehensive static analysis toolkit with CodeQL, Semgrep, and SARIF parsing for security vulnerability detection.
CodeQL and Semgrep skills are based on the Trail of Bits Testing Handbook:
Author: Axel Mierczuk
Skills Included
| Skill | Purpose |
|-----------------|----------------------------------------------------------|
| codeql | Deep security analysis with taint tracking and data flow |
| semgrep | Fast pattern-based security scanning |
| sarif-parsing | Parse and process results from static analysis tools |
When to Use
Use this plugin when you need to:
- Perform security vulnerability detection on codebases
- Run CodeQL for interprocedural taint tracking and data flow analysis
- Use Semgrep for fast pattern-based bug detection
- Parse SARIF output from security scanners
- Set up static analysis in CI/CD pipelines
- Aggregate and deduplicate findings from multiple tools
What It Does
CodeQL
- Create databases for Python, JavaScript, Go, Java, C/C++, and more
- Run security queries with SARIF/CSV output
- Write custom QL queries with taint tracking
- Integrate with GitHub Actions
Semgrep
- Quick security scans using built-in rulesets (OWASP, CWE, Trail of Bits)
- Write custom YAML rules with pattern matching
- Taint mode for tracking data flow from sources to sinks
- CI/CD integration with baseline scanning
SARIF Parsing
- Understand SARIF 2.1.0 structure
- Quick analysis using jq for CLI queries
- Python scripting with pysarif and sarif-tools
- Aggregate and deduplicate results from multiple files
- CI/CD integration patterns
Installation
/plugin install trailofbits/skills/plugins/static-analysis
Related Skills
variant-analysis- Use CodeQL/Semgrep patterns to find bug variants
优点
- 全面的漏洞检测
- 支持多种编程语言
- 与 CI/CD 管道良好集成
- 使用 Semgrep 进行快速模式扫描
缺点
- 可能需要配置以获得最佳使用效果
- 自定义查询的学习曲线
- 依赖外部工具
- 设置可能复杂
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 trailofbits.
