Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 88c3a12

Browse files
authored
feat(docs): Azure Key Vault guide (#158)
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
1 parent 904bb6d commit 88c3a12

File tree

10 files changed

+118
-8
lines changed

10 files changed

+118
-8
lines changed
43.9 KB
Loading
77.1 KB
Loading
45.2 KB
Loading
26.6 KB
Loading
37.4 KB
Loading
60 KB
Loading
59.7 KB
Loading
35.9 KB
Loading
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Use Azure KeyVault as secrets backend
3+
---
4+
5+
import Image from "@theme/IdealImage";
6+
7+
A requirement to run your own Chainloop instance, is to have a secure credentials backend where sensitive information such as API tokens can be stored.
8+
9+
If you are running your instance in Azure, you might want to leverage the [Azure KeyVault](https://azure.microsoft.com/en-us/products/key-vault) secret backend for that purpose.
10+
During this guide we'll walk you through the process of a) create/retrieve credentials and configure the Key Vault in Azure and b) deploy Chainloop using that new configuration.
11+
12+
## Pre-requisites
13+
14+
To configure your Chainloop instance with Azure KeyVault you'll need the following information from your Azure account:
15+
16+
- Active Directory Tenant ID
17+
- Service Principal ID
18+
- Service Principal Secret
19+
- Vault URI
20+
21+
We'll walk you through the process of how to find this information
22+
23+
## Register an application to create the service principal
24+
25+
First, you'll need to register an application in your Azure Active Directory tenant. You can do this using the Azure CLI or from the Azure portal
26+
27+
![](./azure-1.png)
28+
29+
Once done, in the application overview you should be able to find the tenantID, and Service principal ID
30+
31+
![](./azure-3.png)
32+
33+
Next, let's create a secret for the service principal.
34+
35+
![](./azure-2.png)
36+
37+
## Create a Vault instance and give permissions
38+
39+
Next, we'll create a Key Vault (or you can use an existing one)
40+
41+
![](./azure-4.png)
42+
43+
Take a note on the Vault URI
44+
45+
![](./azure-7.png)
46+
47+
Next, in the Vault IAM section, let's give permissions to the service principal by clicking on Add Role Assignment.
48+
49+
![](./azure-5.png)
50+
51+
on the role assignment role, select "Key Vault Secrets officer"
52+
53+
![](./azure-6.png)
54+
55+
and in the members, search for the application we just registered
56+
57+
![](./azure-8.png)
58+
59+
That's all, we got all the information we need, let's just to the deployment.
60+
61+
## Configure Chainloop deployment
62+
63+
As explained in the [deployment guide](../k8s), you can configure the credentials backend using the `secretsBackend` section of the `values.yaml` file.
64+
65+
Just put the information we gathered from the previous steps like this.
66+
67+
```yaml
68+
secretsBackend:
69+
backend: azureKeyVault
70+
azureKeyVault:
71+
tenantID: [TENANT_ID] # Active Directory Tenant ID
72+
clientID: [CLIENT_ID] # Registered application / service principal client ID
73+
clientSecret: [CLIENT_SECRET] # Service principal client secret
74+
vaultURI: [VAULT URI] # Azure Key Vault URL
75+
```
76+
77+
And deploy your Chainloop Control Plane with the update values to take effect.
78+
79+
Now your Chainloop instance will automatically store any sensitive information in the Azure KeyVault instance you just configured.

docs/guides/deployment/k8s/k8s.mdx

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The Helm Chart in this mode includes
5656
During installation, you'll need to provide
5757

5858
- Open ID Connect Identity Provider (IDp) settings i.e [Auth0 settings](https://auth0.com/docs/get-started/applications/application-settings#basic-information)
59-
- Connection settings for a secrets storage backend, either [Hashicorp Vault](https://www.vaultproject.io/) or [AWS Secret Manager](https://aws.amazon.com/secrets-manager)
59+
- Connection settings for a secrets storage backend, either [Hashicorp Vault](https://www.vaultproject.io/) or [AWS Secrets Manager](https://aws.amazon.com/secrets-manager)
6060
- ECDSA (ES512) key-pair used for Controlplane <-> CAS Authentication
6161

6262
Instructions on how to create the ECDSA keypair can be found [here](#generate-a-ecdsa-key-pair).
@@ -81,7 +81,7 @@ helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
8181
--set casJWTPublicKey="$(cat public.pem)"
8282
```
8383

84-
Deploy using AWS secret manager instead of Vault
84+
Deploy using AWS Secrets Manager instead of Vault
8585

8686
```console
8787
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
@@ -96,7 +96,7 @@ helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
9696
# ...
9797
```
9898

99-
Deploy using GCP secret manager instead of Vault
99+
or using GCP Secret Manager
100100

101101
```console
102102
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
@@ -110,6 +110,22 @@ helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
110110
# ...
111111
```
112112

113+
or Azure KeyVault
114+
115+
```console
116+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
117+
# Open ID Connect (OIDC)
118+
# ...
119+
# Secrets backend
120+
--set secretsBackend.backend=azureKeyVault \
121+
--set secretsBackend.azureKeyVault.tenantID=[AD tenant ID] \
122+
--set secretsBackend.azureKeyVault.clientID=[Service Principal ID] \
123+
--set secretsBackend.azureKeyVault.clientSecret=[Service Principal secret] \
124+
--set secretsBackend.azureKeyVault.vaultURI=[Azure KeyVault URI]
125+
# Server Auth KeyPair
126+
# ...
127+
```
128+
113129
Connect to an external PostgreSQL database instead
114130

115131
```console
@@ -148,7 +164,7 @@ The Helm Chart in this mode includes
148164
During installation, you'll need to provide
149165

150166
- Open ID Connect Identity Provider (IDp) settings i.e [Auth0 settings](https://auth0.com/docs/get-started/applications/application-settings#basic-information)
151-
- ~~Connection settings for a secrets storage backend, either [Hashicorp Vault](https://www.vaultproject.io/) or [AWS Secret Manager](https://aws.amazon.com/secrets-manager)~~
167+
- ~~Connection settings for a secrets storage backend, either [Hashicorp Vault](https://www.vaultproject.io/) or [AWS Secrets Manager](https://aws.amazon.com/secrets-manager)~~
152168
- ~~ECDSA (ES512) key-pair used for Controlplane <-> CAS Authentication~~
153169

154170
#### Installation Examples
@@ -315,9 +331,9 @@ controlplane:
315331
database: chainloop-controlplane-prod
316332
```
317333

318-
### Use AWS secret manager
334+
### Use AWS secrets manager
319335

320-
You can swap the secret manager backend with the following settings
336+
Instead of using [Hashicorp Vault](https://www.vaultproject.io/) (default), you can use [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) by adding these settings in your `values.yaml` file
321337

322338
```yaml
323339
secretsBackend:
@@ -330,7 +346,7 @@ secretsBackend:
330346

331347
### Use GCP secret manager
332348

333-
You can swap the secret manager backend with the following settings
349+
Or [Google Cloud Secret Manager](https://cloud.google.com/secret-manager) with the following settings
334350

335351
```yaml
336352
secretsBackend:
@@ -340,6 +356,21 @@ secretsBackend:
340356
serviceAccountKey: [KEY]
341357
```
342358

359+
### Use Azure KeyVault
360+
361+
[Azure KeyVault](https://azure.microsoft.com/en-us/products/key-vault/) is also supported
362+
363+
```yaml
364+
secretsBackend:
365+
backend: azureKeyVault
366+
azureKeyVault:
367+
tenantID: [TENANT_ID] # Active Directory Tenant ID
368+
clientID: [CLIENT_ID] # Registered application / service principal client ID
369+
clientSecret: [CLIENT_SECRET] # Service principal client secret
370+
vaultURI: [VAULT URI] # Azure Key Vault URL
371+
372+
```
373+
343374
### Send exceptions to Sentry
344375

345376
You can configure different sentry projects for both the controlplane and the artifact CAS
@@ -397,7 +428,7 @@ chainloop config save \
397428
| `secretsBackend.vault.token` | Vault authentication token | |
398429
| `secretsBackend.awsSecretManager.accessKey` | AWS Access KEY ID | |
399430
| `secretsBackend.awsSecretManager.secretKey` | AWS Secret Key | |
400-
| `secretsBackend.awsSecretManager.region` | AWS Secret Manager Region | |
431+
| `secretsBackend.awsSecretManager.region` | AWS Secrets Manager Region | |
401432
| `secretsBackend.gcpSecretManager.projectId` | GCP Project ID | |
402433
| `secretsBackend.gcpSecretManager.serviceAccountKey` | GCP Auth Key | |
403434
| `secretsBackend.azureKeyVault.tenantID` | Active Directory Tenant ID | |

0 commit comments

Comments
 (0)