How to harden your self-managed GitLab instance
May 23, 2023Ayoub Fandi

Summary
This post provides a practical guide for hardening self-managed GitLab instances, focusing on seven key areas: enabling multi-factor authentication, enforcing additional sign-up checks (email confirmation, password complexity, allowed domains), limiting public visibility of groups and projects, hardening SSH settings (protocols, key types), reviewing account and limit settings (attachments, pushes, session duration, token lifetime), securing CI secrets with encrypted containers (recommending HashiCorp Vault and TLS 1.2+), and protecting pipelines for all branches (including protected environments). It emphasizes layered security and reducing the attack surface, aligning with GitLab's transparency and open-source principles.
More from the Security Control Framework trail
- Track organization-wide security risk in one dashboard
- Dependency Firewall: Block risky packages before the build
- Two front doors: Module-level access in a Django GRC app
- How GitLab tracks vulnerabilities through refactors and reformatting
- Shai-Hulud copycat campaign targets Python developers through PyPI typosquatting