Sast configurator
Skill findscripter/everything-skills/08-security/sast-configurator
类书式 AI Agent 技能大典 · 精选/中文化/互见成网的 500+ 开源技能,可作为 Claude Code 插件市场一键安装。A curated, cross-referenced encyclopedia of 500+ open-source agent skills.
npx -y skills add findscripter/everything-skills --skill sast-configuratorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
当需要为应用代码搭建自动化漏洞静态扫描(SAST)、落地 DevSecOps 或在 CI/CD 中接入安全门禁时使用;产出 Semgrep/SonarQube/CodeQL 的配置、自定义规则与流水线集成方案;不适用于运行时动态测试(DAST)、依赖组件漏洞审计(用 dependency-auditor)或纯人工代码评审;触发词:SAST、静态应用安全测试、static analysis、Semgrep、SonarQube、CodeQL、代码漏洞扫描、安全门禁、DevSecOps
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.4 KB, as published. Nobody here has run it
何时使用
适用于:
- 为应用代码搭建自动化静态漏洞扫描(SAST),在 CI/CD 流水线中接入安全门禁。
- 编写贴合自身代码库的自定义安全规则,治理误报。
- 落地 DevSecOps、满足合规扫描(PCI-DSS、SOC 2 等)。
- 组合多款 SAST 工具实现纵深防御。
不该用于(负边界):
- 运行时/动态安全测试(DAST、渗透测试)——SAST 只看源码不跑程序。
- 第三方依赖与组件的已知漏洞审计——改用
dependency-auditor。 - 纯人工代码评审或逻辑缺陷复查——改用
code-reviewer。
工具选型速查:
| 工具 | 擅长 | 语言 | 成本 | 集成 |
|---|---|---|---|---|
| Semgrep | 自定义规则、快速扫描 | 30+ | 免费/企业版 | 极佳 |
| SonarQube | 代码质量+安全 | 25+ | 免费/商业版 | 良好 |
| CodeQL | 深度分析、安全研究 | 10+ | 免费(OSS) | GitHub 原生 |
步骤
- 盘点代码库主力语言,明确合规要求(PCI-DSS、SOC 2 等),据此选工具。
- 先跑一次基线扫描,摸清现状,优先处理 critical/high 级别。
- 安装并最小化接入工具(见下方指令)。
- 编写组织专属自定义规则,治理误报、建立白名单。
- 接入 CI/CD 与 pre-commit,仅对 critical 问题设为阻断(blocking)。
- 输出 SARIF 结果,沉淀整改路线图并培训团队。
指令
基础安装与启动:
# Semgrep
pip install semgrep
semgrep --config=auto --error
# SonarQube(Docker)
docker run -d --name sonarqube -p 9000:9000 sonarqube:10.8-community
# CodeQL CLI
gh extension install github/gh-codeql
codeql database create mydb --language=python
合规专项扫描并导出 JSON:
semgrep --config p/pci-dss --json -o pci-scan-results.json
示例
GitHub Actions 集成 Semgrep(采用官方规则集):
- name: Run Semgrep
uses: returntocorp/semgrep-action@v1
with:
config: >-
p/security-audit
p/owasp-top-ten
pre-commit 钩子(.pre-commit-config.yaml):
- repo: https://github.com/returntocorp/semgrep
rev: v1.45.0
hooks:
- id: semgrep
args: ['--config=auto', '--error']
自定义规则示例(禁止硬编码 JWT 密钥):
rules:
- id: hardcoded-jwt-secret
pattern: jwt.encode($DATA, "...", ...)
message: JWT secret should not be hardcoded
severity: ERROR
注意事项
- 先建基线再设阻断:增量采纳,安全规则先行、质量规则后补,只对 critical 阻断。
- 误报治理:用 path 过滤排除测试文件/生成代码,给已知安全模式建白名单,对噪声模式用
nostmt元数据,所有抑制都要留文档并定期复审。 - 性能优化:排除测试与生成代码、对大仓启用增量扫描、并行化各模块、在 CI 中缓存依赖与扫描结果。
- 集成排障:校验 API token/凭据、检查代理与网络、确认 SARIF 输出格式兼容、核对 CI runner 权限。
互见
dependency-auditor:第三方依赖与组件漏洞审计(SAST 之外的另一道防线)。code-reviewer:人工逻辑与质量评审,与自动化 SAST 互补。
本条采编自 wshobson/agents(MIT 许可证)。