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

Remove denied AWS Roles in AWS Role Web picker #41585

Merged
merged 3 commits into from
May 17, 2024

Conversation

marcoandredinis
Copy link
Contributor

This PR uses the accessChecker to remove AWS Roles which users don't have access to.

Previously, all the AWS Roles that the user had access to would be listed.
After this change, only the AWS Roles actually available to the user will be displayed.

changelog: Remove invalid AWS Roles from Web UI picker

See #41499 for more details

Fixes: #41499

@marcoandredinis marcoandredinis marked this pull request as ready for review May 15, 2024 14:11
@github-actions github-actions bot requested review from ryanclark and tcsc May 15, 2024 14:11
@GavinFrazar GavinFrazar self-requested a review May 15, 2024 18:55
@GavinFrazar
Copy link
Contributor

GavinFrazar commented May 16, 2024

If I delete all my non-aws apps, it looks like it fixes the login dropdown issue though :D thanks for the fast work!

image

Comment on lines 787 to 796
case types.KindApp:
if !resourceIsApp || !resourceAsApp.IsAWSConsole() {
return nil, trace.BadParameter("received unsupported resource type for Application kind: %T", resource)
}

loginGetter = role.GetAWSRoleARNs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks resource fetching if I have non-aws apps configured:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test for this case.

lib/services/access_checker.go Show resolved Hide resolved
lib/web/ui/app.go Show resolved Hide resolved
lib/web/apiserver_test.go Outdated Show resolved Hide resolved
This PR uses the accessChecker to remove AWS Roles which users don't
have access to.

Previously all the AWS Roles that the user had access to would be
listed.
After this change, only the AWS Roles available in the AppServer will be
displayed.
@marcoandredinis marcoandredinis force-pushed the marco/awsappaccess_trim_awsrole_list branch from 7287f3a to a56772a Compare May 16, 2024 07:33
Copy link
Contributor

@GavinFrazar GavinFrazar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/services/access_checker.go Outdated Show resolved Hide resolved
Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from tcsc May 17, 2024 10:14
@marcoandredinis marcoandredinis added this pull request to the merge queue May 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 17, 2024
@marcoandredinis marcoandredinis added this pull request to the merge queue May 17, 2024
Merged via the queue into master with commit 469682e May 17, 2024
37 checks passed
@marcoandredinis marcoandredinis deleted the marco/awsappaccess_trim_awsrole_list branch May 17, 2024 11:09
@public-teleport-github-review-bot

@marcoandredinis See the table below for backport results.

Branch Result
branch/v15 Failed

marcoandredinis added a commit that referenced this pull request May 17, 2024
* Remove denied AWS Roles in AWS Role Web picker

This PR uses the accessChecker to remove AWS Roles which users don't
have access to.

Previously all the AWS Roles that the user had access to would be
listed.
After this change, only the AWS Roles available in the AppServer will be
displayed.

* fix error for non-aws apps

* Update lib/services/access_checker.go

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>

---------

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>
github-merge-queue bot pushed a commit that referenced this pull request May 20, 2024
* Remove denied AWS Roles in AWS Role Web picker

This PR uses the accessChecker to remove AWS Roles which users don't
have access to.

Previously all the AWS Roles that the user had access to would be
listed.
After this change, only the AWS Roles available in the AppServer will be
displayed.

* fix error for non-aws apps

* Update lib/services/access_checker.go



---------

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>
justinas pushed a commit that referenced this pull request May 20, 2024
* Remove denied AWS Roles in AWS Role Web picker

This PR uses the accessChecker to remove AWS Roles which users don't
have access to.

Previously all the AWS Roles that the user had access to would be
listed.
After this change, only the AWS Roles available in the AppServer will be
displayed.

* fix error for non-aws apps

* Update lib/services/access_checker.go

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>

---------

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>
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.

app launcher dropdown shows aws roles that are not allowed for app
3 participants