Description:
This check verifies that a GitLab group enforces two-factor authentication (2FA) for all its members. When enforced, members must have 2FA enabled on their account to retain access to the group and its projects.
Rationale:
Two-factor authentication adds a critical second layer of verification beyond a password, significantly reducing the risk of unauthorized access resulting from compromised, weak, or reused credentials. Enforcing 2FA at the group level ensures this protection applies consistently to every member, rather than relying on individual users to opt in voluntarily.
Impact:
Require members without 2FA enabled to configure it before continuing to access group resources.
Temporarily disrupt access for members who have not yet set up 2FA, until they complete configuration.
Significantly reduce the risk of account takeover due to compromised passwords.
Improve overall security posture and compliance with organizational access control policies.
Default Value:
Disabled By default, GitLab groups do not require members to have two-factor authentication enabled. Default setting: require_two_factor_authentication: false
Pre-Requisites:
Owner access to the group
An existing GitLab group
Test Plan:
Sign in to GitLab at https://gitlab.com.
Navigate to the target group.
Select Settings → General.
Expand the Permissions and group features section.
Locate the "Require all users in this group to set up two-factor authentication" option.
Verify that this option is enabled.
Implementation Steps:
Sign in to GitLab at https://gitlab.com.
Navigate to the target group.
Select Settings → General.
Expand the Permissions and group features section.
Check "Require all users in this group to set up two-factor authentication".
Optionally, configure the grace period (in hours) before enforcement takes effect for members without 2FA already enabled.
Save the changes.
Backout Plan:
Sign in to GitLab at https://gitlab.com.
Navigate to Settings → General.
Expand the Permissions and group features section.
Uncheck "Require all users in this group to set up two-factor authentication".
Save the changes.
Confirm that group and project operations function as expected after the rollback.
Reference: