etcd TLS certificate file configuration is incomplete

Provide a matching etcd certificate and private key, and verify actual HTTPS connections.

Description

To serve clients over HTTPS with a managed certificate, give etcd the server certificate and its matching private key through --cert-file and --key-file.

Potential impact

A mismatched pair can prevent etcd from starting or clients from connecting. Switching to HTTP to restore connectivity can expose data in transit.

Remediation

Mount both files at the specified paths and restrict read access to the key. Use HTTPS for the etcd listen address and client endpoints. Check that clients can connect and verify the server against a trusted CA, including after renewal. If etcd must authenticate clients by certificate, configure that verification too.

Examples

These etcd 3.2.18 excerpts show the arguments. Use a supported version and the actual mount paths 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: ["--cert-file=/etc/env/file.crt"]

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: ["--cert-file=/etc/env/file.crt", "--key-file=/etc/env/file2.key"]

The second excerpt adds the private key for the server certificate already specified in --cert-file.

References