Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 15. Encrypting etcd data
15.1. About etcd encryption Link kopierenLink in die Zwischenablage kopiert!
By default, etcd data is not encrypted in OpenShift Container Platform. You can enable etcd encryption for your cluster to provide an additional layer of data security. For example, it can help protect the loss of sensitive data if an etcd backup is exposed to the incorrect parties.
When you enable etcd encryption, the following OpenShift API server and Kubernetes API server resources are encrypted:
- Secrets
- Config maps
- Routes
- OAuth access tokens
- OAuth authorize tokens
When you enable etcd encryption, encryption keys are created. You must have these keys to restore from an etcd backup.
Etcd encryption only encrypts values, not keys. Resource types, namespaces, and object names are unencrypted.
If etcd encryption is enabled during a backup, the
static_kuberesources_<datetimestamp>.tar.gz
15.2. Supported encryption types Link kopierenLink in die Zwischenablage kopiert!
The following encryption types are supported for encrypting etcd data in OpenShift Container Platform:
- AES-CBC
- Uses AES-CBC with PKCS#7 padding and a 32 byte key to perform the encryption. The encryption keys are rotated weekly.
- AES-GCM
- Uses AES-GCM with a random nonce and a 32 byte key to perform the encryption. The encryption keys are rotated weekly.
15.3. Enabling etcd encryption Link kopierenLink in die Zwischenablage kopiert!
You can enable etcd encryption to encrypt sensitive resources in your cluster.
Do not back up etcd resources until the initial encryption process is completed. If the encryption process is not completed, the backup might be only partially encrypted.
After you enable etcd encryption, several changes can occur:
- The etcd encryption might affect the memory consumption of a few resources.
- You might notice a transient affect on backup performance because the leader must serve the backup.
- A disk I/O can affect the node that receives the backup state.
You can encrypt the etcd database in either AES-GCM or AES-CBC encryption.
To migrate your etcd database from one encryption type to the other, you can modify the API server’s
spec.encryption.type
Prerequisites
-
Access to the cluster as a user with the role.
cluster-admin
Procedure
Modify the
object:APIServer$ oc edit apiserverSet the
field tospec.encryption.typeoraesgcm:aescbcspec: encryption: type: aesgcm1 - 1
- Set to
aesgcmfor AES-GCM encryption oraescbcfor AES-CBC encryption.
Save the file to apply the changes.
The encryption process starts. It can take 20 minutes or longer for this process to complete, depending on the size of the etcd database.
Verify that etcd encryption was successful.
Review the
status condition for the OpenShift API server to verify that its resources were successfully encrypted:Encrypted$ oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'The output shows
upon successful encryption:EncryptionCompletedEncryptionCompleted All resources encrypted: routes.route.openshift.ioIf the output shows
, encryption is still in progress. Wait a few minutes and try again.EncryptionInProgressReview the
status condition for the Kubernetes API server to verify that its resources were successfully encrypted:Encrypted$ oc get kubeapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'The output shows
upon successful encryption:EncryptionCompletedEncryptionCompleted All resources encrypted: secrets, configmapsIf the output shows
, encryption is still in progress. Wait a few minutes and try again.EncryptionInProgressReview the
status condition for the OpenShift OAuth API server to verify that its resources were successfully encrypted:Encrypted$ oc get authentication.operator.openshift.io -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'The output shows
upon successful encryption:EncryptionCompletedEncryptionCompleted All resources encrypted: oauthaccesstokens.oauth.openshift.io, oauthauthorizetokens.oauth.openshift.ioIf the output shows
, encryption is still in progress. Wait a few minutes and try again.EncryptionInProgress
15.4. Disabling etcd encryption Link kopierenLink in die Zwischenablage kopiert!
You can disable encryption of etcd data in your cluster.
Prerequisites
-
Access to the cluster as a user with the role.
cluster-admin
Procedure
Modify the
object:APIServer$ oc edit apiserverSet the
field type toencryption:identityspec: encryption: type: identity1 - 1
- The
identitytype is the default value and means that no encryption is performed.
Save the file to apply the changes.
The decryption process starts. It can take 20 minutes or longer for this process to complete, depending on the size of your cluster.
Verify that etcd decryption was successful.
Review the
status condition for the OpenShift API server to verify that its resources were successfully decrypted:Encrypted$ oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'The output shows
upon successful decryption:DecryptionCompletedDecryptionCompleted Encryption mode set to identity and everything is decryptedIf the output shows
, decryption is still in progress. Wait a few minutes and try again.DecryptionInProgressReview the
status condition for the Kubernetes API server to verify that its resources were successfully decrypted:Encrypted$ oc get kubeapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'The output shows
upon successful decryption:DecryptionCompletedDecryptionCompleted Encryption mode set to identity and everything is decryptedIf the output shows
, decryption is still in progress. Wait a few minutes and try again.DecryptionInProgressReview the
status condition for the OpenShift OAuth API server to verify that its resources were successfully decrypted:Encrypted$ oc get authentication.operator.openshift.io -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'The output shows
upon successful decryption:DecryptionCompletedDecryptionCompleted Encryption mode set to identity and everything is decryptedIf the output shows
, decryption is still in progress. Wait a few minutes and try again.DecryptionInProgress