介绍用于 API 漏洞评估、测试和监控的工具。
向运行中的 API 发送请求以检测漏洞的工具。
网络应用程序和 API 安全测试的行业标准工具。基于代理的拦截和扫描功能。
导入 OpenAPI/Swagger 定义,自动抓取和测试所有端点。
由 OWASP 开发的开源安全测试工具。易于集成到 CI/CD 管道中。
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-api-scan.py \ -t https://api.example.com/openapi.json \ -f openapi \ -r report.html
API 开发和测试的首选工具。也可用于安全测试。
// 状态代码验证 pm.test("Status is 200", () => { pm.response.to.have.status(200); }); // 安全头验证 pm.test("Security headers present", () => { pm.response.to.have.header("X-Content-Type-Options"); pm.response.to.have.header("Strict-Transport-Security"); }); // 检查是否暴露了敏感数据 pm.test("No sensitive data exposed", () => { const body = pm.response.json(); pm.expect(body).to.not.have.property("password"); pm.expect(body).to.not.have.property("password_hash"); pm.expect(body).to.not.have.property("secret"); });
从命令行快速进行 API 测试。易于编写脚本并实现自动化。
# 检查响应标头 curl -s -D - -o /dev/null https://api.example.com/health # 尝试未经身份验证的访问 curl -s -w "%{http_code}" https://api.example.com/api/users # BOLA 测试(访问其他用户的资源) curl -s -H "Authorization: Bearer $TOKEN" \ https://api.example.com/api/users/OTHER_USER_ID
基于模式的静态分析工具可轻松创建自定义规则。
依赖性漏洞扫描和代码分析。
软件包管理器和容器的漏洞检查。
# 检查 Node.js 依赖项 npm audit --production # 使用 Semgrep 进行安全扫描 semgrep --config=p/security-audit ./src # 使用 Trivy 进行容器扫描 trivy image --severity HIGH,CRITICAL myapp:latest
以机器可读格式定义 API 规范。也可用作安全测试的输入。
OpenAPI 规范的筛选器工具。检查是否符合安全最佳实践。
Kong、AWS API Gateway、Apigee 等。
AWS WAF、Cloudflare、ModSecurity 等。
ELK Stack、Splunk、Datadog 等。
Specialized tools for testing and securing LLMs, AI agents, and ML pipelines.
LLM vulnerability scanner that probes for prompt injection, data leakage, hallucination, and other LLM-specific weaknesses.
# Install garak pip install garak # Run prompt injection probes against an OpenAI model garak --model_type openai --model_name gpt-4 \ --probes promptinject # Run all probes and generate report garak --model_type openai --model_name gpt-4 \ --probes all --report_prefix my_audit
Addresses: LLM01: Prompt Injection, LLM06: Excessive Agency
Prompt injection detection framework with multi-layer defense: heuristics, LLM-based analysis, and vector similarity.
Addresses: LLM01: Prompt Injection
Runtime guardrails framework for LLM applications. Define conversation boundaries using Colang rules.
Addresses: LLM02: Insecure Output Handling, ASI07: Inadequate Guardrails
Python Risk Identification Tool for generative AI. Automates red-teaming with multi-turn attack strategies.
Addresses: LLM01: Prompt Injection, LLM07: Insecure Plugin Design
| 目的 | 推荐工具 | 时间安排 |
|---|---|---|
| API 规范安全检查 | Spectral | 设计/规格阶段 |
| 代码安全分析 | Semgrep | 开发/公关 |
| 依赖性漏洞检查 | Snyk / npm audit | 构建时间/周期性 |
| 人工安全测试 | Burp Suite / Postman | 测试/质量保证阶段 |
| 自动扫描(CI/CD) | OWASP ZAP | 部署前 |
| 保护生产环境 | WAF + API Gateway | 运行中 |
| 日志监控和异常检测 | SIEM (ELK / Datadog) | 运行中 / 持续 |
| LLM vulnerability scanning | Garak / PyRIT | Pre-deployment / Periodic |
| Prompt injection detection | Rebuff | Runtime / Integration |
| LLM runtime guardrails | NeMo Guardrails | Runtime / Continuous |
| AI red-teaming automation | PyRIT | Testing / QA phase |
| AI model supply chain verification | Semgrep / ModelScan | Build time / Pre-deployment |