-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
AppProject deny namespaces does not respect cluster whitelist #12383
Comments
@blakepettersson @crenshaw-dev as I know you worked on implementing the initial feature a bit. Thanks for the help! |
I agree that the rules are a bit difficult to read, but I think the behavior matches the documentation.
Your hypothetical app matches the first four destinations, because they each specify allow any destination server, so long as the app does not deploy to a disallowed namespace. I think to solve your use case, you should duplicate the cluster1 destination server name in each destination. |
I think the example in the docs is misleading. The final destination of */* is unnecessary, because of one of the other two rules matches, there’s no need for an additional catch-all “allow” rule. |
I do think the rules are a bit difficult to understand. As you pointed out, the final destination of / isn't necessary and for me, that actually confused me more because I thought it was providing something to the rule. I think showing maybe a few more examples of the deny rules might be beneficial. Or at least maybe the one I am using -- I imagine a rule to allow an |
What examples would you want? I can remove the final "catch-all" rule to hopefully reduce some confusion, but what else? 😄 |
Agreed. I need to double-check our glob library, but I think |
I would love something like: But if: I was also adding the * as a catch all for every other namespaces :-( |
Project destination checking uses the gobwas glob library, which does allow (The fact that our code base uses multiple glob libraries is a problem that I want to fix.) |
@flaviomoringa what do you think of this? |
to accomplish this, is it true we'd only need the deny rule for the single cluster since the rule would inherit an allow rule for all other namespaces? For example:
I believe the above would only allow the |
I would just make it even clearer that a single deny rule is enough to allow everything else with an example even simpler than the one you present (but also keeping that to show a more complicated case). Something like:
This allows a deploying anything to any server in any namespace, except deploying to namespace kube-system on mycluster.local. But maybe we are starting to put too much information :-) |
For the rule given, I don't think that's correct. I think it allows deploying anything to the given server in any namespace except for kube-system on mycluster.local. |
See... even I failed lolll... I was thinking a single deny rule existing would be enough to allow everything else and just deny what that rule said... being one or more clusters. |
I think #20045 would allow for a more intuitive behaviour. |
Checklist:
argocd version
.Describe the bug
I create an
AppProject
for each of our development teams and whitelist the cluster(s) they may deploy to using thespec.destinations[].server
field. Additionally, I restrict whatNamespaces
they may deploy to. Since I don't care whatNamespaces
they create, a blacklist works better for me. As such, I started using the feature implemented by #9652, but have discovered a bug where it's not respecting the whitelisted cluster endpoints.To Reproduce
AppProject
like:Application
like:Expected behavior
The
Application
should not get deployed because thedestination.name
does NOT map to aspec.destinations[].server
that's been whitelisted in theAppProject
.Version
v2.5.4
The text was updated successfully, but these errors were encountered: