Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

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
@der-eismann der-eismann requested a review from svenwltr June 20, 2023 15:51
@svenwltr svenwltr merged commit 58e4627 into rebuy-de:main Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants