What problem does it solve?
Implements a comprehensive set of controls to prevent API credential leakage, brute-force abuse, and unauthorized access by ensuring secure generation, safe storage, scoped usage, monitoring, and timely rotation of API keys.
Core Features & Use Cases
- Secure Key Generation: Create high-entropy, prefixed API keys suitable for leak detection and environment separation.
- Safe Storage & Validation: Store only cryptographic hashes (e.g., SHA-256) of keys, use caching (Redis) for fast validation, and never persist plaintext keys.
- Rotation & Revocation: Support zero-downtime key rotation with grace periods and immediate revocation workflows for exposed keys.
- Scoping & Rate Limiting: Enforce per-key scopes, IP allowlists, and rate limits to reduce blast radius of compromised keys.
- Leak Detection & Automation: Integrate secret scanners (gitleaks, truffleHog) and automated revocation/notification when leaks are discovered.
- Use Case: A developer platform with millions of daily requests uses this Skill to automatically detect leaked keys in public repos, revoke them, and rotate affected keys with minimal consumer impact.
Quick Start
Generate a secure prefixed API key, store only its SHA-256 hash in your database, cache validation in Redis, assign scopes and rate limits, and create a 24-hour grace-period rotation schedule.