You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-auth/3299-kms-v2-improvements/README.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@
8
8
-[Non-Goals](#non-goals)
9
9
-[Proposal](#proposal)
10
10
-[Design Details](#design-details)
11
+
-[v2 API](#v2-api)
12
+
-[Key Hierarchy](#key-hierarchy)
13
+
-[Metadata](#metadata)
14
+
-[Status API](#status-api)
15
+
-[Observability](#observability)
11
16
-[Sequence Diagram](#sequence-diagram)
12
17
-[Encrypt Request](#encrypt-request)
13
18
-[Decrypt Request](#decrypt-request)
@@ -124,6 +129,8 @@ required) or even code snippets. If there's any ambiguity about HOW your
124
129
proposal will be implemented, this is the place to discuss them.
125
130
-->
126
131
132
+
### v2 API
133
+
127
134
`EncryptionConfiguration` will be expanded to support the new v2 API:
128
135
129
136
```diff
@@ -138,6 +145,8 @@ index d7d68d2584d..84c1fa6546f 100644
138
145
139
146
Support key hierarchy in KMS plugin that generates local KEK and add v2alpha1 `KeyManagementService` proto service contract in Kubernetes to include `key_id`, `annotations`, and `status`.
140
147
148
+
### Key Hierarchy
149
+
141
150
Key Hierarchy in KMS plugin (reference implementation):
142
151
143
152
1. No changes to the API server, keep 1:1 DEK mapping
Since key hierarchy is implemented at the KMS plugin level, it should be seamless for the kube-apiserver. So whether the plugin is using a key hierarchy or not, the kube-apiserver should behave the same.
152
161
162
+
### Metadata
163
+
153
164
What is required of the kube-apiserver is to be able to tell the KMS plugin which KEK (local KEK or KMS KEK) it should use to decrypt the incoming DEK. To do so, upon encryption, the KMS plugin could provide the encrypted local KEK as part of the `annotations` field in the `EncryptResponse`. The kube-apiserver would then store it in etcd next to the DEK. Upon decryption, the kube-apiserver provides the encrypted local KEK in `annotations` and `key_id` from the last encryption when calling Decrypt. In case no encrypted local KEK is provided in the `annotations`, then we can assume key hierarchy is not used. The KMS plugin would query the external KMS to use the remote KEK to decrypt the DEK (same behavior as today). No state coordination is required between different instances of the KMS plugin.
154
165
155
166
For the reference KMS plugin, the encrypted local KEK is stored in etcd via the `annotations` field, and once decrypted, it can be stored in memory as part of the KMS plugin cache to be used for encryption and decryption of DEKs. The encrypted local KEK is used as the key and the decrypted local KEK is stored as the value.
@@ -168,7 +179,7 @@ message EncryptResponse {
168
179
}
169
180
```
170
181
171
-
The `DecryptRequest` passes the same `key_id` and `annotations` returned by the previous `EncryptResponse` of this data as its `key_id` and `metadata` for the decryption request.
182
+
The `DecryptRequest` passes the same `key_id` and `annotations` returned by the previous `EncryptResponse` of this data as its `key_id` and `annotations` for the decryption request.
172
183
173
184
```proto
174
185
message DecryptRequest {
@@ -214,6 +225,8 @@ type EncryptedObject struct {
214
225
215
226
This object simply provides a structured format to store the `EncryptResponse` data with the plugin name and encrypted object data. New fields can easily be added to this format.
216
227
228
+
### Status API
229
+
217
230
To improve health check reliability, the new StatusResponse provides version, healthz information, and can trigger key rotation via storage version status updates.
218
231
219
232
```proto
@@ -258,6 +271,8 @@ index bfa249e135c..e671fe599a9 100644
258
271
259
272
> NOTE: Since the storage version API is still alpha, this KEP will simply aim to make it possible to have automated rotation when that API is enabled and has been updated to include the new fields. The rotation feature will first be scoped to a single API server and will not be part of the graduation criteria for this KEP.
260
273
274
+
### Observability
275
+
261
276
To improve observability, this design also generates a new `UID` for each envelope operation similar to `UID` generation in admission review requests here: https://github.com/kubernetes/kubernetes/blob/e9e669aa6037c380469b45200e59cff9b52d6d68/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/request/admissionreview.go#L137.
262
277
263
278
This `UID` field is included in the `EncryptRequest` and `DecryptRequest` of the v2 API. It will always be present. It is generated in the kube-apiserver and will be used:
0 commit comments