api-security-testing
它能做什么
这个技能指导对接口进行自动化安全扫描,以接口的架构和 OWASP API 安全 Top 10 作为检查清单。它面向希望检查接口弱点的安全测试人员和开发者。
适用场景
- ✓有人需要对 REST、GraphQL 或 gRPC 接口进行安全测试的时候。
- ✓接口有可以指导测试的 OpenAPI 或 Postman 架构文件的时候。
- ✓检查接口的授权漏洞,例如一个用户能读取另一个用户数据的时候。
技能链接
https://github.com/usestrix/strix/blob/main/skills/api-security-testing/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我有我们接口的 OpenAPI 文件。请帮我运行安全测试,检查用户能否访问彼此的数据吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会收集接口架构和测试账号,然后让自动化代理梳理各个端点并尝试风险情况。它会报告哪些问题确实可以被利用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Security-test an API
APIs fail differently from web UIs: there is no rendered surface to crawl, the interesting bugs are authorization-shaped rather than injection-shaped, and the same endpoint behaves differently per token. This workflow targets those specifics with Strix's autonomous agents, using the current OWASP API Security Top 10 (2023) as the coverage checklist. For the web-app equivalent, the current edition is the OWASP Top 10:2025 — see owasp-top-10-testing.
Install, LLM setup, full CLI flags, and the managed-cloud path are in the penetration-testing-with-strix skill. Read it if strix --version fails or the target is not an API. For a run with no Docker and no LLM key, the same binary drives the managed platform: strix cloud login, then strix cloud scans start ... (details in managed-pentesting-with-strix).
1. Gather what the agents need
APIs are near-impossible to test blind, so collect first:
| Input | Why it matters |
|---|---|
Schema — OpenAPI/Swagger file, Postman collection, GraphQL endpoint (introspection), or a gRPC .proto |
Turns guesswork into full endpoint enumeration. Biggest single win in coverage. An OpenAPI/Swagger or Postman spec (.json/.yaml/.yml) is a target Strix takes directly; a .proto is not, so pass it with --workspace-file. |
| Two sets of credentials/tokens, ideally in different tenants | BOLA/IDOR — API1:2023, still the #1 API risk — can only be proven by accessing tenant A's objects with tenant B's token. |
| A low-privilege and a high-privilege token | Required to prove broken function-level authorization (API5:2023 — a user calling admin-only routes). |
| Example object IDs | Lets agents test ID tampering immediately instead of hunting for valid identifiers. |
| Out-of-scope routes | Payments, mass notification, destructive admin endpoints. |
| Rate limits / WAF in front of the API | Avoids agents burning budget on throttled requests; mention them so testing adapts. |
Ask the user for anything missing — do not fabricate tokens or scan an API they do not own.
2. Run the scan
Pass the spec as a target, not as prose in the instruction — Strix parses OpenAPI/Swagger (.json/.yaml) and Postman collection exports directly, so the agents start from the real endpoint list:
strix -n -t ./openapi.yaml -t https://api.staging.example.com --max-budget 20 \
--instruction "Tenant A token: <tokenA> (org 1111, user id 11, order id 501).
Tenant B token: <tokenB> (org 2222, user id 22).
Admin token: <tokenAdmin>.
Focus: BOLA across orgs (API1), function-level authz on /admin/* (API5), object property level authz on PATCH /users/{id} — both mass assignment and over-exposed fields in list responses (API3), unrestricted resource consumption (API4).
Out of scope: POST /billing/*, POST /notifications/broadcast."
- Postman instead of OpenAPI: a collection export works as a target (
-t ./collection.postman_collection.json), or pull one live with-t postman://<collection-uuid>(optionally"postman://<collection-uuid>?env=<environment-uuid>"), which needsPOSTMAN_API_KEYin the environment. - Many services at once: put one target per line in a file and pass
--target-list ./targets.txt, repeatable and combinable with-t. - Add the backend source for depth:
-t ./services/api -t https://api.staging.example.com. With code access the agents can reason about authorization checks and object ownership rather than inferring them from responses. - gRPC: target the endpoint and pass the definition as a workspace file,
-t https://grpc.staging.example.com --workspace-file ./service.proto. Only.json,.yaml, and.ymlspecs are recognized as targets, so-t ./service.protofails with "Path exists but is not a directory". - GraphQL: point at the GraphQL endpoint and say whether introspection is enabled; call out that you want batching/aliasing abuse, depth/complexity limits, and per-field authorization tested.
- Internal/private APIs unreachable from your machine: use the managed platform's network connector — see managed-pentesting-with-strix.
- Use
--instruction-filewhen the credential/context block gets long, and keep tokens out of shell history and out of committed files. - Supporting files the agents should read but not test, such as an endpoint wordlist or handwritten notes about the tenancy model: pas
常见问题
测试需要哪些输入?
这个技能需要 OpenAPI、Postman、GraphQL 内省或 gRPC proto 文件等架构,以及测试账号。
它需要 Docker 或大模型密钥吗?
这个技能描述了一种无需 Docker 和大模型密钥的托管云端方式。
它遵循哪个标准?
它使用 2023 年版的 OWASP API 安全 Top 10 作为覆盖清单。
详情
作者的原始描述
Security-test a REST, GraphQL, or gRPC API with Strix — autonomous agents that enumerate endpoints from an OpenAPI/GraphQL schema (or by crawling), then actually exploit the API-specific vulnerability classes in the OWASP API Security Top 10 (2023) — broken object-level authorization (BOLA/IDOR), broken object property level authorization (excessive data exposure and mass assignment), broken function-level authorization, unrestricted resource consumption, SSRF, injection, and auth/token flaws. Every finding comes with a working proof-of-concept request. Use when the user asks to pentest, secur
repo: usestrix/strix
热度
- GitHub 星标
- 73k
- 排名
- #3095
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/30
评论
- …
同一仓库的更多技能
application-security-testing
73k帮你的智能体为整个产品规划安全测试,为每个部分选择合适的测试,运行它们,并按真实风险对修复工作排序。
ci-security-scanning-with-strix
73k教你的智能体为拉取请求添加自动安全扫描,让有风险的代码在合并前就被标记出来。
find-security-vulnerabilities-in-code
73k帮你的智能体审查代码中的安全缺陷,例如注入和失效的访问控制,并通过测试攻击证明哪些问题确实存在。
fix-security-vulnerabilities-with-strix
73k帮你的智能体把已确认的安全发现转化为有针对性的代码修复,然后重新运行测试,证明每种攻击都已失效。