api-security
БесплатноЗапускает вложенные скриптыНе проверен1. Broken Object Level Authorization (BOLA) - API fails to validate user access to objects 2. Broken Authentication - Weak or missing authentication…
Об этом скилле
API Security
Level System: Each skill contains three progressive levels
- Level 1: Quick Reference (600-800 tokens) - Essential patterns and checklists
- Level 2: Implementation Guide (3000-4500 tokens) - Detailed practices and examples
- Level 3: Deep Dive - Additional resources and advanced topics
Level 1: Quick Reference
OWASP API Security Top 10 (2023)
- Broken Object Level Authorization (BOLA) - API fails to validate user access to objects
- Broken Authentication - Weak or missing authentication mechanisms
- Broken Object Property Level Authorization - Missing field-level access control
- Unrestricted Resource Consumption - No rate limiting or throttling
- Broken Function Level Authorization - Missing authorization checks on endpoints
- Unrestricted Access to Sensitive Business Flows - Automated abuse of legitimate workflows
- Server Side Request Forgery (SSRF) - API accepts URLs without validation
- Security Misconfiguration - Insecure default configs, verbose errors
- Improper Inventory Management - Undocumented/deprecated APIs in production
- Unsafe Consumption of APIs - Trusting third-party API data without validation
Essential Security Checklist
transport_security:
- [ ] TLS 1.2+ enforced on all endpoints
- [ ] HSTS headers configured
- [ ] Certificate pinning for mobile clients
authentication:
- [ ] API keys rotated regularly
- [ ] OAuth 2.0 with PKCE for public clients
- [ ] JWT tokens with short expiration (15-60 min)
- [ ] Refresh token rotation implemented
authorization:
- [ ] Object-level authorization on all resources
- [ ] Field-level authorization for sensitive data
- [ ] Role-based or attribute-based access control
input_validation:
- [ ] Schema validation on all inputs
- [ ] Content-Type verification
- [ ] Request size limits enforced
- [ ] SQL injection prevention (parameterized queries)
rate_limiting:
- [ ] Per-user rate limits (e.g., 100 req/min)
- [ ] Per-IP rate limits for unauthenticated endpoints
- [ ] Exponential backoff on failed auth attempts
- [ ] Resource-specific quotas
monitoring:
- [ ] Authentication failures logged
- [ ] Authorization failures alerted
- [ ] Anomalous patterns detected (sudden spikes)
- [ ] Security events centralized (SIEM)
cors_configuration:
- [ ] Allowlist specific origins (no wildcards in prod)
- [ ] Credentials flag set appropriately
- [ ] Preflight cache configured
api_versioning:
- [ ] Deprecated versions documented
- [ ] Sunset headers on old versions
- [ ] Security fixes backported to supported versions
Quick Rate Limiting Pattern
# Python with Flask-Limiter
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
limiter = Limiter(
app,
key_func=get_remote_address,
default_limits=["200 per day", "50 per hour"],
storage_uri="redis://localhost:6379"
)
@app.route("/api/resource")
@limiter.limit("10 per minute")
def api_resource():
return {"data": "protected"}
Quick JWT Validation Pattern
// Node.js with jsonwebtoken
const jwt = require('jsonwebtoken');
function authenticateToken(req, res, next) {
const token = req.headers['authorization']?.split(' ')[1];
if (!token) return res.sendStatus(401);
jwt.verify(token, process.env.JWT_SECRET, (err, user) => {
if (err) return res.sendStatus(403);
req.user = user;
next();
});
}
Level 2:
📚 Full Examples: See REFERENCE.md for complete code samples, detailed configurations, and production-ready implementations.
Implementation Guide
2.1 Authentication Mechanisms
API Key Authentication
Use Case: Server-to-server communication, simple client auth
Implementation Best Practices:
See REFERENCE.md for complete implementation.
Security Considerations:
- Store only hashed keys in database (SHA-256 minimum)
- Use HTTPS exclusively
- Implement key rotation policy
- Support key revocation
- Log key usage for audit trails
- Consider key prefixes for identification (e.g.,
sk_live_...)
OAuth 2.0 with PKCE
Use Case: Third-party integrations, mobile/SPA clients
See REFERENCE.md for complete implementation.
JWT Token Management
Best Practices:
See REFERENCE.md for complete implementation.
JWT Security Checklist:
- Use RS256 (asymmetric) for multi-service architectures
- Keep access tokens short-lived (15-60 minutes)
- Implement refresh token rotation
- Store refresh tokens securely (hashed in DB)
- Include
jti(JWT ID) claim for revocation - Validate
exp,iat,iss,audclaims - Never store sensitive data in JWT payload
2.2 Rate Limiting and Throttling
Multi-Tier Rate Limiting
*See REFERENCE.md for complete
Установить api-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл api-security?
1. Broken Object Level Authorization (BOLA) - API fails to validate user access to objects 2. Broken Authentication - Weak or missing authentication mechanisms 3. Broken Object Property Level Authorization - Missing field-level access control 4. Unrestricted Resource Consumption - No rate limiting or throttling 5. Broken Function Level Authorization - Missing authorization checks on endpoints 6. Unrestricted Access to Sensitive Business Flows - Automated abuse of legitimate workflows 7. Server Side Request Forgery (SSRF) - API accepts URLs without validation 8. Security Misconfiguration - Insecure default configs, verbose errors 9. Improper Inventory Management - Undocumented/deprecated APIs in production 10. Unsafe Consumption of APIs - Trusting third-party API data without validation
Как установить скилл api-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-security запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic