mcpField
S
secrets-rotation

secrets-rotation

github.com/aj-geddesSecurity373455 installsUpdated 34w ago
Repository

About secrets-rotation

A skill for developers implementing automated rotation of credentials, API keys, certificates, and encryption keys. It focuses on zero-downtime deployment, audit records, and recovery procedures.

Key features

  1. 01Automate rotation of credentials and keys
  2. 02Support zero-downtime rotation strategies
  3. 03Maintain rotation audit trails
  4. 04Cover verification, rollback, and failure monitoring
  5. 05Reference guides for multiple platforms

Use cases

  1. 01Rotate database credentials and API keys
  2. 02Manage TLS/SSL certificate updates
  3. 03Meet compliance audit requirements
  4. 04Replace credentials during security incidents

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill secrets-rotation

After installing, type/secrets-rotationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
kubernetes-secrets-rotation.md
nodejs-secrets-manager-with-rotation.md
python-secrets-rotation-with-vault.md
scripts/
security-checklist.sh

Details

From the project README

Secrets Rotation

Table of Contents

Overview

Implement automated secrets rotation strategy for credentials, API keys, certificates, and encryption keys with zero-downtime deployment and comprehensive audit logging.

When to Use

  • API key management
  • Database credentials
  • TLS/SSL certificates
  • Encryption key rotation
  • Compliance requirements
  • Security incident response
  • Service account management

Quick Start

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)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Node.js Secrets Manager with RotationNode.js Secrets Manager with Rotation
Python Secrets Rotation with VaultPython Secrets Rotation with Vault
Kubernetes Secrets RotationKubernetes Secrets Rotation

Best Practices

✅ DO
  • Automate rotation
  • Use grace periods
  • Verify new secrets
  • Maintain rotation audit trail
  • Implement rollback procedures
  • Monitor rotation failures
  • Use managed services (AWS Secrets Manager)
  • Test rotation procedures
❌ DON'T
  • Hardcode secrets
  • Share secrets
  • Skip verification
  • Rotate without grace period
  • Ignore rotation failures
  • Store secrets in version control

Comments

Markdown supported