Back to Checks
Etcd pod has TLS encryption configured
etcd_tls_encryption
Service: etcdSeverity: high
OfficialBuilt-inVerified
Categories:encryptioncluster-security
Resource Type:Pod
Etcd pods are assessed for TLS-enabled client communication, indicated by --cert-file and --key-file in container arguments, showing that Kubernetes API state traffic is encrypted in transit.
Risk
Without TLS, etcd traffic is exposed on the network, weakening CIA:
- Confidentiality: leakage of secrets and cluster state
- Integrity: MITM can alter configs, roles, and objects
- Availability: control-plane instability from tampered responses
Run this check with Prowler
Run in Prowler CloudRun
prowler kubernetes --checks etcd_tls_encryptionRecommendation
Enforce mTLS for etcd client and peer traffic and disable plaintext listeners. Restrict access to etcd to control-plane components via tight network policies and firewalls. Use strong TLS versions/ciphers, rotate certificates, and safeguard keys, applying least privilege and defense in depth.
Remediation
Other
1SSH to the control-plane node
2Open /etc/kubernetes/manifests/etcd.yaml
3In spec.containers[0].command add:
4- --cert-file=/etc/kubernetes/pki/etcd/server.crt
5- --key-file=/etc/kubernetes/pki/etcd/server.key
6Save the file; kubelet will automatically restart the etcd Pod
7Confirm the etcd container command now includes both --cert-file and --key-file
Check Code
from prowler.lib.check.models import Check, Check_Report_Kubernetes
from prowler.providers.kubernetes.services.etcd.etcd_client import etcd_client
class etcd_tls_encryption(Check):
def execute(self) -> Check_Report_Kubernetes:
findings = []
for pod in etcd_client.etcd_pods:
report = Check_Report_Kubernetes(metadata=self.metadata(), resource=pod)
report.status = "FAIL"
report.status_extended = (
f"Etcd does not have TLS encryption configured in pod {pod.name}."
)
for container in pod.containers.values():
if "--cert-file" in str(container.command) and "--key-file" in str(
container.command
):
report.status = "PASS"
report.status_extended = (
f"Etcd has configured TLS encryption in pod {pod.name}."
)
findings.append(report)
return findings