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

Excluding EntraID users and groups from deletion #116

Conversation

julialawrence
Copy link
Contributor

@julialawrence julialawrence commented Aug 5, 2024

Story Link: ministryofjustice/analytical-platform#4838
Currently the scim function fully reconciles Github membership to AWS Identity Center. However, if we want to progress to a transitional stage where authentication is possible both from Github and EntraID, the Github SCIM function needs to ignore groups and users synchronised from EntraID.

This PR adds logic to skip deletion of users with @justice.gov.uk addresses and groups prefixed with entraid-aws-identitycenter- which will be managed by an alternative Lambda function being developed here: https://github.com/ministryofjustice/moj-terraform-scim-entra-id

Test run with
GITHUB_ORGANISATION=ministryofjustice GITHUB_TOKEN=XXXXXXXXX SSO_AWS_REGION=eu-west-2 SSO_EMAIL_SUFFIX='@digital.justice.gov.uk' SSO_IDENTITY_STORE_ID=XXXXX node index.js
Output snippet:

Skipping deletion of user with email: [email protected]
Skipping deletion of user with email: [email protected]
Skipping deletion of user with email: [email protected]
DRYRUN: [delete] [users] [REDACTED]
Skipping deletion of user with email: [email protected]

@julialawrence julialawrence requested a review from a team as a code owner August 5, 2024 13:46
Copy link

@ewastempel ewastempel left a comment

Choose a reason for hiding this comment

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

LGTM

@AntonyBishop AntonyBishop merged commit 573b138 into ministryofjustice:main Aug 5, 2024
2 checks passed
@julialawrence julialawrence deleted the feature/prevent-deletion-of-jutice-gov-users-and-groups branch August 27, 2024 17:12
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