sari3l/security-code-audit-skill
GitHub: sari3l/security-code-audit-skill
一款面向多语言仓库的证据驱动安全代码审计技能,提供有界追踪、依赖检查与回归验证的能力。
Stars: 0 | Forks: 0
# security-code-audit
当前版本: `v1.0.5`
为 Web/API、后端、全栈、智能合约以及以工件为中心的仓库提供代码安全审计能力。
`security-code-audit` 旨在支持代码安全审查、SAST 风格分析、OWASP 风格检查、依赖审计、智能合约审查、工件与提示面审查以及修复回归测试。它聚焦于真实代码、可利用性、有界追踪、持久的审计状态和高信噪比报告,而非浅层模式匹配。
中文文档:[README-CN.md](README-CN.md)
## 1. v1.0.5 新增功能
- 基于配置文件的审计路由
Recon 现在分离执行模式、目标配置文件和主要知识域,使得 `application`、`smart-contract` 与 `artifact-centric` 目标不会被压平到同一工作流。
- 始终开启的审计状态
`.security-code-audit-state/` 现在支持每次运行并保留表面清单、有界函数链、无效化记录以及快速模式的增量基线。
- 更强的追踪与历史回放
双向追踪、基于指纹的历史匹配与历史缺失门控,减少浅层扫描与错误的“已修复”结论。
- 覆盖范围扩展
参考集在认证与授权漂移、API 版本漂移、批量赋值、反序列化、路径遍历、提示注入、SSRF、XSS、会计逻辑、流程回放以及限额或配额滥用等方面覆盖更深。
- 更高信噪比的报告
报告更清晰地区分已确认发现、候选信号、覆盖债务、历史上下文、工作假设以及计数覆盖摘要。
## 2. 使用方法
- `/security-code-audit`
默认完整审计。等同于 `standard single`。
- `/security-code-audit quick`
快速高危风险初筛。
- `/security-code-audit deep`
深度审查,强化验证与攻击链深度。
- `/security-code-audit regression`
重试最新报告并验证修复是否真正生效。
- `/security-code-audit help`
显示参数、模式、执行选项与示例。
参数:
- depth:`quick` | `standard` | `deep` | `regression`
- execution:`single` | `multi`
- `multi` 为实验性功能,若主机无法委派则回退到 `single`
示例:
- `/security-code-audit deep multi`
- `/security-code-audit regression`
- `/security-code-audit deep --agents=multi`
## 3. 核心能力
- 目标感知路由
Recon 首先选择目标配置文件,然后路由至合适的知识域与共享模块,以适配观察到的表面。
- 真实代码聚焦
发现应与实际文件位置、可利用路径和具体最小修复相关联。
- 有界追踪
双向追踪保持源到汇与状态迁移分析聚焦于真实的信任边界穿越,而非无界图扩展。
- 重复模式枚举
该技能旨在找到所有受影响的实际位置,而不仅仅是首个命中。
- 审计状态连续性
`.security-code-audit-state/` 存储紧凑的运行上下文、已加载模块决策、函数链记录与无效化,确保每次运行可干净地重新定位。
- 依赖与工件覆盖
应用代码、依赖、Markdown 与提示工件、API 规范、笔记本、配置与 IaC 表面均可纳入统一审计流程。
- 诚实的覆盖报告
部分、受阻或无效化的审查区域作为覆盖债务向前传递,而非报告为完全覆盖。
- 证据门控的发现
主要发现限于已确认问题,而未解决的高信噪信号仍以候选信号或工作假设形式可见,不被静默丢弃。
- 历史与回归支持
发现与 `.security-code-audit-reports/` 对比,`regression` 模式可在全新当前状态通过或报告基线选择后直接重试最新报告。
- 可选的多代理执行
`multi` 可在大型仓库中扩展覆盖,同时保持单一报告路径。
## 4. 架构
运行时架构:基于配置文件的路由、惰性加载、有界追踪与持久化状态的分阶段扫描。
```
flowchart TD
A["User command
/security-code-audit [mode] [execution]"] B["SKILL.md
entry router + shared workflow"] C["Bootstrap control plane
parse mode + execution
load core controls and mode rules"] D["Recon phase
map repo surface, stack, artifacts, and risk areas"] E["Profile selection
application | smart-contract | artifact-centric"] F["core/loading.md
lazy loading + on-demand routing"] G["Primary knowledge domain
application or smart-contract"] H["Shared modules
artifacts, dependencies, reporting, and state standards"] T["Core quality controls
integrity, coverage, severity,
and bidirectional tracing"] I["Targeted audit pass
follow selected references for the active surface"] J["Evidence and consolidation
validate findings, dedupe repeats, track coverage debt"] K["Reporting and regression
write findings, compare history, retest fixes"] S[".security-code-audit-state/
run context, function chains,
loading decisions, hypotheses, invalidations"] R[".security-code-audit-reports/
human-readable findings and history"] A --> B B --> C C --> D D --> E E --> F F --> G F --> H F --> T G --> I H --> I T --> I I --> J J --> K K --> R D -. initialize or refresh scan state .-> S F -. persist selected modules .-> S I -. update findings, traces, and coverage .-> S J -. carry forward hypotheses and invalidations .-> S S -. support quick baselines, long scans,
regression, and multi-agent continuity .-> I R -. latest report reused by regression mode .-> K ``` 该技能被有意拆分为多层: | 路径 | 用途 | | --- | --- | | `SKILL.md` | 路由器、帮助路径、共享工作流与进度规则 | | `core/` | 完整性、覆盖、发现、严重性、惰性加载与双向追踪控制 | | `profiles/` | 预处理后目标语义:`application`、`smart-contract` 或 `artifact-centric` | | `references/application/` | Web/API/后端审计的主要方法论 | | `references/smart-contract/` | Solidity 与链上审计的主要方法论 | | `references/shared/` | 工件、依赖、报告与审计状态的共享标准 | | `modes/` | `quick`、`standard`、`deep` 与 `regression` 深度合约 | 输出层: | 路径 | 用途 | | --- | --- | | `.security-code-audit-reports/` | 人类可读的发现、历史、回归基线与行动项 | | `.security-code-audit-state/` | 机器可读的运行上下文、表面清单、函数链、假设与每次运行的无效化 |
/security-code-audit [mode] [execution]"] B["SKILL.md
entry router + shared workflow"] C["Bootstrap control plane
parse mode + execution
load core controls and mode rules"] D["Recon phase
map repo surface, stack, artifacts, and risk areas"] E["Profile selection
application | smart-contract | artifact-centric"] F["core/loading.md
lazy loading + on-demand routing"] G["Primary knowledge domain
application or smart-contract"] H["Shared modules
artifacts, dependencies, reporting, and state standards"] T["Core quality controls
integrity, coverage, severity,
and bidirectional tracing"] I["Targeted audit pass
follow selected references for the active surface"] J["Evidence and consolidation
validate findings, dedupe repeats, track coverage debt"] K["Reporting and regression
write findings, compare history, retest fixes"] S[".security-code-audit-state/
run context, function chains,
loading decisions, hypotheses, invalidations"] R[".security-code-audit-reports/
human-readable findings and history"] A --> B B --> C C --> D D --> E E --> F F --> G F --> H F --> T G --> I H --> I T --> I I --> J J --> K K --> R D -. initialize or refresh scan state .-> S F -. persist selected modules .-> S I -. update findings, traces, and coverage .-> S J -. carry forward hypotheses and invalidations .-> S S -. support quick baselines, long scans,
regression, and multi-agent continuity .-> I R -. latest report reused by regression mode .-> K ``` 该技能被有意拆分为多层: | 路径 | 用途 | | --- | --- | | `SKILL.md` | 路由器、帮助路径、共享工作流与进度规则 | | `core/` | 完整性、覆盖、发现、严重性、惰性加载与双向追踪控制 | | `profiles/` | 预处理后目标语义:`application`、`smart-contract` 或 `artifact-centric` | | `references/application/` | Web/API/后端审计的主要方法论 | | `references/smart-contract/` | Solidity 与链上审计的主要方法论 | | `references/shared/` | 工件、依赖、报告与审计状态的共享标准 | | `modes/` | `quick`、`standard`、`deep` 与 `regression` 深度合约 | 输出层: | 路径 | 用途 | | --- | --- | | `.security-code-audit-reports/` | 人类可读的发现、历史、回归基线与行动项 | | `.security-code-audit-state/` | 机器可读的运行上下文、表面清单、函数链、假设与每次运行的无效化 |
标签:Artifact审查, SAST, SSRF, v1.0.5, Web API安全, XML 请求, XSS, 中文文档, 代码安全审查, 依赖审计, 全栈安全, 历史回放, 双向追踪, 反序列化, 可视化界面, 后端安全, 回归测试, 多智能体执行, 安全代码审计, 安全审计工具, 安全开发, 安全报告, 审计状态持久化, 快速模式, 指纹匹配, 授权漂移, 提示注入, 文档结构分析, 智能合约审计, 深度审计, 漏洞情报, 盲注攻击, 覆盖率分析, 认证绕过, 质量保证, 越权, 路径遍历, 逆向工具, 集群管理, 高信号报告