ACTION REQUIRED (execute immediately after reading)
NOW: Read../field-journal/precedent-pentest.mdor code audit authorizationNOW: Confirm there issource code/repository access(no source code binary → switch to RE skill)NOW: Clarify the language stack and scope (directory/service/PR diff)NEXT: tool-index; semgrep, etc.ACT: Threat modeling sketch → automated scanning → manual verification
Applicable scenarios
- White-box audit, PR/differential security review
- Semgrep / CodeQL / Bandit / gosec and other SAST
- Dangerous APIs, injection points, missing authentication, cryptographic misuse
- With
supply-chain-security/division of labor: this skill focuses onown code logic, supply chain focuses on dependencies and pipelines
Workflow
1. Scope and threat model
□ 信任边界:用户输入、文件、反序列化、SSRF、鉴权中间件
□ 高价值资产:鉴权、支付、管理端、密钥处理
2. Automated scanning
semgrep --config auto .
# 或项目规则包
semgrep --config p/owasp-top-ten .
3. Manual verification (MUST)
□ 每个 SAST 命中:可达性?可利用性?误报?
□ 鉴权:IDOR/越权、缺校验、错误的多租户隔离
□ 注入:SQL/命令/模板/LDAP
□ 加密:硬编码密钥、ECB、自定义 crypto
4. Output
Finding:位置 + 数据流 + PoC + 修复建议
可选 ATT&CK / CWE 编号
Toolchain
| Tool | Language/Scenario |
|---|---|
| Semgrep | Multi-language quick rules |
| CodeQL | Deep data flow (GitHub) |
| Bandit | Python |
| gosec / staticcheck | Go |
| SpotBugs / FindSecBugs | Java |
Reference
references/sast-review-checklist.md../supply-chain-security/../api-security/../llm-security/(Agent code)
Routing context
Upstream: MASTER R26
Role: ops/role-map.md cae
Downstream: dependency vulnerabilities → supply-chain; runtime verification → pentest-tools
Task completion self-check
- : Is it manually verified rather than only pasting scanner output?
- : Does it include remediation suggestions?
- : Is it limited to the authorized repository scope?
- Checklist?