Project deny destinations results in destinations being allowed when not matched #21264
Labels
bug
Something isn't working
component:multi-tenancy
Features related to app projects
security
Security related
Describe the bug
When "deny" rules are used in AppProject, if a destination is NOT matched by a DENY rule, then it will result in that destination being ALLOWED. In general, a destination should
However, there is currently no concept of "deny" rules. Only a concept of "negative matching". This negative matching has a significant different behavior than the repo URL negative matching "https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#managing-projects" which will actually deny.
The documentation states that
However, this is false.
To Reproduce
test
of clusterhttps://my-cluster
test
is matched by*
andhttps://my-cluster
correctly does not matchhttps://kubernetes.default.svc
.Expected behavior
The destination should only be allowed when a project destination is allowed. If a deny rule exist, it should only be evaluated for "access denial" and not for "grating access"
Proposal
Option 1: Add a new feature flag to change the behavior
!
Option 2: Add a new parameter on the AppProject destination
deny: true
to specify when a rule is to deny access.!
is not used in deny rules to avoid confusion caused by the negation of negationProblematic code
argo-cd/pkg/apis/application/v1alpha1/app_project_types.go
Lines 484 to 507 in 8841b0d
The text was updated successfully, but these errors were encountered: