Skip to content

Commit 2ea5c24

Browse files
committed
Update cipher to ciphertext, plain to plaintext
Signed-off-by: Rita Zhang <[email protected]>
1 parent fbbe62a commit 2ea5c24

File tree

1 file changed

+11
-11
lines changed
  • keps/sig-auth/3299-kms-v2-improvements

1 file changed

+11
-11
lines changed

keps/sig-auth/3299-kms-v2-improvements/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ For the reference KMS plugin, the encrypted local KEK is stored in etcd via the
170170
```proto
171171
message EncryptResponse {
172172
// The encrypted data.
173-
bytes cipher = 1;
173+
bytes ciphertext = 1;
174174
// The KMS key ID used for encryption operations.
175175
// This can be used to drive rotation.
176176
string currentKeyID = 2;
@@ -186,7 +186,7 @@ The `DecryptRequest` passes the same `currentKeyID` and `metadata` returned by t
186186
```proto
187187
message DecryptRequest {
188188
// The data to be decrypted.
189-
bytes cipher = 2;
189+
bytes ciphertext = 2;
190190
// UID is a unique identifier for the request.
191191
string uid = 3;
192192
// The keyID that was provided to the apiserver during encryption.
@@ -198,7 +198,7 @@ message DecryptRequest {
198198
199199
message DecryptResponse {
200200
// The decrypted data.
201-
bytes plain = 1;
201+
bytes plaintext = 1;
202202
// The KMS key ID used to decrypt the data.
203203
string currentKeyID = 2;
204204
// Additional metadata that was sent by the KMS plugin.
@@ -207,7 +207,7 @@ message DecryptResponse {
207207
208208
message EncryptRequest {
209209
// The data to be encrypted.
210-
bytes plain = 2;
210+
bytes plaintext = 2;
211211
// UID is a unique identifier for the request.
212212
string uid = 3;
213213
}
@@ -306,12 +306,12 @@ sequenceDiagram
306306
kmsplugin->>externalkms: encrypt local KEK with remote KEK
307307
externalkms->>kmsplugin: encrypted local KEK
308308
kmsplugin->>kmsplugin: cache encrypted local KEK
309-
kmsplugin->>kubeapiserver: return encrypt response <br/> {"cipher": "<encrypted DEK>", currentKeyID: "<remote KEK ID>", <br/> "metadata": {"kms.kubernetes.io/local-kek": "<encrypted local KEK>"}}
309+
kmsplugin->>kubeapiserver: return encrypt response <br/> {"ciphertext": "<encrypted DEK>", currentKeyID: "<remote KEK ID>", <br/> "metadata": {"kms.kubernetes.io/local-kek": "<encrypted local KEK>"}}
310310
else not using key hierarchy
311311
%% current behavior
312312
kmsplugin->>externalkms: encrypt DEK with remote KEK
313313
externalkms->>kmsplugin: encrypted DEK
314-
kmsplugin->>kubeapiserver: return encrypt response <br/> {"cipher": "<encrypted DEK>", currentKeyID: "<remote KEK ID>", "metadata": {}}
314+
kmsplugin->>kubeapiserver: return encrypt response <br/> {"ciphertext": "<encrypted DEK>", currentKeyID: "<remote KEK ID>", "metadata": {}}
315315
end
316316
kubeapiserver->>etcd: store encrypt response and encrypted DEK
317317
```
@@ -325,7 +325,7 @@ sequenceDiagram
325325
participant externalkms
326326
%% if local KEK in metadata, then using hierarchy
327327
alt encrypted local KEK is in metadata
328-
kubeapiserver->>kmsplugin: decrypt request <br/> {"cipher": "<encrypted DEK>", observedKeyID: "<currentKeyID gotten as part of EncryptResponse>", <br/> "metadata": {"kms.kubernetes.io/local-kek": "<encrypted local KEK>"}}
328+
kubeapiserver->>kmsplugin: decrypt request <br/> {"ciphertext": "<encrypted DEK>", observedKeyID: "<currentKeyID gotten as part of EncryptResponse>", <br/> "metadata": {"kms.kubernetes.io/local-kek": "<encrypted local KEK>"}}
329329
alt encrypted local KEK in cache
330330
kmsplugin->>kmsplugin: decrypt DEK with local KEK
331331
else encrypted local KEK not in cache
@@ -334,12 +334,12 @@ sequenceDiagram
334334
kmsplugin->>kmsplugin: decrypt DEK with local KEK
335335
kmsplugin->>kmsplugin: cache decrypted local KEK
336336
end
337-
kmsplugin->>kubeapiserver: return decrypt response <br/> {"plain": "<decrypted DEK>", currentKeyID: "<remote KEK ID>", <br/> "metadata": {"kms.kubernetes.io/local-kek": "<encrypted local KEK>"}}
337+
kmsplugin->>kubeapiserver: return decrypt response <br/> {"plaintext": "<decrypted DEK>", currentKeyID: "<remote KEK ID>", <br/> "metadata": {"kms.kubernetes.io/local-kek": "<encrypted local KEK>"}}
338338
else encrypted local KEK is not in metadata
339-
kubeapiserver->>kmsplugin: decrypt request <br/> {"cipher": "<encrypted DEK>", observedKeyID: "<currentKeyID gotten as part of EncryptResponse>", <br/> "metadata": {}}
339+
kubeapiserver->>kmsplugin: decrypt request <br/> {"ciphertext": "<encrypted DEK>", observedKeyID: "<currentKeyID gotten as part of EncryptResponse>", <br/> "metadata": {}}
340340
kmsplugin->>externalkms: decrypt DEK with remote KEK (same behavior as today)
341341
externalkms->>kmsplugin: decrypted DEK
342-
kmsplugin->>kubeapiserver: return decrypt response <br/> {"plain": "<decrypted DEK>", currentKeyID: "<remote KEK ID>", <br/> "metadata": {}}
342+
kmsplugin->>kubeapiserver: return decrypt response <br/> {"plaintext": "<decrypted DEK>", currentKeyID: "<remote KEK ID>", <br/> "metadata": {}}
343343
end
344344
```
345345

@@ -503,7 +503,7 @@ information to express the idea and why it was not acceptable.
503503
**Performance and rotation:**
504504

505505
We considered the follow approaches and each has its own drawbacks:
506-
1. `cacheSize` field in `EncryptionConfiguration`. It is used by the API server to initialize a LRU cache of the given size with the encrypted cipher used as index. Having a higher value for the `cacheSize` will prevent calls to the plugin for decryption operations. However, this does not solve the issue with the number of calls to KMS plugin when encryption traffic is bursty.
506+
1. `cacheSize` field in `EncryptionConfiguration`. It is used by the API server to initialize a LRU cache of the given size with the encrypted ciphertext used as index. Having a higher value for the `cacheSize` will prevent calls to the plugin for decryption operations. However, this does not solve the issue with the number of calls to KMS plugin when encryption traffic is bursty.
507507
2. Reduce the number of trips to KMS by caching DEKs by allowing one DEK to be used to encrypt multiple objects within the configured TTL period. One issue with this approach is it will be very hard to inform the API server to rotate the DEKs when a KEK has been rotated.
508508

509509
**Observability**:

0 commit comments

Comments
 (0)