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

Filter IAM roles and policy attachments related to SSO #1028

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

krzysdabro
Copy link
Contributor

SSO roles cannot be modified by user which resulted in errors during nuke:

global - IAMRole - AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546 - [CreateDate: "2023-06-20T08:01:29Z", LastUsedDate: "2023-06-20T08:01:29Z", Name: "AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546", Path: "/aws-reserved/sso.amazonaws.com/"] - failed
ERRO[0117] UnmodifiableEntity: Cannot perform the operation on the protected role 'AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546' - this role is only modifiable by AWS
	status code: 400, request id: 0d2c8792-37de-4028-8dbc-bdc6a917a861
global - IAMRolePolicyAttachment - AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546 -> AdministratorAccess - [PolicyArn: "arn:aws:iam::aws:policy/AdministratorAccess", PolicyName: "AdministratorAccess", RoleCreateDate: "2023-06-20T08:01:29Z", RoleLastUsed: "2023-06-20T08:01:29Z", RoleName: "AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546", RolePath: "/aws-reserved/sso.amazonaws.com/"] - failed
ERRO[0117] UnmodifiableEntity: Cannot perform the operation on the protected role 'AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546' - this role is only modifiable by AWS
	status code: 400, request id: c517c2b4-b4a4-43d7-a47b-6066c92aace6

Output after changes:

global - IAMRole - AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546 - [CreateDate: "2023-06-20T08:01:29Z", LastUsedDate: "2023-06-20T08:01:29Z", Name: "AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546", Path: "/aws-reserved/sso.amazonaws.com/"] - cannot delete SSO roles
global - IAMRolePolicyAttachment - AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546 -> AdministratorAccess - [PolicyArn: "arn:aws:iam::aws:policy/AdministratorAccess", PolicyName: "AdministratorAccess", RoleCreateDate: "2023-06-20T08:01:29Z", RoleLastUsed: "2023-06-20T08:01:29Z", RoleName: "AWSReservedSSO_AdministratorAccess_073ae2cbd6a6a546", RolePath: "/aws-reserved/sso.amazonaws.com/"] - cannot detach from SSO roles

@krzysdabro krzysdabro requested a review from a team as a code owner June 20, 2023 08:21
@svenwltr svenwltr merged commit 58e4627 into rebuy-de:main Jun 20, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants