SuperAPI AI Directory

code-audit

General & other

View repository

Updated 10-16 09:45

About this skill

Source Code Security Audit

ACTION REQUIRED (execute immediately after reading)

  1. NOW: Read ../field-journal/precedent-pentest.md or code audit authorization
  2. NOW: Confirm there issource code/repository access(no source code binary → switch to RE skill)
  3. NOW: Clarify the language stack and scope (directory/service/PR diff)
  4. NEXT: tool-index; semgrep, etc.
  5. 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?