
Securing critical infrastructure components is paramount in today’s digital landscape. Among these, etcd stands out as a vital distributed key-value store, often serving as the backbone for systems like Kubernetes, storing their entire state. Given the sensitive nature of the data it holds, protecting etcd from unauthorized access is not merely recommended, but essential. By default, etcd communication might not be encrypted or authenticated, creating a significant vulnerability.
The robust solution to this challenge is implementing SSL/TLS encryption and authentication. This process ensures that data transmitted to and from etcd is encrypted, preventing eavesdropping. More importantly, through mutual TLS (mTLS), it verifies the identity of both the server (etcd) and the clients attempting to connect, ensuring only trusted components can communicate.
Implementing this security layer typically involves several key steps on RHEL/CentOS systems:
1. Establishing a Certificate Authority (CA): The first step is often to set up your own internal CA. This CA will be responsible for signing the certificates for your etcd servers and clients. Generating a root CA key and certificate is the foundational element for establishing trust within your infrastructure.
2. Generating Certificates for etcd Servers: Each etcd server needs its own certificate and key. These are generated using the CA’s key to sign the server’s certificate signing request (CSR). The server certificate must include the server’s IP addresses and hostnames in the Subject Alternative Name (SAN) field so clients can verify its identity correctly.
3. Generating Certificates for etcd Clients: Similarly, any component that needs to interact with etcd (like the Kubernetes API server or other management tools) requires a client certificate and key. These are also signed by your CA. Client certificates are crucial for enforcing mutual authentication, where etcd verifies the client’s identity before processing requests.
4. Configuring the etcd Service: Once certificates are generated, the etcd service configuration needs to be updated. This typically involves modifying the systemd service file or configuration parameters to point etcd to the CA certificate file, its own server certificate, and its private key. You’ll also configure it to listen securely using https and specify client certificate requirements (client-cert-auth).
5. Distributing Certificates: The CA certificate needs to be distributed to all machines running etcd clients so they can trust the etcd server’s certificate. Similarly, client certificates and keys must be securely placed on the respective client machines. Properly securing these certificate files on the filesystem is critical.
6. Verifying the Configuration: After restarting the etcd service with the new configuration, verify that it is listening on the secure HTTPS port and that clients can connect successfully using their client certificates. Tools like etcdctl configured with the client certificates are essential for testing connectivity and operations.
Security Best Practices:
- Keep CA, server, and client keys highly secure. Treat private keys as sensitive secrets.
- Use strong, unique passwords if encrypting private keys.
- Regularly rotate your certificates according to your organization’s security policy.
- Restrict file permissions for all certificate and key files to prevent unauthorized access.
- Implement strict firewall rules to limit access to the etcd cluster even with TLS enabled.
By meticulously following these steps, you significantly strengthen the security posture of your etcd cluster, protecting the critical state data that powers your core services on RHEL/CentOS environments. Implementing SSL/TLS with mutual authentication is a fundamental requirement for any production etcd deployment.
Source: https://infotechys.com/configuring-secure-etcd-with-ssl-tls-on-rhel-8/


