Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

api-security

БесплатноБез исполняемых скриптовНе проверен

Guideline for designing, implementing, and verifying secure APIs following OWASP API Security Top 10 (2023) best practices. Use when the user wants to: (1)…

jim60105от jim60105★ 22 звезды на GitHub

Об этом скилле

API Security Development Guide

Structured approach to building secure APIs, covering OWASP API Security Top 10 (2023), secure design patterns, and verification checklists. Apply these guidelines throughout the API development lifecycle — from threat modeling to deployment monitoring.

Secure API Development Lifecycle

Phase 1: API Threat Modeling and Design

  • Identify API attack surfaces: public endpoints, authenticated endpoints, admin endpoints, webhooks, third-party integrations
  • Map data flows: what sensitive data crosses each API boundary
  • Define authorization model: which users/roles access which resources and properties
  • Design security controls:
    • Centralized authentication (OAuth2/OIDC at API gateway)
    • Object-level authorization at data access layer
    • Schema-based input validation at every endpoint
    • Rate limiting per endpoint sensitivity
    • API versioning with deprecation strategy

Phase 2: Secure Implementation

Critical API Security Rules

Never Instead
Return full objects (to_dict/to_json) Explicit response schemas with cherry-picked fields
Accept arbitrary fields for update Allowlisted update schemas (prevent mass assignment)
Use sequential/guessable IDs in URLs UUIDs/GUIDs for resource identifiers
Trust object ID alone for access Check object ownership against authenticated user
Rely on client-side role checks Server-side RBAC/ABAC middleware
Accept unlimited query params/body Schema validation with size/type/range limits
Skip rate limiting on any endpoint Rate limit ALL endpoints, stricter on auth/business flows
Return stack traces in errors RFC 7807 Problem Details with generic messages
Trust third-party API responses Validate and sanitize all external API data
Put API keys in URLs Use Authorization header or secure key vault
Use wildcard CORS with credentials Explicit origin allowlist
Allow unlimited GraphQL depth/complexity Query depth + complexity + batch limits

Reference detailed guides:

Phase 3: API Security Verification

  1. Schema Validation — Lint OpenAPI spec for security issues (Spectral)
  2. Static Analysis — Run SAST on API code (Semgrep, bandit)
  3. Contract Testing — Verify API behavior matches spec (Schemathesis, Dredd)
  4. Dynamic Testing — Run DAST against running API (OWASP ZAP, Burp Suite)
  5. Authorization Testing — Test every endpoint with wrong user/role/anonymous
  6. Rate Limit Testing — Verify all endpoints enforce limits
  7. Code Review — Apply API security checklists

Reference: See references/api-security-checklist.md

Phase 4: Deployment and Monitoring

  • API gateway: auth offloading, rate limiting, request logging
  • TLS 1.2+ enforcement, HSTS, security headers
  • Structured logging (no tokens/PII in logs)
  • Anomaly detection and alerting on security events
  • API inventory management and version deprecation
  • Incident response plan for API breaches

OWASP API Security Top 10 (2023) Quick Reference

# Risk Key Concern Primary Prevention
API1 Broken Object Level Authorization Accessing other users' resources by manipulating IDs Object ownership check at data layer, use GUIDs
API2 Broken Authentication Weak auth, credential stuffing, JWT flaws OAuth2/OIDC, short-lived tokens, rate limit auth
API3 Broken Object Property Level Authorization Excessive data exposure + mass assignment Explicit response/request schemas, field allowlists
API4 Unrestricted Resource Consumption No rate/size/cost limits, GraphQL batching Rate limiting, pagination caps, spending alerts
API5 Broken Function Level Authorization Regular users accessing admin functions RBAC middleware, deny by default, test all roles
API6 Unrestricted Access to Sensitive Business Flows Automating business-critical operations (scalping, spam) CAPTCHA, device fingerprinting, behavior analysis
API7 Server Side Request Forgery API fetches user-supplied URLs URL allowlisting, block private IPs, disable redirects
API8 Security Misconfiguration Missing headers, CORS *, verbose errors, debug endpoints Hardened defaults, security headers, minimal errors
API9 Improper Inventory Management Shadow APIs, deprecated versions, no documentation API inventory, OpenAPI in CI/CD, retirement plans
API10 Unsafe Consumption of APIs Trusting third-party API data without validation Validate all external data, enforce TLS, set timeouts

For detailed attack scenarios and code examples: See references/owasp-api-top-10.md

API Security Re

Полный SKILL.md на GitHub

Установить api-security в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/api-security-checklist.mdreferences/owasp-api-top-10.mdreferences/secure-api-design.md

FAQ

Что делает скилл api-security?

Guideline for designing, implementing, and verifying secure APIs following OWASP API Security Top 10 (2023) best practices. Use when the user wants to: (1) review API code or design for security vulnerabilities, (2) design a secure REST, GraphQL, or gRPC API architecture, (3) implement API authentication and authorization (OAuth2, JWT, API keys, mTLS), (4) configure rate limiting, input validation, or CORS, (5) audit API endpoints for BOLA, BFLA, or mass assignment vulnerabilities, (6) create API security checklists or verification plans, (7) fix API security bugs or harden existing APIs, (8) set up API security testing (OWASP ZAP, Schemathesis, Burp Suite), or (9) handle any API security concern including SSRF prevention, resource consumption limits, business flow protection, API inventory management, and secure third-party API consumption.

Как установить скилл api-security?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл api-security запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить api-security с