maltemindedal/warden
GitHub: maltemindedal/warden
Warden 将 Trivy、Semgrep、Gitleaks 和 OWASP ZAP 四款安全扫描器编排为一条命令,统一输出合并报告并按严重性决定退出码,简化 CI/CD 中的安全检查流程。
Stars: 0 | Forks: 0
# Warden
**四款安全扫描器。一条命令。一个结论。**
Warden 编排了 Trivy、Semgrep、Gitleaks 和 OWASP ZAP,将它们的输出合并为一份报告,并在发现任何严重或高风险问题时以非零状态退出。这些工具都有各自的标志、输出格式和严重性词汇;Warden 对它们进行统一协调,这样你就可以根据一个退出代码(而不是四个)来控制构建流程。无论是在 Windows、macOS 还是 Linux 上,也无论是在本地还是在 CI 中,它的运行方式完全相同。
| 工具 | 用途 |
| --- | --- |
| [Trivy](https://trivy.dev) | 易受攻击的依赖项、配置错误的基础设施 |
| [Semgrep](https://semgrep.dev) | 不安全的代码模式 (SAST) |
| [Gitleaks](https://github.com/gitleaks/gitleaks) | 已提交的机密信息 |
| [OWASP ZAP](https://www.zaproxy.org) | 运行中 Web 应用程序的漏洞 (DAST,可选) |
## 快速开始
需要 **Python 3.11+**、**Docker** 和 **Git**。如果你尚未安装 uv、Trivy 和 Gitleaks,安装程序会自动获取它们。
```
git clone https://github.com/maltemindedal/warden.git
cd warden
./install.sh # Windows: .\install.ps1
```
然后扫描任何项目:
```
cd /path/to/your/project
warden
```
```
[1/4] Running Trivy...
-> Done.
[2/4] Running Semgrep...
-> Done.
[3/4] Running Gitleaks...
-> Done.
[4/4] Skipping ZAP (no URL provided or disabled).
[*] Generating Final Report...
Generated security_audit.json with 4 issues.
--------------------------------------------------
┏━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┓
┃ Severity ┃ Count ┃ Breakdown ┃
┡━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━┩
│ Critical │ 1 │ Secrets: 1 │
│ High │ 1 │ Deps: 1 │
│ Medium │ 2 │ │
└──────────┴───────┴────────────┘
--------------------------------------------------
FAIL: High/Critical issues found. See security_audit.json
```
完整的扫描结果将保存在 `security_audit.json` 中;原始扫描器输出保存在 `.security_reports/` 中。
## 使用方法
扫描当前目录:
```
warden
```
针对运行中的应用程序添加 DAST 扫描:
```
warden --url "http://localhost:3000"
```
或者无需安装任何内容,直接使用内置的容器:
```
docker build -t warden:local .
docker run --rm --user "$(id -u):$(id -g)" -v "$(pwd):/src" warden:local
```
通过 `.warden.yaml` 针对特定项目进行配置:
```
target_url: "http://localhost:3000"
exclude_dirs:
- "node_modules/"
tools:
gitleaks: false
```
## 文档
| 指南 | 适用对象 |
| --- | --- |
| [入门指南](docs/getting-started.md) | 从开始到结束的首次安装和首次扫描 |
| [配置扫描](docs/guides/configuring-scans.md) | 排除目录、禁用工具、设置 DAST 目标 |
| [使用 Docker 运行](docs/guides/running-with-docker.md) | 容器化扫描,包括 DAST 设置 |
| [在 CI 中使用 Warden](docs/guides/ci-github-actions.md) | GitHub Actions 及其他 CI 系统 |
| [故障排除](docs/guides/troubleshooting.md) | 被跳过的工具、权限错误、无效的配置 |
| [CLI 参考](docs/reference/cli.md) | 所有命令、标志和退出代码 |
| [配置参考](docs/reference/configuration.md) | 所有配置键和环境变量 |
| [报告格式](docs/reference/report-format.md) | `security_audit.json` 架构和严重性映射 |
| [架构](docs/architecture/overview.md) | 工作原理及设计原因 |
完整索引:[docs/README.md](docs/README.md)。
## 项目结构
```
src/warden/ Typed Python package and CLI implementation
bin/ Shell and PowerShell wrappers for running from a checkout
tests/ Pytest suite, with scanner output fixtures
docs/ Documentation
action.yml Composite GitHub Action
Dockerfile Container bundling Warden with the scanners
```
## 许可证
MIT — 详见 [LICENSE](LICENSE)。
标签:DAST, DevSecOps, FTP漏洞扫描, SAST, 上游代理, 安全扫描, 安全编排, 恶意软件分析, 时序注入, 盲注攻击, 请求拦截, 逆向工具