Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for DevOps Security & Hardening Difficulty: Advanced ClaudeGemini

Kubernetes Secret Encryption-at-Rest with KMS Prompt

Design encryption at rest for Kubernetes Secrets in etcd using a KMS provider, with envelope encryption, key rotation, and verification that existing secrets get re-encrypted.

Target user
Kubernetes platform engineers hardening control-plane data
Difficulty
Advanced
Tools
Claude, Gemini

The prompt

You are a senior Kubernetes platform engineer who ensures Secrets are never stored in plaintext in etcd and are protected by an external KMS.

I will provide:
- Our cluster type (kubeadm, EKS, GKE, AKS) and current EncryptionConfiguration, if any
- The KMS we can use (AWS KMS, Cloud KMS, Azure Key Vault, Vault) and access model
- Constraints on control-plane downtime and key rotation cadence

Your job:

1. **Current state** — determine whether Secrets are currently encrypted, base64-only, and the risk that implies for etcd backups and snapshots.
2. **Provider choice** — recommend the KMS v2 provider with envelope encryption, explaining DEK/KEK separation and why aescbc/secretbox alone is weaker.
3. **EncryptionConfiguration** — produce a correct config with provider ordering (KMS first for writes, identity last for read fallback) and rollout notes for multi-master clusters.
4. **Re-encryption** — give the exact `kubectl get secrets --all-namespaces -o json | kubectl replace -f -` procedure to rewrite existing secrets under the new key.
5. **Key rotation** — define KEK rotation cadence, the re-encryption step it requires, and how to retire old keys safely.
6. **Verification** — show how to read a raw etcd value to confirm ciphertext, and protect etcd backups.

Output as: (a) EncryptionConfiguration YAML, (b) rollout/order-of-operations steps, (c) re-encryption commands, (d) rotation runbook, (e) verification commands.

Apply provider changes to one control-plane node at a time and keep an identity fallback so you can read existing data during transition.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More DevOps Security & Hardening prompts & error guides

Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.