This is a Java utility for synchronizing the status of GitLab Community Edition server users with a Microsoft Active Directory domain (AD).
You can configure automatic blocking (or unblocking) of your GitLab server user accounts if the corresponding accounts on the AD is blocked (or unblocked).
The utility does not work with the GitLab server database or its configuration, all actions are performed through the GitLab API.
Java version : 1.8 or above
Operation system : Windows or Linux family
Tested on : Windows Server 2016 with JRE 8u202, Debian 11 with openjdk-11, GitLab CE 15.0
- Block (or unblock) GitLab user if such user is blocked (or unblocked) in the AD
- Process only users with LDAP identities or all. When comparing user with identity, only the match of the identity with the root domain (DC) of AD with the domain checked, the full path of the identity is not used
- One-to-one correspondence of accounts occurs by fields
username
(GitLab) andsamAccountName
(AD) - Process only user IDs (username) that match the pattern (regular expression)
- Specify a list of user IDs (username) exclusions that will not be processed by any option
- This utility can be run anywhere (not necessarily on the GitLab server), you only need to have access to the GitLab API and AD
- Only those accounts for which a corresponding AD entry exists are processed. If the account is deleted from AD, then its analogue on GitLab will not be blocked
- Only GitLab accounts with
active
orblocked
statе are processed - This utility is not a daemon and performs a one-time work at startup. For regular automatic processing, you need to use a some scheduler
java -jar gitlabce-block-user.jar -g http://localhost -t mytoken -oi true -adp ldap://localhost:389 -adu cn=admin,ou=Users,ou=MC,dc=mycompany,dc=com -adc password -ads dc=mycompany,dc=com
To build you need Java 1.8 or above and Maven 3.2.5 or above.
mvn install:install-file -Dfile=<yourPath>/argument-parser-1.0.0.jar -DgroupId=com.github.onlycrab.argParser -DartifactId=argument-parser -Dversion=1.0.0 -Dpackaging=jar
Run the build process
mvn clean package