Skip to content

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

Merged
nklaassen merged 1 commit intobranch/v15from
nklaassen/v15/fix-cluster-leak
Apr 19, 2024
Merged

[v15] fix: return OpaqueAccessDenied for NotFound remote cluster errors#40681
nklaassen merged 1 commit intobranch/v15from
nklaassen/v15/fix-cluster-leak

Conversation

@nklaassen
Copy link
Copy Markdown
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>
@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/v15 with commit bfba5bd Apr 19, 2024
@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.

3 participants