@@ -29,8 +29,8 @@ to implement specific providers for each (in K8S).
29
29
* Reduced risk of encryption key compromise.
30
30
* encryption key is stored and managed in Vault.
31
31
* encryption key does not need to leave the Vault.
32
- * Vault provides ability to define access control suitable for a wide range of deployment scenarios and security needs.
33
- * Vault provides In-built auditing of vault API calls.
32
+ * Vault provides ability to define access control suitable for a wide range of deployment scenarios and security needs.
33
+ * Vault provides In-built auditing of vault API calls.
34
34
* Ability for a customer already using Vault to leverage the instance to also
35
35
secure keys used to encrypt secrets managed within a Kubernetes cluster
36
36
* Separation of Kubernetes cluster management responsibilities from encryption key
@@ -55,7 +55,7 @@ reading from the storage.
55
55
56
56
The KEK will be stored and managed in Vault backend. The Vault based provider
57
57
configured in KMS Transformer configuration will make REST requests to encrypt
58
- and decrypt DEKs over a secure channel, if TLS is enabled . KMS Transformer will
58
+ and decrypt DEKs over a secure channel (must enable TLS) . KMS Transformer will
59
59
store the DEKs in etcd in encrypted form along with encrypted secrets. As with
60
60
existing providers, encrypted DEKs will be stored with metadata used to identify
61
61
the provider and KEK to be used for decryption.
@@ -79,8 +79,10 @@ Backend.
79
79
### Pseudocode
80
80
#### Prefix Metadata
81
81
Every encrypted secret will have the following metadata prefixed.
82
- ``k8s:enc:kms:<api-version >:vault: len (<KEK-key-name >:<KEK-key-version >:<DEK
83
- encrypted with KEK>):<KEK-key-name >:<KEK-key-version >:<DEK encrypted with KEK >``
82
+ ``` json
83
+ k8s:enc:kms:<api-version>:vault:len(<KEK-key-name>:<KEK-key-version>:<DEK
84
+ encrypted with KEK>):<KEK-key-name>:<KEK-key-version>:<DEK encrypted with KEK>
85
+ ```
84
86
85
87
* `` <api-version> `` represents api version in the providers configuration file.
86
88
* `` vault `` represents the KMS service * kind* value. It is a fixed value for Vault
@@ -168,9 +170,9 @@ Here is a sample configuration file with the vault provider configured:
168
170
- secrets
169
171
providers:
170
172
- kms:
171
- name: vault
172
- cachesize: 10
173
- configfile: /home/myvault/vault-config.yaml
173
+ name: vault
174
+ cachesize: 10
175
+ configfile: /home/myvault/vault-config.yaml
174
176
175
177
#### Minimal required Configuration
176
178
The Vault based Provider needs the following configuration elements, at a
@@ -190,7 +192,7 @@ the prefix to the encrypted DEK stored in etcd
190
192
#### Authentication Configuration
191
193
##### Vault Server Authentication
192
194
193
- For the Kubernetes cluster to authenticate the vault server, if TLS is enabled :
195
+ For the Kubernetes cluster to authenticate the vault server, TLS must be enabled :
194
196
1 . `` ca-cert `` location of x509 certificate to authenticate the vault server eg:
195
197
`` /var/run/kubernetes/ssl/vault.crt ``
196
198
@@ -206,72 +208,43 @@ server to vault server eg. ``/var/run/kubernetes/ssl/valut-client-cert.pem``
206
208
2 . `` client-key `` : location of x509 private key to authenticate kubernetes API
207
209
server to vault server eg. `` /var/run/kubernetes/ssl/vault-client-key.pem ``
208
210
209
- Here's a sample configuration file with `` client-cert `` :
210
-
211
- kind: EncryptionConfig
212
- apiVersion: v1
213
- resources:
214
- - resources:
215
- - secrets
216
- providers:
217
- - kms:
218
- kind: vault
219
- apiVersion: v1
220
- cache-size: 100
221
- config:
222
- addr: https://localhost:8200
223
- key-names:
224
- - kube-secret-enc-key
225
- ca-cert:/var/run/kubernetes/ssl/vault.crt
226
- client-cert:/var/run/kubernetes/ssl/vault-client-cert.pem
227
- client-key:/var/run/kubernetes/ssl/vault-client-key.pem
211
+ Here's a sample `` vault-config.yaml `` configuration with `` client-cert `` :
212
+ ```
213
+ key-names:
214
+ - kube-secret-enc-key
215
+ addr: https://example.com:8200
216
+ ca-cert:/var/run/kubernetes/ssl/vault.crt
217
+ client-cert:/var/run/kubernetes/ssl/vault-client-cert.pem
218
+ client-key:/var/run/kubernetes/ssl/vault-client-key.pem
219
+ ```
228
220
229
221
###### Vault token based authentication
230
222
1 . `` token `` : limited access vault token required by kubernetes API sever to
231
223
authenticate itself while making requests to vault eg:
232
224
8dad1053-4a4e-f359-2eab-d57968eb277f
233
225
234
- Here's a sample configuration file when using a Vault Token for authenticating
226
+ Here's a sample `` vault-config.yaml `` configuration using a Vault Token for authentication.
235
227
the Kubernetes cluster as a client to Vault:
236
-
237
- kind: EncryptionConfig
238
- apiVersion: v1
239
- resources:
240
- - resources:
241
- - secrets
242
- providers:
243
- - kms:
244
- kind: vault
245
- apiVersion: v1
246
- cache-size: 100
247
- config:
248
- addr: https://localhost:8200
249
- key-names:
250
- - kube-secret-enc-key
251
- ca-cert:/var/run/kubernetes/ssl/vault.crt
252
- token: 8dad1053-4a4e-f359-2eab-d57968eb277f
228
+ ```
229
+ key-names:
230
+ -kube-secret-enc-key
231
+ addr: https://example.com:8200
232
+ ca-cert:/var/run/kubernetes/ssl/vault.crt
233
+ token: 8dad1053-4a4e-f359-2eab-d57968eb277f
234
+ ```
253
235
254
236
###### Vault AppRole based authentication
255
237
1 . `` role-id `` : RoleID of the AppRole
256
238
2 . `` secret-id `` : secret Id only if associated with the appRole.
257
239
258
- Here's a sample configuration file with Vault AppRole
259
- kind: EncryptionConfig
260
- apiVersion: v1
261
- resources:
262
- - resources:
263
- - secrets
264
- providers:
265
- - kms:
266
- kind: vault
267
- apiVersion: v1
268
- cache-size: 100
269
- config:
270
- addr: https://localhost:8200
271
- key-names:
272
- - kube-secret-enc-key
273
- ca-cert: /var/run/kubernetes/ssl/vault.crt
274
- role-id: db02de05-fa39-4855-059b-67221c5c2f63
240
+ Here's a sample configuration file using a Vault AppRole for authentication.
241
+ ```
242
+ key-names:
243
+ - kube-secret-enc-key
244
+ addr: https://localhost:8200
245
+ ca-cert: /var/run/kubernetes/ssl/vault.crt
246
+ role-id: db02de05-fa39-4855-059b-67221c5c2f63
247
+ ```
275
248
276
249
## Key Generation and rotation
277
250
The KEK is generated in Vault and rotated using direct API call or CLI to Vault
0 commit comments