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

Glob/Wildcard support for roles #58

Merged
merged 1 commit into from
Jun 21, 2019
Merged

Glob/Wildcard support for roles #58

merged 1 commit into from
Jun 21, 2019

Conversation

nathkn
Copy link
Contributor

@nathkn nathkn commented Mar 12, 2019

Solves #47

Allows for roles to specify their namespaces as globbed patterns:

vault write auth/kubernetes/role/my-role \
    bound_service_account_names=my-globbed-sa-* \
    bound_service_account_namespaces=my-globbed-namespace-* \
    policies=default \
    ttl=1h

Two main changes:

  1. Use StrListContainsGlob instead of StrListContains to allow for
    globbed names/namespaces - seemed like the path of least resistance

  2. Update the setupBackend test function to accept the test role's allowed SA
    name/namespace as parameters, allowing testing of globbed namespaces

Not sure if more logic around this is needed since kubernetes names are pretty limited with regard to special characters anyway.

Two main changes:
1) Use `StrListContainsGlob` instead of `StrListContains` to allow for
   globbed names/namespaces - seemed like the path of least resistance
2) Update the `setupBackend` to accept the test role's allowed SA
   name/namespace as parameters, allowing to test globbed namespaces
@nathkn nathkn changed the title Glob/Wildcard support on for roles Glob/Wildcard support for roles Mar 12, 2019
@mterron
Copy link

mterron commented May 30, 2019

Can someone please take a look at this PR? It'll make k8s auth much more usable for certain use cases.

@jefferai
Copy link
Member

Thanks!

@idcmp
Copy link

idcmp commented Oct 1, 2019

Hey just catching up on this to track issue #47.

Ordering of StrListContainsGlob is undefined, so an entry for "foo" and "f*" may get the "f*" match, or may get the "foo" wildcard. This makes it impossible to have hardcoded service accounts wild a wildcard catch-all (which is likely the most desirable usage of wildcards).

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.

4 participants