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

Gitlab LDAP sync script tries to remove "bot" users from groups. #44

Open
TafkaMax opened this issue Jan 22, 2024 · 4 comments
Open

Gitlab LDAP sync script tries to remove "bot" users from groups. #44

TafkaMax opened this issue Jan 22, 2024 · 4 comments

Comments

@TafkaMax
Copy link

The Gitlab LDAP sync script tries to currently remove "bot users" that are created when adding an access_token from non-ldap groups. Maybe even from groups that are also present in LDAP.

https://gitlab.example.com/groups/<GROUPNAME>/-/settings/access_tokens

@TafkaMax
Copy link
Author

[notice] Deleting extra group members...
[info] Deleting user #132 "REDACTED" from group #1019 "REDACTED" [REDACTED].
[error] Gitlab failure: 403 Forbidden

@TafkaMax
Copy link
Author

image

When adding an access token to a group a bot user is created there. So a check is necessary to see if user is bot.

@AdamReece-WebBox
Copy link
Collaborator

AdamReece-WebBox commented Jan 25, 2024

I've not looked yet, but I suspect the users API will be able to reveal if a user is a bot. We could then exclude bot users from deletions.

(I noticed this happening at our corporate Gitlab too, though I've only ever needed to run the tool once here so far.)

@TafkaMax TafkaMax changed the title Gitlab LDAP sync script tries to remove "bot users" from non-ldap groups. Gitlab LDAP sync script tries to remove "bot" users from groups. Jan 25, 2024
@TafkaMax
Copy link
Author

Reformatted the Title. I first noticed it with groups that did not match a LDAP group name. But it is happening with all groups.

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

No branches or pull requests

2 participants