Implement automated secrets rotation for API keys, credentials, certificates, and encryption keys. Use when managing secrets lifecycle, compliance requirements, or security hardening.
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 |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/secrets-rotation · pinned to the source commit
git clone https://github.com/aj-geddes/useful-ai-prompts.git
cd useful-ai-prompts
git checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills/secrets-rotation"
cp -r "skills/secrets-rotation" ".claude/skills/secrets-rotation"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
References credentials, tokens or secret files that a skill should not need.
Evidence: [redacted]· fingerprint e9cbb0224c4a3d23