Closed snorberhuis closed 8 months ago
I can reproduce the error locally using --group-match 'name:AWS*'
which is configured in the AWS Stack. This filters out all groups not beginning with AWS.
I did not configure a group match so I would expect the stack and the CLI to behave the same way.
Hey @snorberhuis, we suddenly came across the same issue you're sharing in a production environment.
We do have a group match in our deployment, and the lambda removed the users and groups, and during the next run a few minutes later, it recreated them. Do you you have any additional insights on this or did it happen to you again?
Thank you.
No, it did not happen to me again after I left the following parameter blank:
GoogleGroupMatch: <>
I kept the bug report open because I think the CLI should have the same default as the serverless repository. After my initial attempt for myself, I deployed this sso-sync
to 2 more clients, and they all stumbled on this point.
Thanks for the quick reply 😄 ok, we're deploying the lambda ourselves instead of using the serverless application repository, so might be the case is another issue in the code. In our case we do need to keep the group match to sync only AWS groups.
Thanks again!
That bit of context around the group match is probably key. I will need to review the code and run tests to reproduce but I think it’s likely to be related default values.
Wondering if folks have any further insight on this. We likely hit the same issue that deleted all the groups and users and then recreated them in the next tick.
So I will need to dig further but the two configurations are not the same the first would have wildcard'd to all groups in the directory but only users that are members of those groups. The second would have synced all groups with prefix AWS*.
However, that doesn't explain the delete and recreate.
I'm just finishing feature release v2.2 which adds greater match flexibility and the next feature release I'm about to start working is looking moving all CRUD back to SCIMv2 to improve least privilege and more accurate matching.
I'll try to reproduce your experience above and build a test case from it.
As of v2.2.x Defaults are the same in the SAR template and the cli tool.
@alexhermida and @ChrisPates I have now also seen the same bug Alex reported. I have created a separate issue: https://github.com/awslabs/ssosync/issues/194
Describe the bug
To Reproduce Steps to reproduce the behavior:
ssosync
Expected behavior The users and groups are not deleted by the Lambda. They are synced into Identity Center.
Additional context I have verified that the configuration is the same. I also see the lambda not erroring and acting as intended.