Review etcd client certificate authentication

Require trusted client certificates on etcd HTTPS connections.

Description

Check whether etcd verifies client certificates on its HTTPS endpoint. In etcd 3.4, setting --trusted-ca-file enables verification even when --client-cert-auth=false.

Potential impact

If client verification and other access controls are insufficient, someone with network access could read or change cluster data.

Remediation

  1. Configure the etcd HTTPS endpoint, server certificate and private key. Set --client-cert-auth=true and point --trusted-ca-file to the CA that issued the client certificates.
  2. Give each approved client its certificate and key, and configure it to verify the etcd server certificate.
  3. Check that a trusted client can connect and an invalid certificate is rejected. Limit network access and grant only the data permissions each client needs.

Examples

The etcd 3.2.18 examples change the client verification flag from false to true. They omit the HTTPS addresses, CA and certificate files.

Before

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-etcd-deployment
spec:
  template:
    spec:
      containers:
        - name: database
          image: gcr.io/google_containers/etcd:v3.2.18
          command: ["etcd"]
          args: ["--client-cert-auth=false"]

After

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-etcd-deployment
spec:
  template:
    spec:
      containers:
        - name: database
          image: gcr.io/google_containers/etcd:v3.2.18
          command: ["etcd"]
          args: ["--client-cert-auth=true"]

References