Skip to content

Commit 3613a65

Browse files
authored
Merge pull request #42882 from sftim/20220428_revise_encryption_at_rest_table_rework
Update encryption-at-rest task page
2 parents 060c896 + 3aade83 commit 3613a65

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

content/en/docs/tasks/administer-cluster/encrypt-data.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,17 @@ resources:
122122
123123
Each `resources` array item is a separate config and contains a complete configuration. The
124124
`resources.resources` field is an array of Kubernetes resource names (`resource` or `resource.group`)
125-
that should be encrypted like Secrets, ConfigMaps, or other resources.
125+
that should be encrypted like Secrets, ConfigMaps, or other resources.
126126

127-
If custom resources are added to `EncryptionConfiguration` and the cluster version is 1.26 or newer,
128-
any newly created custom resources mentioned in the `EncryptionConfiguration` will be encrypted.
127+
If custom resources are added to `EncryptionConfiguration` and the cluster version is 1.26 or newer,
128+
any newly created custom resources mentioned in the `EncryptionConfiguration` will be encrypted.
129129
Any custom resources that existed in etcd prior to that version and configuration will be unencrypted
130130
until they are next written to storage. This is the same behavior as built-in resources.
131131
See the [Ensure all secrets are encrypted](#ensure-all-secrets-are-encrypted) section.
132132

133133
The `providers` array is an ordered list of the possible encryption providers to use for the APIs that you listed.
134+
Each provider supports multiple keys - the keys are tried in order for decryption, and if the provider
135+
is the first provider, the first key is used for encryption.
134136

135137
Only one provider type may be specified per entry (`identity` or `aescbc` may be provided,
136138
but not both in the same item).
@@ -142,7 +144,7 @@ is returned which prevents clients from accessing that resource.
142144
`EncryptionConfiguration` supports the use of wildcards to specify the resources that should be encrypted.
143145
Use '`*.<group>`' to encrypt all resources within a group (for eg '`*.apps`' in above example) or '`*.*`'
144146
to encrypt all resources. '`*.`' can be used to encrypt all resource in the core group. '`*.*`' will
145-
encrypt all resources, even custom resources that are added after API server start.
147+
encrypt all resources, even custom resources that are added after API server start.
146148

147149
{{< note >}} Use of wildcards that overlap within the same resource list or across multiple entries are not allowed
148150
since part of the configuration would be ineffective. The `resources` list's processing order and precedence
@@ -171,9 +173,12 @@ the only recourse is to delete that key from the underlying etcd directly. Calls
171173
read that resource will fail until it is deleted or a valid decryption key is provided.
172174
{{< /caution >}}
173175

174-
### Providers
176+
### Available providers {#providers}
175177

176-
The following table describes each available provider:
178+
Before you configure encryption-at-rest for data in your cluster's Kubernetes API, you
179+
need to select which provider(s) you will use.
180+
181+
The following table describes each available provider.
177182

178183
<!-- localization note: if it makes sense to adapt this table to work for your localization,
179184
please do that. Each sentence in the English original should have a direct equivalent in the adapted
@@ -279,31 +284,43 @@ The following table describes each available provider:
279284
</tbody>
280285
</table>
281286

282-
Each provider supports multiple keys - the keys are tried in order for decryption, and if the provider
283-
is the first provider, the first key is used for encryption.
287+
The `identity` provider is the default if you do not specify otherwise. **The `identity` provider does not
288+
encrypt stored data and provides _no_ additional confidentiality protection.**
284289

290+
### Key storage
285291

286-
{{< caution >}}
287-
Storing the raw encryption key in the EncryptionConfig only moderately improves your security
288-
posture, compared to no encryption. Please use `kms` provider for additional security.
289-
{{< /caution >}}
290-
291-
By default, the `identity` provider is used to protect secret data in etcd, which provides no
292-
encryption. `EncryptionConfiguration` was introduced to encrypt secret data locally, with a locally
293-
managed key.
292+
#### Local key storage
294293

295294
Encrypting secret data with a locally managed key protects against an etcd compromise, but it fails to
296295
protect against a host compromise. Since the encryption keys are stored on the host in the
297296
EncryptionConfiguration YAML file, a skilled attacker can access that file and extract the encryption
298297
keys.
299298

300-
Envelope encryption creates dependence on a separate key, not stored in Kubernetes. In this case,
301-
an attacker would need to compromise etcd, the `kubeapi-server`, and the third-party KMS provider to
302-
retrieve the plaintext values, providing a higher level of security than locally stored encryption keys.
299+
#### Managed (KMS) key storage {#kms-key-storage}
300+
301+
The KMS provider uses _envelope encryption_: Kubernetes encrypts resources using a data key, and then
302+
encrypts that data key using the managed encryption service. Kubernetes generates a unique data key for
303+
each resource. The API server stores an encrypted version of the data key in etcd alongside the ciphertext;
304+
when reading the resource, the API server calls the managed encryption service and provides both the
305+
ciphertext and the (encrypted) data key.
306+
Within the managed encryption service, the provider use a _key encryption key_ to decipher the data key,
307+
deciphers the data key, and finally recovers the plain text. Communication between the control plane
308+
and the KMS requires in-transit protection, such as TLS.
309+
310+
Using envelope encryption creates dependence on the key encryption key, which is not stored in Kubernetes.
311+
In the KMS case, an attacker who intends to get unauthorised access to the plaintext
312+
values would need to compromise etcd **and** the third-party KMS provider.
303313

304-
## Encrypting your data
314+
## Write an encryption configuration file
315+
316+
{{< caution >}}
317+
The encryption configuration file may contain keys that can decrypt content in etcd.
318+
If the configuration file contains any key material, you must properly
319+
restrict permissions on all your control plane hosts so only the user
320+
who runs the kube-apiserver can read this configuration.
321+
{{< /caution >}}
305322

306-
Create a new encryption config file:
323+
Create a new encryption configuration file. The contents should be similar to:
307324

308325
```yaml
309326
---

0 commit comments

Comments
 (0)