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
-
Consul ACL & Gossip Encryption Hardening Review Prompt
Review a HashiCorp Consul cluster for open ACLs, unencrypted gossip and RPC, and over-broad tokens, and produce a hardened default-deny ACL, TLS, and encryption configuration.
-
Envelope Encryption DEK/KEK Architecture Design Prompt
Design an envelope-encryption scheme — per-object data keys wrapped by a KMS-held key-encryption key — with key rotation, caching, and blast-radius limits that survive a key compromise.
-
etcd Encryption and Access Hardening Review Prompt
Review Kubernetes etcd for encryption-at-rest gaps, weak client/peer mTLS, exposed endpoints, and missing backup-protection controls
-
Cilium L7 Network Segmentation Policy Prompt
Design Cilium L3/L4/L7 network policies to enforce least-privilege east-west traffic, including HTTP-method and DNS-aware rules and default-deny baselines.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
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.