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

Return service account name from AliasLookaheadOperation #75

Open
masterada opened this issue Nov 21, 2019 · 1 comment
Open

Return service account name from AliasLookaheadOperation #75

masterada opened this issue Nov 21, 2019 · 1 comment

Comments

@masterada
Copy link

Currently AliasLookaheadOperation returns the service account's uid. It means if I would like to create an Entity for my service, with an alias for kubernetes auth, I need to know the kubernetes ServiceAccount uid. This is troublesome, as the ServiceAccount may not exists when configuring vault, or it can be recreated at any time during a deployment.

Please create a config so we can use either the service account name (kubernetes.io/serviceaccount/service-account.name) or the kubernetes auth role name, or maybe even serviceaccount namespace+name combination.

@ambis
Copy link

ambis commented Sep 23, 2022

We have now the option to specify that the service account name (+namespace) to be used:

https://www.vaultproject.io/api-docs/auth/kubernetes#alias_name_source

So with terraform this would mean:

resource "vault_kubernetes_auth_backend_role" "role" {
  // ...
  alias_name_source                = "serviceaccount_name"
}

// ... 

resource "vault_identity_entity_alias" "alias" {
  // ... 
  name           = "${namespace}/${service_account}"
}

I believe this issue can be closed.

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

3 participants