Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add Hashicorp Vault external secret manager #7658

Merged
merged 41 commits into from
Feb 29, 2024
Merged

fix: add Hashicorp Vault external secret manager #7658

merged 41 commits into from
Feb 29, 2024

Conversation

misba7
Copy link
Contributor

@misba7 misba7 commented Feb 6, 2024

closes #7548

@misba7 misba7 requested a review from moabu February 6, 2024 11:27
@misba7 misba7 self-assigned this Feb 6, 2024
@misba7 misba7 requested a review from iromli as a code owner February 6, 2024 11:27
@mo-auto mo-auto added area-documentation Documentation needs to change as part of issue or PR comp-charts-jans kind-bug Issue or PR is a bug in existing functionality labels Feb 6, 2024
{{ if eq .Values.global.configSecretAdapter "vault" }}
CN_SECRET_VAULT_SCHEME: {{ .Values.configmap.cnSecretVaultScheme }}
CN_SECRET_VAULT_HOST: {{ .Values.configmap.cnSecretVaultHost }}
CN_SECRET_VAULT_PORT: {{ .Values.configmap.cnSecretVaultPort }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These env vars should be quoted to avoid mismatched type.

@iromli iromli self-assigned this Feb 19, 2024
iromli and others added 6 commits February 20, 2024 00:24
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: iromli <isman.firmansyah@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
@@ -258,6 +258,30 @@ config:
cnAwsSecretsReplicaRegions: []
# [aws_secret_manager_envs] END
# [aws_envs] END
# [vault_envs] Envs related to Hashicorp vault
# base URL of Vault (default to `http://localhost:8200`).
cnSecretVaultAddr: http://localhost:8200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@misba7 as this is part of config.configmap, the cnSecretVault* keys need to be defined in sub-chart config as well.

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
configSecretAdapter: vault
config:
configmap:
# base URL of Vault (default to `http://localhost:8200`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@misba7 make a proper comment syntax so helm-docs command can generate/modify README.md automatically.

@@ -121,6 +122,52 @@ kubectl get configmap -n <namespace> cn -o json

From the console, Go to `Secret Manager`> Click on `Create Secret` > Add a `name` > Upload a `json` file or add the json to the `Secret value` field > Create

### Vault

You need a secret named `vault` in your namespace storing the `role-id` and `secret-id` so that workloads/services can use it to authenticate to Vault.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@misba7 Probably better to provide attribute in values.yaml to store role-id and secret-id in a secrets so it will be tied to release name.

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
@iromli iromli marked this pull request as ready for review February 26, 2024 21:01
iromli and others added 4 commits February 27, 2024 15:50
Signed-off-by: iromli <isman.firmansyah@gmail.com>
Signed-off-by: iromli <isman.firmansyah@gmail.com>
Signed-off-by: iromli <isman.firmansyah@gmail.com>
iromli
iromli previously approved these changes Feb 27, 2024
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
iromli
iromli previously approved these changes Feb 27, 2024
@@ -121,6 +122,71 @@ kubectl get configmap -n <namespace> cn -o json

From the console, Go to `Secret Manager`> Click on `Create Secret` > Add a `name` > Upload a `json` file or add the json to the `Secret value` field > Create

### Vault
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicate the mode used for Vault installation. This is to clearly state what type of Vault installation was used because the cloud is slightly different

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
### Vault

!!! Note
The deployment of Vault is hosted on-premises, not within the Vault Cloud service
Copy link
Contributor

@iromli iromli Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cloud name should be HashiCorp Cloud Platform.

misba7 and others added 2 commits February 28, 2024 20:28
Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: iromli <isman.firmansyah@gmail.com>
@moabu moabu merged commit 595e705 into main Feb 29, 2024
2 checks passed
@moabu moabu deleted the fix-jans-vault branch February 29, 2024 15:10
yuriyz pushed a commit that referenced this pull request Nov 7, 2024
* docs: add network traffic notes

* docs: add network traffic notes

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* docs: add external communication

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: add Hashicorp Vault external secret manager

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: add quote to configmap

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* chore(docker-jans): update Vault binding in images

Signed-off-by: iromli <isman.firmansyah@gmail.com>

* fix: update vault envs

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: add new env vault addr

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* feat: mount role and secret id files

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: add cnVault variables to config subchart

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* docs: add new vars and instruction for required secret

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* feat: deploy vault secret automatically

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* docs: comprehensive vault deployment instructions

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: change var name and base64 encode in secret

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: jans-aio vault support

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix: vault as an option for secret in jans-aio

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* fix(chart): resolve attribute for Vault (global is not exist)

Signed-off-by: iromli <isman.firmansyah@gmail.com>

* docs(charts): update Vault docs

Signed-off-by: iromli <isman.firmansyah@gmail.com>

* docs: mention about approle path option

Signed-off-by: iromli <isman.firmansyah@gmail.com>

* docs: update config subchart with new values.yaml

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* docs: update instructions

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* chore(charts): remove unused attributes for Vault integration

Signed-off-by: iromli <isman.firmansyah@gmail.com>

* docs: mention the vault deployment mode

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* docs: remove unneeded vault vars

Signed-off-by: Amro Misbah <amromisba7@gmail.com>

* docs: proper name of HashiCorp cloud service

Signed-off-by: iromli <isman.firmansyah@gmail.com>

---------

Signed-off-by: Amro Misbah <amromisba7@gmail.com>
Signed-off-by: iromli <isman.firmansyah@gmail.com>
Co-authored-by: Isman Firmansyah <iromli@users.noreply.github.com>
Co-authored-by: iromli <isman.firmansyah@gmail.com>
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
Former-commit-id: 595e705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-documentation Documentation needs to change as part of issue or PR comp-charts-jans kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: add Hashicorps Vault external secret manager
4 participants