Open elmazzun opened 4 days ago
What do you think should be a proper fix?
Would trimming the role string help in this case ?
What do you think should be a proper fix?
I think that RBAC Argo should reflect the proper CSV standard, which means that the following lines should be both valid:
g, admins, role:admin # The "right" line
g, admins, role: admin # The line I typed
Would trimming the role string help in this case ?
I guess so but how far do we want to validate these strings? The following lines are valid CSV but would they be still valid to Argo?
g,admins, role:admin
g, admins,role:admin
g,admins,role:admin
Is there any Argo log where it is reported a failed parsing in RBAC configurations?
(thanks for your work!)
We use casbin for handling the permissions check, tho we can post-process the policy file. But yeah, it's unclear what's the exact scope of this should be. Maybe we can log a warning if there are more or less than two spaces in a line?
Didn't know Argo is relying on Casbin: Argo may validate RBAC lines by enforcing the format Casbin is expecting. Yet, if this is the first time someone reports an issue like mine, @andrii-korotkov-verkada maybe it is better as you suggested, logging a warning about this would be enough.
I would like to work on this issue.
It seems like casbin does not have any issues with the format or parsing of role: admin
. Access is not granted during enforcement since the role named role: admin
does not exist.
Should we be adding logs for references to roles that don't exist?
Yeah, let's do this. Maybe casbin has some functions we can use for that already. But if not, let's add them in argo.
Hm, although the author mentions that removing a space fixes the issue.
I tried at least five CSV online validators: according to all of them, my Argo policy CSV was valid even with that blank space, yet Argo (Casbin?) did not tolerate g, admins, role: admin
.
We may further simplify this by just logging somewhere that no spaces are tolerated in Argo RBAC rules composition and (following my proposal) add in https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/#rbac-model-structure that Argo RBAC model structure use a subset of the CSV where the following lines are _not_ valid, etc. etc.
.
Again, if I am the only one reporting such issue I don't want you guys to work too much on this, I guess there are more important tasks to be dealt.
Hi!
I found out that, in Argo RBAC permissions, line
g, admins, role: admin
is not valid and will cause permission issues; to fix this, I had to remove the blank space between:
andadmin
in order to have my permissions back (ie:g, admins, role:admin
).Checklist:
argocd version
.Describe the bug
As said above, a blank space between
role
keyword and ArgoCD roleadmin
will result in permission denied, even if I was cluster-admin.To Reproduce
admins
Group and put your user insideadmins
Group tocluster-admin
ClusterRoleg, admins, role: admin
User Info
from left sidebar and check that your logged User is associated with currect entities: in my case it was:g, admins, role: admin
so that it will beg, admins, role:admin
.Expected behavior
g, admins, role: admin
is a valid CSV row so there should be no problem, yet it is required (apparently) that betweenrole:
andadmin
should be no blank space.Screenshots
None
Version
Kubernetes cluster: v1.29.8
Logs
None