Description
To encrypt Secrets when kube-apiserver writes to etcd, set --encryption-provider-config to an encryption configuration file. The resource list and first provider determine which writes are encrypted.
Potential impact
Someone with access to unencrypted etcd data can read Secret values. Manage disk encryption and API read permissions separately.
Remediation
Coordinate the rollout so every API server can read existing and new data. Restrict access to key files, keep them out of source control and retain recovery keys securely. Rewrite existing resources after enabling encryption, then verify the stored values are encrypted.
Examples
Mount a valid EncryptionConfiguration read-only at the example path and use an image matching your cluster version.
Before
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: registry.k8s.io/kube-apiserver:v1.34.0
command: ["kube-apiserver"]
args: []
After
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: registry.k8s.io/kube-apiserver:v1.34.0
command: ["kube-apiserver"]
args: ["--encryption-provider-config=/path/to/config/file.yaml"]