aws-samples / aws-iam-identity-center-extensions

This solution is intended for enterprises that need a streamlined way of managing user access to their AWS accounts. Using this solution, your identity and access management teams can extend AWS SSO functionality by automating common access management and governance use cases
MIT License
65 stars 25 forks source link

Permission set doesn't update despite all good signs #110

Open allquixotic opened 2 years ago

allquixotic commented 2 years ago

We have many permission sets that are updating correctly, and one of them that for unknown reasons doesn't seem to get updated at all by SSO Extensions.

I can reproduce this both with v3.1.7 and with the latest PR of v3.1.8.

Here are steps to reproduce:

After all the above, however, the updated permission set is NOT reflected in the AWS SSO console. So the only piece of the architecture that appears to not update correctly, is AWS SSO itself. It simply contains the "old" version of the permission set, with the new CMPs missing, and the new inline policy additions missing.

The strangest thing is that other permission sets can be updated successfully, and the log messages in the permissionSetTopicProcessor are different!

Here's what I saw in the statusMessages of the permissionSetTopicProcessor when a permission set is completely successfully updated, end-to-end:

Initiating permission set CRUD logic
Resolved instanceArn as arn:aws:sso:::instance/ssoins-...
Determined permission set operation ins of type update
Determined that permission set exists
calculating delta for permissionSet update operation
objectArn found, progressing with delta for permission Set update operation
Determining delta for switchKey inlinePolicyDocument-update as part of permissionSet update operation
created/updated inline policy document for permission Set update operation
triggered re-provisioning for permission Set update operation
Waiter invoked for permissionSetProvisioned Operation
Waiter Completed with result: {\"state\":\"SUCCESS\"}"
re-provisioning operation completed for permission Set update operation
permission Set update operation completed

So, even though all the steps of the statusMessages "look like good progress" in the failing case, it seems it skips quite a few steps.

And no, I do not see a prompt to "provision" the permission set in the AWS SSO UI. That makes sense to me, though, because there's no changes the permission set to be provisioned. I expected there to be changes, but when examining the CMPs and inline policy "live", none of the changes we made appear in SSO.

Note, I do not think this behavior is any different between v3.1.7 and v3.1.8. It's just something about this one permission set that is messed up and causes it to take a different, broken, code path in the env-permissionSetTopicProcessor lambda.