Skip to content
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

[v15] fix: return OpaqueAccessDenied for NotFound remote cluster errors #40681

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

nklaassen
Copy link
Contributor

Backport #40571 to branch/v15

This commit modifies OpaqueAccessDenied to return an identical generic NotFound error whether the input error is NotFound or AccessDenied. The commit also updates all call sites of OpaqueAccessDenied to use it in the paths where there is any error fetching the resource as well as when access is denied.

It doesn't do much good to return AccessDenied errors as NotFound, if they don't match the NotFound error you would get if the resource really didn't exist.
It's trivial to tell the errors apart and discover the existence of a resource you shouldn't be allowed to access.
The commit attempts to mitigate that issue and properly hide the existence of resources the user should not be allowed to list.

Changelog: generic "not found" errors are returned whether a remote cluster can't be found or access is denied.

…errors

Backport #40571 to branch/v15

This commit modifies OpaqueAccessDenied to return an identical generic
NotFound error whether the input error is NotFound or AccessDenied.
The commit also updates all call sites of OpaqueAccessDenied to use it in
the paths where there is any error fetching the resource as well as when
access is denied.

It doesn't do much good to return AccessDenied errors as NotFound, if
they don't match the NotFound error you would get if the resource really
didn't exist.
It's trivial to tell the errors apart and discover the existence of a
resource you shouldn't be allowed to access.
The commit attempts to mitigate that issue and properly hide the
existence of resources the user should not be allowed to list.

Changelog: generic "not found" errors are returned whether a remote
cluster can't be found or access is denied.

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
@nklaassen nklaassen added this pull request to the merge queue Apr 19, 2024
Merged via the queue into branch/v15 with commit bfba5bd Apr 19, 2024
34 checks passed
@nklaassen nklaassen deleted the nklaassen/v15/fix-cluster-leak branch April 19, 2024 15:04
@camscale camscale mentioned this pull request Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants