-
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
Get Cluster returns PermissionDenied for non-existing clusters #10830
Comments
seems to have been introduced with #7039: https://github.com/argoproj/argo-cd/pull/7039/files#diff-47255bee56d3ad7830d9721f65c73fac53009229cb98c63c67745527d598835bR126 I wonder if there was a specific reason 🤔 |
Fixes: argoproj#10830 Signed-off-by: cleverhu <[email protected]>
It is a bug, so I pulled a request for this. |
@clementblaise I believe this behavior is intentional, to avoid letting unauthorized users enumerate the clusters by trial and error. By returning a 403 both for "that doesn't exist" and "you're not allowed to see that," we prevent the user from determining which clusters exist. Generally the preferred way of doing this is to return a 404 (like you get a 404 in GitHub when attempting to view a repo which you're not allowed to access). Unfortunately, we can't go the 404 route while still allowing users to update clusters by name instead of URL. If the user gets an I'd like to return a nicer error message while 1) preventing cluster enumeration and 2) allowing users to get clusters by name. But for the moment, I can't think of a way. |
Checklist:
argocd version
.Describe the bug
Argocd API Get Cluster returns PermissionDenied for non-existing clusters
To Reproduce
Expected behavior
API should return not found
Screenshots
Version
Server version is v2.4.13
Logs
Existing cluster
Non existing cluster
The text was updated successfully, but these errors were encountered: