Encryption providers are not properly configured
ID |
api_server_encryption_providers |
Severity |
high |
Vendor |
Kubernetes |
Resource |
kube-apiserver |
Tags |
reachable |
Description
The Kubernetes API Server validates and configures data for the api objects which include pods, services, replication controllers, and others.
The API Server services REST operations and provides the frontend to the cluster’s shared state through which all other components interact.
The kube-apiserver
process accepts an argument --encryption-provider-config
that controls how API data is encrypted in etcd.
An appropriate set of encryption providers must be used. Currently, the aescbc
, kms
and secretbox
are likely to be appropriate options.
Learn more about this topic at Encrypting Secret Data at Rest.
Examples
apiVersion: v1
kind: Pod
metadata:
name: bad (1)
namespace: kube-system
spec:
containers:
- command:
- kube-apiserver
image: gcr.io/google_containers/kube-apiserver-amd64:v1.9.0
name: bad
livenessProbe:
failureThreshold: 8
httpGet:
host: 127.0.0.1
path: /health
port: 6443
scheme: HTTPS
initialDelaySeconds: 15
timeoutSeconds: 15
resources:
requests:
cpu: 250m
volumeMounts:
- mountPath: /etc/kubernetes/
name: k8s
readOnly: true
- mountPath: /etc/ssl/certs
name: certs
- mountPath: /etc/pki
name: pki
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes
name: k8s
- hostPath:
path: /etc/ssl/certs
name: certs
- hostPath:
path: /etc/pki
name: pki
1 | Missing --encryption-provider-config command argument means encryption providers configuration is not set. |
Mitigation / Fix
apiVersion: v1
kind: Pod
metadata:
name: good
namespace: kube-system
spec:
containers:
- command:
- kube-apiserver
- --encryption-provider-config=config.file (1)
image: gcr.io/google_containers/kube-apiserver-amd64:v1.9.0
name: good-container
livenessProbe:
failureThreshold: 8
httpGet:
host: 127.0.0.1
path: /health
port: 6443
scheme: HTTPS
initialDelaySeconds: 15
timeoutSeconds: 15
resources:
requests:
cpu: 250m
volumeMounts:
- mountPath: /etc/kubernetes/
name: k8s
readOnly: true
- mountPath: /etc/ssl/certs
name: certs
- mountPath: /etc/pki
name: pki
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes
name: k8s
- hostPath:
path: /etc/ssl/certs
name: certs
- hostPath:
path: /etc/pki
name: pki
1 | Provided --encryption-provider-config command argument means encryption providers configuration is set. |