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

Azure - credentialsConfig #1797

Open
itmwiw opened this issue Feb 14, 2023 · 3 comments
Open

Azure - credentialsConfig #1797

itmwiw opened this issue Feb 14, 2023 · 3 comments
Assignees

Comments

@itmwiw
Copy link

itmwiw commented Feb 14, 2023

Describe the bug:
I'm trying to add an Azure secret engine with some roles using 'credentialsConfig' to authenticate to Azure.
Here's the YAML section:

...
credentialsConfig:
  env: AZURE_AUTH_LOCATION
  path: /etc/azure/credentials
  secretName: azure-creds
externalConfig:
  secrets:
    - configuration:
        roles:
          - azure_roles: >-
               '[{"role_name": "xxx", "scope":  "/subscriptions/yyy/resourceGroups/zzz"}]'
            name: dns-role
            policies: []
            startupSecrets: []
            ttl: 1h
      description: Azure Secret Backend
      path: azure
      type: azure
...

However it seems the vault-configurer does not use the credentials to configure the secret engine and I get "subscription_id is required" in the logs.

Expected behaviour:
The vault configurer uses the credentials to configure the secret engine.

Steps to reproduce the bug:
Try to configure the Azure secret engine using 'credentialsConfig' to manage the authentication part.

Additional context:
Everything works fine if I configure the secret engine myself without using the 'credentialsConfig' :

...
secretEngines:
  - type: azure
    path: azure
    description: Azure Secret Backend
    configuration:
      config: 
        - subscription_id: "${env `AZURE_SUBSCRIPTION_ID`}"
          tenant_id: "${env `$AZURE_TENANT_ID`}"
          client_id: "${env `$AZURE_CLIENT_ID`}"
          client_secret: "${env `$AZURE_CLIENT_SECRET`}"
      roles:
        - name: dns-role
          ttl: 1h
          azure_roles: '[{"role_name": "xxx", "scope":  "/subscriptions/yyy/resourceGroups/zzz"}]'
...

However, I don't want the secrets to being exposed as environment variables.

Environment details:

  • Kubernetes version (e.g. v1.10.2): v1.24.6+5658434
  • Cloud-provider/provisioner (e.g. AKS, GKE, EKS, PKE etc): Openshift on Azure
  • bank-vaults version (e.g. 0.4.17): 1.17.0
  • Install method (e.g. helm or static manifests): Helm

/kind bug

@akijakya
Copy link
Contributor

Hi @itmwiw, thanks for using Bank-Vaults! File-based authentication via credentialsConfig is currently only possible when using Azure's Key Vault to store the Vault unseal keys and root token. For the Azure secrets engine only the second method mentioned by you (with env variables) works as per Vault's own documentation. Although I think it wouldn't be impossible to implement it as a feature within Bank-Vaults if you have time to contribute a solution 🙂

@akijakya akijakya self-assigned this Feb 17, 2023
Copy link

Thank you for your contribution! This issue has been automatically marked as stale because it has no recent activity in the last 60 days. It will be closed in 20 days, if no further activity occurs. If this issue is still relevant, please leave a comment to let us know, and the stale label will be automatically removed.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Nov 29, 2023
@ramizpolic ramizpolic added question and removed lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. labels Dec 22, 2023
@github-actions github-actions bot removed the question label Feb 11, 2024
Copy link

Thank you for your contribution! This issue has been automatically marked as stale because it has no recent activity in the last 60 days. It will be closed in 20 days, if no further activity occurs. If this issue is still relevant, please leave a comment to let us know, and the stale label will be automatically removed.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. label Apr 14, 2024
@csatib02 csatib02 added area/provider/azure and removed lifecycle/stale Denotes an issue or PR that has become stale and will be auto-closed. labels Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants