etcd automatic TLS is enabled

Distinguish etcd automatic TLS encryption from certificate trust and endpoint identity verification.

Description

With --auto-tls=true, etcd generates a self-signed certificate for client connections. In production, use a certificate issued by a CA your clients trust so they can verify the etcd server.

Potential impact

Even on an encrypted connection, a client that skips server certificate verification can connect to the wrong server.

Remediation

  1. Mount the server certificate and private key in etcd, configure HTTPS addresses and give clients the CA they need to verify the server.
  2. Remove --auto-tls=true or set it to false as you apply the prepared configuration. Configure client authentication if etcd also needs to verify its clients.
  3. Check that approved connections succeed and untrusted certificates are rejected. Manage certificate issuance and renewal.

Examples

These excerpts show etcd 3.2.18 arguments. Use a supported version in production.

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: ["--auto-tls=true"]

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: []

The second excerpt only removes the automatic TLS argument. Supply the server certificate, key and HTTPS addresses separately.

References