关于 sast-report
sast-report 是将已完成的 SAST 扫描结果汇总为分级安全报告的技能。它纳入易受攻击和可能易受攻击的发现,按严重性及机密性影响排序,并要求已有扫描结果文件。
主要功能
- 01汇集 SAST 结果文件
- 02筛选报告中的发现
- 03按严重性和影响排序
- 04生成最终报告
适用场景
- 01合并多项扫描结果
- 02确定安全发现的优先级
- 03编写最终评估报告
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ utkusen/ sast-skills --skill sast-report安装后在 Claude Code 中输入/sast-report确认已加载。
详细介绍
最终安全报告生成
你正在将所有已完成的 SAST 漏洞扫描结果汇总到一份统一的优先级安全报告中。
前提条件:至少存在一个 sast/*-results.md 文件。如果不存在,请先运行漏洞检测技能。
包含内容
仅纳入每个结果文件中分类为以下状态的发现:
[VULNERABLE][LIKELY VULNERABLE]
从报告正文中排除 [NOT VULNERABLE] 和 [NEEDS MANUAL REVIEW] 的发现(仅在摘要中统计)。
严重性分级
使用下表作为基准,为每项发现指定严重性级别——Critical、High、Medium 或 Low。根据具体情境酌情上调或下调(例如,暴露财务记录的 IDOR 属于 High,而非 Medium)。
| 漏洞类别 | 默认严重性 |
|---|---|
| 通过命令注入、eval 或不安全反序列化实现的 RCE | Critical |
| SSTI(服务器端模板注入) | Critical |
| 认证端点上的 SQLi | Critical |
| JWT 算法混淆(alg:none、RS256→HS256) | Critical |
| 导致代码执行的文件上传(webshell) | Critical |
| 具备完整数据提取能力的 SQLi | High–Critical |
| GraphQL 注入(用户可控的操作文档可访问未授权字段或滥用网关) | High–Critical |
| 可读取文件或访问内部 SSRF 的 XXE | High–Critical |
| 敏感端点缺少认证 | High–Critical |
| 可访问内部服务或云元数据的 SSRF | High |
| 可读取敏感文件或配置文件的路径遍历 | High |
| 上传后其他用户可访问其内容的文件上传 | High |
| 涉及 PII、财务或健康数据的 IDOR | High |
| XSS(存储型/持久型) | High |
| 缺少或可绕过声明验证的 JWT | Medium–High |
| 低敏感度端点缺少认证 | Medium |
| 涉及非敏感数据的 IDOR | Medium |
| XSS(反射型或 DOM 型) | Medium |
| 业务逻辑缺陷(价格篡改、工作流绕过) | Medium |
| 非敏感数据的信息泄露 | Low |
以机密性作为同级排序依据:当两项发现的基准严重性相同时,机密性影响更大的发现排名更高——也就是更可能泄露敏感用户数据、凭据或系统内部信息的发现。
执行
在当前会话中完成所有步骤(无需使用子 Agent)。
步骤 1:查找结果文件
检查 sast/ 中是否存在以下文件:
idor-results.mdsqli-results.mdssrf-results.mdxss-results.mdrce-results.mdxxe-results.mdfileupload-results.mdpathtraversal-results.mdssti-results.mdjwt-results.mdmissingauth-results.mdbusinesslogic-results.mdgraphql-results.md
如果 sast/architecture.md 存在,也请读取(撰写严重性理由时,用于了解项目名称和上下文)。
步骤 2:读取并提取发现
读取每个现有结果文件。对于每项分类为 [VULNERABLE] 或 [LIKELY VULNERABLE] 的发现,提取:
- 发现标题
- 漏洞类型(根据源文件推断)
- 受影响的文件/端点
- 问题描述
- 影响描述
- 证明/代码路径
- 修复建议
- 动态测试步骤(如有)
步骤 3:评分并排序
使用上表为每项发现分配严重性级别(Critical / High / Medium / Low)。按以下顺序排列所有发现:
- 首先列出 Critical,然后是 High、Medium、Low
- 每个级别内,按机密性影响从高到低排序
步骤 4:编写 sast/final-report.md
严格使用以下输出格式:
# Security Assessment Final Report
**Project**: [name from architecture.md, or infer from codebase]
**Generated**: [current date]
**Scans completed**: [comma-separated list of scan types that had result files]
---
## Executive Summary
| Severity | Count |
|----------|-------|
| Critical | N |
| High | N |
| Medium | N |
| Low | N |
| **Total confirmed findings** | **N** |
Scans with no confirmed vulnerabilities: [list]
Findings requiring manual review: N (see individual result files for details)
---
## Vulnerability Index
| # | Title | Type | Severity | Endpoint / File |
|---|-------|------|----------|----------------|
| 1 | ... | RCE | Critical | `POST /api/exec` |
| 2 | ... | SQLi | High | `GET /api/users` |
---
## Findings
### Critical
#### [Finding Title] — [Vuln Type]
- **Source scan**: `sast/[type]-results.md`
- **Classification**: Vulnerable *(or "Likely Vulnerable")*
- **Endpoint / File**: ...
- **Severity rationale**: [1–2 sentences explaining why this is Critical, with focus on confidentiality and integrity impact]
- **Issue**: ...
- **Impact**: ...
- **Proof**:
[原始发现中的代码路径或证据]
- **Remediation**: ...
- **Dynamic Test**:
[原始发现中的 curl 命令或分步测试说明]
---
### High
[Same structure as Critical section]
---
### Medium
[Same structure]
---
### Low
[Same structure]
---
## Appendix: Scan Coverage
| Scan | Result File | Status |
|------|-------------|--------|
| IDOR | `sast/idor-results.md` | Completed / Not run |
| SQLi | `sast/sqli-results.md` | Completed / Not run |
| SSRF | `sast/ssrf-results.md` | Completed / Not run |
| XSS | `sast/xss-results.md` | Completed / Not run |
| RCE | `sast/rce-results.md` | Completed / Not run |
| XXE | `sast/xxe-results.md` | Completed / Not run |
| File Upload | `sast/fileupload-results.md` | Completed / Not run |
| Path Traversal | `sast/pathtraversal-results.md` | Completed / Not run |
| SSTI | `sast/ssti-results.md` | Completed / Not run |
| JWT | `sast/jwt-results.md` | Completed / Not run |
| Missing Auth | `sast/missingauth-results.md` | Completed / Not run |
| Business Logic | `sast/businesslogic-results.md` | Completed / Not run |
| GraphQL injection | `sast/graphql-results.md` | Completed / Not run |
重要提醒
- “发现项”部分仅包含
[VULNERABLE]和[LIKELY VULNERABLE]发现项。 - 明确标记
[LIKELY VULNERABLE]发现项:在发现项标题后添加 ⚠ Likely Vulnerable。 - 保留原始发现项的所有细节——不得总结或截断“证明”“修复”或“动态测试”部分。
- 如果存在
sast/architecture.md,请使用其中的信息补充严重性说明,使其结合应用特定背景(例如:“此端点处理支付数据,因此机密性影响为严重”)。 - 如果某个严重性等级下没有发现项,请完全省略该等级的章节(例如
### Low标题)。