From aj-geddes-useful-ai-prompts-4
Implements automated secrets rotation for API keys, credentials, certificates, and encryption keys. Use for secrets lifecycle management, compliance, and security hardening.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:secrets-rotationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Implement automated secrets rotation strategy for credentials, API keys, certificates, and encryption keys with zero-downtime deployment and comprehensive audit logging.
Minimal working example:
// secrets-manager.js
const AWS = require("aws-sdk");
const crypto = require("crypto");
class SecretsManager {
constructor() {
this.secretsManager = new AWS.SecretsManager({
region: process.env.AWS_REGION,
});
this.rotationSchedule = new Map();
}
/**
* Generate new secret value
*/
generateSecret(type = "api_key", length = 32) {
switch (type) {
case "api_key":
return crypto.randomBytes(length).toString("hex");
case "password":
// Generate strong password
const chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Node.js Secrets Manager with Rotation | Node.js Secrets Manager with Rotation |
| Python Secrets Rotation with Vault | Python Secrets Rotation with Vault |
| Kubernetes Secrets Rotation | Kubernetes Secrets Rotation |
npx claudepluginhub aj-geddes/useful-ai-promptsManage API keys, credentials, and secrets securely using vaults, environment variables, and rotation policies. Prevent secrets from being committed to code or exposed in logs.
Automates AWS secrets rotation for RDS, API keys, and credentials using Secrets Manager and Lambda. Includes CLI commands and Python rotation function examples.
Guides key rotation management with step-by-step instructions, best practices, and production-ready configurations for enterprise security.