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

Namespace whitelist annotation is too permissive #328

Closed
leosunmo opened this issue Nov 14, 2019 · 0 comments · Fixed by #329
Closed

Namespace whitelist annotation is too permissive #328

leosunmo opened this issue Nov 14, 2019 · 0 comments · Fixed by #329

Comments

@leosunmo
Copy link
Contributor

I came across this while writing tests for #327.

The default regex at https://github.com/uswitch/kiam/blob/master/pkg/server/policy.go#L164 is far too permissive.

Unless I am missing something, I am able to make it match with most things as long as that character appears once in the role string. For example:
https://goplay.space/#w4k3fBwrXVJ

Playing around here https://regex101.com/r/a2eGqY/1/
you can see that we'd have to detect if the string has any regex characters and if it doesn't, add something like ^i$ to make it not match a single character in the role.

Not sure if there's a nicer way around the regex issue or if it requires some string analysing to figure out how to construct the regex query.

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 a pull request may close this issue.

1 participant