Skip to content

[v13] fix: return OpaqueAccessDenied for NotFound remote cluster errors#40683

Merged
nklaassen merged 1 commit intobranch/v13from
nklaassen/v13/fix-cluster-leak
Apr 19, 2024
Merged

[v13] fix: return OpaqueAccessDenied for NotFound remote cluster errors#40683
nklaassen merged 1 commit intobranch/v13from
nklaassen/v13/fix-cluster-leak

Conversation

@nklaassen
Copy link
Copy Markdown
Contributor

@nklaassen nklaassen commented Apr 18, 2024

Backport #40571 to branch/v13

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/v13

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>
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from rosstimothy April 19, 2024 10:44
@nklaassen nklaassen added this pull request to the merge queue Apr 19, 2024
Merged via the queue into branch/v13 with commit 4bbfb1d Apr 19, 2024
@nklaassen nklaassen deleted the nklaassen/v13/fix-cluster-leak branch April 19, 2024 14:57
This was referenced Apr 25, 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.

3 participants