rksharma-owg/postman-api-security-testing-templates
GitHub: rksharma-owg/postman-api-security-testing-templates
一套基于 Postman 和 Newman 的防御性 API 安全测试模板工具包,覆盖 OWASP API Top 10 并支持 CI/CD 自动化集成。
Stars: 0 | Forks: 0
# Postman API 安全测试模板

[](LICENSE)
[](collections)
[](scripts/newman)
[](docs/owasp-api-top10.md)
一个生产级的开源工具包,包含可复用的 Postman collections、payload、environments、实验性 API 以及自动化工作流,用于防御性 API 安全测试。
## 包含内容
- 可导入的 Postman collections,涵盖身份验证、授权、JWT、GraphQL、SSRF、CORS、headers、文件上传、rate limiting、IDOR、XSS、业务逻辑以及 OWASP API Top 10 覆盖范围。
- 可复用的 payload 文件,用于安全验证输入处理和防御控制。
- 适用于本地、staging 和生产环境安全的 Postman environments。
- 用于 CLI、JSON、JUnit 和 HTML 样式报告的 Newman 脚本。
- GitHub Actions、Jenkins、Docker 和 CI/CD 示例。
- 专门设计存在漏洞的 Flask 和 Node.js API,供本地练习使用。
- Mermaid 图表、截图占位符和专业的文档。
## 快速开始
```
git clone https://github.com/rksharma-owg/postman-api-security-testing-templates.git
cd postman-api-security-testing-templates
npm install
npm run test:local
```
将 `collections/` 下的任意文件导入 Postman,然后导入 `environments/local.postman_environment.json`。
## 使用 Newman 运行
```
npm run test:auth
npm run test:owasp
npm run report:json
```
## 本地漏洞实验环境
```
docker compose -f vulnerable-api-lab/docker-compose.yml up --build
```
该实验环境将暴露:
- 运行在 `http://localhost:8080` 的 Flask API
- 运行在 `http://localhost:8081` 的 Node API
## OWASP API 安全 Top 10 映射
| OWASP 分类 | 仓库覆盖范围 |
| --- | --- |
| API1 失效的对象级别授权 | `collections/authorization`, `collections/idor` |
| API2 失效的身份验证 | `collections/auth`, `collections/jwt` |
| API3 失效的对象属性级别授权 | `collections/business-logic` |
| API4 不受限制的资源消耗 | `collections/rate-limit`, `collections/fuzzing` |
| API5 失效的功能级别授权 | `collections/authorization` |
| API6 对敏感业务流程的不受限制访问 | `collections/business-logic`, `collections/rate-limit` |
| API7 SSRF | `collections/ssrf` |
| API8 安全配置错误 | `collections/headers`, `collections/cors` |
| API9 资产管理不当 | `collections/api-versioning` |
| API10 API 的不安全使用 | `collections/webhook` |
## 可视化指南

请参阅 `docs/` 获取有关设置、自动化、JWT 测试、GraphQL 测试和修复指南。
## 仓库结构
```
collections/ Postman collections grouped by security domain
payloads/ Reviewed canary payloads (9 categories, 11+ examples each)
environments/ Postman environment templates
scripts/ Newman, CI/CD, Docker, and workflow examples
vulnerable-api-lab/ Local practice APIs
docs/ Guides, mappings, diagrams, and screenshots
assets/ Banner, diagrams, and visual placeholders
```
## 路线图
- 添加基于 OpenAPI 驱动的 collection 生成。
- 添加 Postman 可视化仪表板。
- 添加更多云网关策略示例。
- 添加 SARIF 转换以支持 CI 注释。
## 许可证
MIT。详见 `LICENSE`。
标签:API安全测试, CISA项目, MITM代理, Postman, 安全测试模板, 请求拦截