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

use hashicorp lib for az cli auth support #93

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

drewby08
Copy link
Contributor

@drewby08 drewby08 commented Jun 9, 2023

Using https://github.com/hashicorp/go-azure-sdk to implement az cli based authentication.
Added new CredentialConfig CliAuth which adds a az cli authenticated client to our map of clients.
Supports naming the az cli authenticated client just like any other Credential.

credentials:
  -
    name: cli
    cliAuth: true
  -  
    name: spn
    tenantID: my-tenant-id
    clientID: my-client-id
    clientSecret: my-client-secret

workers:
  -
    resources:
      - kind: secret
        name: mysecret
        vaultBaseURL: https://my-key-vault.vault.azure.net/
        credential: cli
    frequency: 5s
    sinks:
      - path: ./password
        template: "{{ .Secrets.mysecret.Value }} using cli"
  -
    resources:
      - kind: secret
        name: mysecret
        vaultBaseURL: https://my-key-vault.vault.azure.net/
        credential: spn
    frequency: 5s
    sinks:
      - path: ./password2
        template: "{{ .Secrets.mysecret.Value }} using spn"

@@ -20,3 +21,23 @@ func NewClient(cred config.CredentialConfig) keyvault.BaseClient {
client.Authorizer = authorizer
return client
}

func NewSpnClient(cred config.CredentialConfig) keyvault.BaseClient {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't gotten this working yet

if credentialConfig.CliAuth {
clients[credentialConfig.Name] = client.NewCliClient()
} else {
clients[credentialConfig.Name] = client.NewClient(credentialConfig)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relying on original implementation for SPN based auth right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant