Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Enable wildcard with prefix. #64

Merged

Conversation

angrylogic
Copy link
Contributor

Use case:

We use the Aurora scheduler in Mesos which assign tasks names using a
jobkey which consists of: "role/environment/jobname". We often end up
in a scenario where we want all jobs running under a given "role" or
"role/environment" combination to have access to a Vault role. Under
the current implementation this would require us to iterate all of the
possible combination and install policy files.

Previous versions of Vault gatekeeper allowed us to do wildcards with
prefixes as they used a simple glob match. Moving to the radix tree
implementation broke this behaviour.

This patch changes the matching behaviour slightly. Whenever we detect
a wildcard match we flag the policy as such.

When performing policy matching for wildcards we do a prefix search,
rather than looking for the last character being ":". Policy matching
for non wildcard policies is unchanged.

No changes to the radix tree structure are required.

Use case:

We use the Aurora scheduler in Mesos which assign tasks names using a
jobkey which consists of: "role/environment/jobname".  We often end up
in a scenario where we want all jobs running under a given "role" or
"role/environment" combination to have access to a Vault role.  Under
the current implementation this would require us to iterate all of the
possible combination and install policy files.

Previous versions of Vault gatekeeper allowed us to do wildcards with
prefixes as they used a simple glob match.  Moving to the radix tree
implementation broke this behaviour.

This patch changes the matching behaviour slightly.  Whenever we detect
a wildcard match we flag the policy as such.

When performing policy matching for wildcards we do a prefix search,
rather than looking for the last character being ":". Policy matching
for non wildcard policies is unchanged.

No changes to the radix tree structure are required.
@angrylogic angrylogic force-pushed the enable_wildcard_with_prefix branch from cff32d8 to 9dd7582 Compare September 18, 2018 14:27
@nemosupremo nemosupremo merged commit 389484f into nemosupremo:master Sep 18, 2018
@nemosupremo
Copy link
Owner

Thanks

@angrylogic angrylogic deleted the enable_wildcard_with_prefix branch September 18, 2018 18:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants