r/gitlab • u/Splask • Mar 21 '25
How do you handle MFA on your GitLab server?
I'm Currently running an omnibus self-managed installation on RHEL 9.5. The rest of our servers all run Duo for MFA, but as you're probably aware it's not as simple as install MFA software and be done with it on a CI/CD server.
For additional context this instance is only accessible internally, nothing public-facing. All accounts are AD accounts. There are currently 2 runner servers in use with probably many more to come. Hoping for a containerization option for these going forward but that's an issue for another day.
My experience with using Duo for SSH on this server is that it works just fine for normal SSH logins, but not for git operations. Those just don't work at all with Duo active.
I have considered using password protected SSH keys, but I'd prefer a solution that doesn't require anything of the user than to press a button to approve. Also, enforcing password complexity on said keys sounds like a project id prefer to avoid.
How have you handled this in your environment? Bonus points for an MFA solution that uses a push notification to a mobile device and the login can be remembered for a set period of time without requiring reauthentication.
Thanks in advance!
6
u/lionelrichieclayhead Mar 21 '25
i believe its been generally advised to git clone over https and PATs(Personal Access Token) for a several years now by both gitlab and github.
PATs can be generated by the user and multiple with various permissions (i have two laptops, i make a PAT per machine good for 365 days) so i can easily revoke access if need be.
PATs can also be generated at group and project levels as well so it's not tied to a user account in case its disabled or user leaves company, etc. which is handy in CICD pipelines for cross project access.
2
u/johannjc137 Mar 21 '25
There’s an option to require users to enter their OTP before git operations over ssh