Skip to content

Commit 8b83c7f

Browse files
committed
resolved conflicts
1 parent 42033e4 commit 8b83c7f

File tree

1 file changed

+36
-63
lines changed

1 file changed

+36
-63
lines changed

vault-based-kms-provider.md

Lines changed: 36 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ to implement specific providers for each (in K8S).
2929
* Reduced risk of encryption key compromise.
3030
* encryption key is stored and managed in Vault.
3131
* 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.
3434
* Ability for a customer already using Vault to leverage the instance to also
3535
secure keys used to encrypt secrets managed within a Kubernetes cluster
3636
* Separation of Kubernetes cluster management responsibilities from encryption key
@@ -55,7 +55,7 @@ reading from the storage.
5555

5656
The KEK will be stored and managed in Vault backend. The Vault based provider
5757
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
5959
store the DEKs in etcd in encrypted form along with encrypted secrets. As with
6060
existing providers, encrypted DEKs will be stored with metadata used to identify
6161
the provider and KEK to be used for decryption.
@@ -79,8 +79,10 @@ Backend.
7979
### Pseudocode
8080
#### Prefix Metadata
8181
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+
```
8486

8587
* ``<api-version>`` represents api version in the providers configuration file.
8688
* ``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:
168170
- secrets
169171
providers:
170172
- 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
174176

175177
#### Minimal required Configuration
176178
The Vault based Provider needs the following configuration elements, at a
@@ -190,7 +192,7 @@ the prefix to the encrypted DEK stored in etcd
190192
#### Authentication Configuration
191193
##### Vault Server Authentication
192194

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 :
194196
1. ``ca-cert`` location of x509 certificate to authenticate the vault server eg:
195197
``/var/run/kubernetes/ssl/vault.crt``
196198

@@ -206,72 +208,43 @@ server to vault server eg. ``/var/run/kubernetes/ssl/valut-client-cert.pem``
206208
2. ``client-key`` : location of x509 private key to authenticate kubernetes API
207209
server to vault server eg. ``/var/run/kubernetes/ssl/vault-client-key.pem``
208210

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+
```
228220

229221
###### Vault token based authentication
230222
1. ``token`` : limited access vault token required by kubernetes API sever to
231223
authenticate itself while making requests to vault eg:
232224
8dad1053-4a4e-f359-2eab-d57968eb277f
233225

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.
235227
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+
```
253235

254236
###### Vault AppRole based authentication
255237
1. ``role-id`` : RoleID of the AppRole
256238
2. ``secret-id`` : secret Id only if associated with the appRole.
257239

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+
```
275248

276249
## Key Generation and rotation
277250
The KEK is generated in Vault and rotated using direct API call or CLI to Vault

0 commit comments

Comments
 (0)