api-security
Installation
SKILL.md
api-security {Security} (v1.0)
"Security is not a feature. It's every feature's foundation."
Purpose
Firebase App Check (reCAPTCHA v3). API key restrictions. Rate limiting in Cloud Functions. Request signing. [EXPLICIT] When to use: Implementing authentication, authorization, or security measures in Firebase projects.
Core Principles
- Law of Auth First: No endpoint without authentication. Firebase ID token verification is mandatory. [EXPLICIT]
- Law of Least Privilege: Users get minimum permissions needed. Custom claims define roles. [EXPLICIT]
- Law of Defense in Depth: Client validation + Security Rules + Cloud Functions validation. Three layers. [EXPLICIT]
Core Process
Phase 1: Assess security requirements from spec.
Phase 2: Implement auth, authorization, and security measures.
Phase 3: Audit with OWASP checklist. Test rules with emulator.
Validation Gate
- Auth implemented on all endpoints
- Security rules cover all Firestore collections
- OWASP Top 10 mitigations addressed
- Secrets in Secret Manager (not in code)
- Privacy compliance documented