Skip to content
Openshift β€’ β€’ 2 min read

How to enable and configure ETCD encryption on OpenShift Container Platform

How to enable and configure ETCD encryption on OpenShift Container Platform

Etcd encryption in OpenShift Container Platform is a crucial feature for protecting sensitive data stored in the cluster. In this article, we will explore the supported encryption types, the benefits of etcd encryption, and a step-by-step guide to enable it properly.


πŸ” Supported Encryption Types

OpenShift supports two encryption methods for etcd data:

AES-CBC

AES-GCM


πŸ”Ž About Etcd Encryption

By default, etcd data in OpenShift is not encrypted. Enabling etcd encryption adds an extra layer of security, protecting sensitive data from exposure in case of a backup leak.

Resources Affected by Etcd Encryption:

βœ” Secrets
βœ” ConfigMaps
βœ” Routes
βœ” OAuth Access Tokens
βœ” OAuth Authorization Tokens

It's important to note that encryption keys are essential for etcd backup restoration.


βš™οΈ How to Enable Etcd Encryption

⚠ Important: Do not back up etcd until the encryption process is fully completed.

Impact of Enabling Etcd Encryption:

Step-by-Step Guide to Enable Etcd Encryption

1️⃣ Edit the APIServer Object

Run the following command:

oc edit apiserver

2️⃣ Define the Encryption Type (AES-GCM or AES-CBC)

Modify the configuration as follows:

spec:
  encryption:
    type: aesgcm  # or 'aescbc'

πŸ“Œ Save and apply the changes. The encryption process may take more than 20 minutes, depending on the size of the etcd database.


βœ… Verifying If Encryption Was Applied

To confirm that encryption has been successfully enabled, run the following commands:

πŸ“Œ Check the OpenShift API Server Status

oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'

πŸ“Œ Check the OpenShift OAuth API Server Status

oc get authentication.operator.openshift.io -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'

If the output shows EncryptionInProgress, the process is still ongoing. Wait a few minutes and check again.

For more details, refer to the official documentation:
πŸ”— Encrypting etcd in OpenShift


πŸ’‘ Who Am I?

I am Gabriel Carmo, passionate about technology (especially Open Source). I have experience in Cloud, Kubernetes, OpenShift, Zabbix, Dynatrace, and more! Always exploring new technologies and sharing knowledge. πŸš€

πŸ“¬ Let’s Connect!
πŸ”— LinkedIn
πŸ™ GitHub
🦊 GitLab
πŸ… Credly
πŸ“§ Contact:
contato@gabrielandre.com.br

Openshift - Gabriel Andre Blog