ByteRay-AI/Xpsd
GitHub: ByteRay-AI/Xpsd
Xpsd 利用 LLM 智能体对漏洞扫描报告做源码级可达性分析,帮助团队自动判断哪些 CVE 在代码中真正可被触发。
Stars: 0 | Forks: 0
[](https://discord.gg/46ndug98k)
# Xpsd
一条命令即可判定报告的漏洞在给定的源代码树中是否真正可达。
只需输入 CVE 描述,或完整的漏洞扫描报告,它就会在你的代码上运行由 LLM 驱动的可达性分析,随后输出结构化判定、Markdown 报告,以及 GitHub 代码扫描可读取的 SARIF。
## GitHub CI 集成
该 Action 通过工作流内置的 `GITHUB_TOKEN` 在 GitHub Copilot 上运行。只需授予 `copilot-requests: write` 权限,无需其他配置。Xpsd 的使用费用将与其他 Copilot 消耗一起计入组织账单。
```
permissions:
contents: read
security-events: write
copilot-requests: write # the built-in token authenticates Copilot
```
如果你想使用自定义模型,只需设置 `provider-type` 和 `api-key`,即可在无需更改其他配置的情况下切换至 Anthropic、OpenAI 或 Azure。
## 工作流示例
```
name: reachability
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * 1"
permissions:
contents: read
security-events: write
copilot-requests: write
jobs:
reachability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anchore/sbom-action@v0
with: {format: cyclonedx-json, output-file: sbom.cdx.json, upload-artifact: false}
- uses: anchore/scan-action@v6
with: {sbom: sbom.cdx.json, output-format: json, output-file: scan.json, fail-build: false}
- uses: byteray-ai/xpsd@v1
id: xpsd
with:
scan-file: scan.json
model: gpt-5.3-codex
min-severity: high
max-findings: "10" # cap the analyzed findings, highest severity first
# min-cvss: "7.0" # numeric floor instead of the severity band
# is-remote: "true" # only findings shown to be network-reachable (AV:N)
# is-exploited: "true" # only findings CVSS-BT lists as exploited
# max-cycles: "30" # tool-call budget per finding
# max-tokens: "150000" # token budget per finding; first ceiling hit wins
# fail-on: reachable # fail the step when something is reachable
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: ${{ steps.xpsd.outputs.sarif-file }}
category: xpsd-reachability
```
你可以将其替换为你正在使用的任何扫描器。Xpsd 会自动检测报告格式:
| 生产者 | 格式 |
|----------|--------|
| [Grype](https://github.com/anchore/grype) | `grype -o json` 或 SARIF |
| [Trivy](https://github.com/aquasecurity/trivy) | `trivy -f json` 或 SARIF |
| [OSV-Scanner](https://github.com/google/osv-scanner) | `--format json` |
| [Snyk](https://snyk.io) | `snyk test --json`,单个或 `--all-projects` |
| 任意 SARIF 生产者 | SARIF 2.1.0 |
## 安全(Security)标签页中的呈现内容
| 判定结果 | 告警 |
|---------|-------|
| 可达(中/高置信度) | 错误(error),严重程度取自 CVSS |
| 可达(低置信度)、不确定、分析失败 | 警告(warning),需人工复核 |
| 不可达 | 备注(note),仅供参考 |
每个告警都包含模型的推理过程、从入口点到漏洞触发处的调用路径,以及指向受影响源代码行的证据链接。重新运行会原地刷新这些告警,而在后续上传中消失的发现将自动关闭。
成本按发现结果计算,每个结果对应一次智能体会话,因此过滤是控制运行规模的方法:`min-severity`、`min-cvss`、`max-findings` 和 `only` 用于选择分析范围;`is-remote` 仅保留被证实为网络可达(CVSS `AV:N`)的发现;而 `is-exploited` 仅保留 CVSS-BT 数据集中列出已被利用的漏洞。这两者都需要确凿的证据,因此无法被确认的发现将被剔除。当你想要拦截构建流程时,`fail-on` 可以将“可达”的判定结果转化为一个失败的步骤。
可达性还取决于代码之外的因素,例如实际编译的内容或暴露给网络的内容。`guidance` 输入参数可将这些信息作为分析的基准事实传入。
## 文档
- [docs/arch.md](docs/arch.md):Xpsd 的工作原理。
- [docs/github-actions.md](docs/github-actions.md):工作流集成、所有输入和输出、告警语义及故障排除。
- [docs/usage.md](docs/usage.md):CLI、两种模式、过滤、provider、判定 schema 及命令行 flag。
- [docs/build.md](docs/build.md):镜像构建与原生构建。
## 贡献与安全
欢迎提交 Bug 报告和 Pull Request;详情请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。请按照 [SECURITY.md](SECURITY.md) 中的说明私下报告漏洞,该文件还记录了威胁模型及已知的局限性。
## 许可证
Apache License 2.0,详见 [LICENSE](LICENSE)。版权所有 © 2026 ByteRay Ltd.
标签:C2, DLL 劫持, EVTX分析, GitHub Actions, GPT, SARIF, 代码分析, 凭证管理, 大语言模型, 漏洞管理, 自动笔记, 请求拦截