Command Palette

Search for a command to run...

Назад к скиллам
скилл № 82559

security-api-security

Use this skill when asked about API security, OWASP API Top 10, rate limiting, API authentication, JWT security, OAuth2, API key management, API gateway, WAF…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

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

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

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

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

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

Security API Security

Purpose

Design comprehensive API security controls covering OWASP API Top 10 threat modeling, authentication (JWT, OAuth2, API keys), rate limiting (token bucket, sliding window, per-user/per-endpoint), input validation (JSON schema, allowlist), WAF rules (ModSecurity CRS), request signing, and audit logging.

Agent Protocol

Trigger

Exact user phrases: "API security", "OWASP API Top 10", "rate limiting", "API auth", "JWT security", "OAuth2", "API gateway", "WAF", "API abuse", "API threat modeling", "API protection", "API authentication", "API authorization", "API keys", "OAuth2 API", "API gateway config", "request signing", "API audit", "GraphQL security".

Input Context

Before activating, verify:

  • API style (REST, GraphQL, gRPC) and framework
  • Authentication mechanism (JWT, OAuth2, session, API keys)
  • API gateway (Kong, APIGW, Envoy, Nginx, AWS Gateway)
  • Deployment environment and traffic patterns
  • Compliance requirements (GDPR, PCI, SOC 2)
  • Number of API consumers and tiers

Output Artifact

API security checklist with threat model, protection configuration, monitoring setup.

Response Format

# Threat model table
# Rate limit policy
# WAF rules
# Auth middleware config
# Audit log schema

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • Threat model completed against OWASP API Top 10
  • Authentication mechanism selected and configured
  • Authorization model with least privilege defined
  • Rate limiting policy with tiered quotas
  • Input validation rules for all endpoints
  • WAF rules for API-specific attacks
  • Audit logging and abuse monitoring configured
  • Request signing for critical operations

Max Response Length

300 lines of configuration and policy.

Workflow

Step 1: Threat Modeling (OWASP API Top 10)

Map each resource against OWASP API Top 10:

API1: Broken object-level authorization. Check user owns resource via JWT sub claim. Use UUIDs, not sequential IDs.

API2: Broken authentication. Weak JWT, no MFA, no login rate limit. Enforce strong passwords, short-lived tokens.

API3: Excessive data exposure. Return only needed fields per endpoint. Never return password hashes or internal IDs.

API4: Rate limiting. No throttling leads to DoS. Paginate lists, limit body size, rate limit.

API5: Broken function-level auth. Deny by default, test all roles against all endpoints.

API6: Mass assignment. Use DTOs, whitelist updatable fields only.

API7: Security misconfiguration. CORS misconfigured, debug endpoints exposed. Audit configs, disable debug in production.

API8: Injection. SQL, NoSQL, command injection. Parameterized queries, input validation.

API9: Improper asset management. Old API versions running unpatched. Maintain OpenAPI spec inventory.

API10: Unsafe consumption. API consuming compromised external service. Validate external responses, timeout calls.

Step 2: Authentication

JWT: RS256 or ES256 asymmetric signing. Access token: 15 min expiry. Refresh token: 7 days with rotation. Claims: sub, iss, aud, exp, iat, jti, scope. Validate signature, expiry, issuer, audience on every request.

OAuth2 flows: Authorization Code + PKCE for SPAs. Client Credentials for M2M. Device grant for CLI tools. Rotate refresh tokens on each use.

API keys: Cryptographically random, prefixed identifier. Hashed at rest with bcrypt. Rate-limited per key with tiered quotas. Revocable with immediate invalidation. Scoped to specific resources and actions.

Ban: basic auth, session cookies, JWT with alg: none.

Step 3: Authorization

RBAC: roles assigned to users, permissions assigned to roles. Deny by default, whitelist allowed actions.

ABAC: attribute-based fine-grained access. Check resource owner, region, tier, time.

API gateway: validate JWT, extract scopes. Pass claims upstream via request headers.

Service layer: check resource ownership. userId == resource.ownerId. Validate actions against role matrix.

Policy-as-code: OPA for cross-cutting authorization. Organization-level and multi-resource policies.

Test: every role against every endpoint in CI. Automated authorization fuzzing. Regression test for each access control change.

Step 4: Rate Limiting

Algorithms: Sliding window log: most accurate, most memory. Sliding window counter: accurate, efficient (default). Token bucket: allows bursts, easy to understand. Fixed window: simple but edge case bursts.

Per client: by API key, IP, or JWT sub claim. Tiers: free (10/min), basic (100/min), premium (1000/min). Burst: 2x rate with 503 on sustained overage.

Per endpoint: login (5/min), search (30/min), export (2/min). Global: 10000 req/min per gateway instance.

Response: 429 Too Many Requests. Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining.

Distributed: Redis-based counter with consistent hashing.

Step 5: Input Validati

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

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

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

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

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

  • references/api-auth-patterns.md
  • references/api-protection.md
  • references/api-security-advanced.md
  • references/api-security-fundamentals.md
  • references/api-security-testing.md
  • references/api-threats.md
  • references/graphql-security.md
  • references/oauth2-deep-dive.md

FAQ

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

Use this skill when asked about API security, OWASP API Top 10, rate limiting, API authentication, JWT security, OAuth2, API key management, API gateway, WAF, API abuse, request signing, or API threat modeling. This skill enforces: OWASP API Top 10 threat modeling, authentication/authorization patterns (JWT, OAuth2, API keys), rate limiting with tiered policies (token bucket, sliding window, per-user/per-endpoint), input validation and WAF rules, request signing, and audit logging. Do NOT use for: web application security (XSS, CSRF), network security (TLS, mTLS), or container security.

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

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

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

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

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

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