Page MenuHomePhabricator

gitlab: enforce 2fa for admins
Closed, ResolvedPublic

Description

gitlab 16.8 release notes say:

You can now enforce whether GitLab administrators are required to use two-factor authentication (2FA) in their self-managed instance. It is good security practice to use 2FA for all accounts, especially for privileged accounts like administrators. If this setting is enforced, and an administrator does not already use 2FA, they must set up 2FA on their next sign-in.

It felt like we already do that but since this is advertised as a new feature since our upgrade yesterday/today we should check and enable it.

Details

TitleReferenceAuthorSource BranchDest Branch
require 2fa for adminsrepos/releng/gitlab-settings!60brennenwork/admin-2famain
Customize query in GitLab

Related Objects

StatusSubtypeAssignedTask
Resolvedeoghan

Event Timeline

Dzahn added a parent task: Restricted Task.Mar 28 2024, 6:32 PM

No objections here. In practice all current admins are probably already required to use 2fa due to membership in one or more groups that require it, but there's no harm in enabling the setting.

I don't see a key for this mentioned in https://docs.gitlab.com/ee/api/settings.html - digging a bit.

I thought that was part of {T316419}, but apparently I was mistaken. +1 from me.

Although currently undocumented, it looks like it's require_admin_two_factor_authentication in the API, based on:

🌑 11:52:17 brennen@inertia:~/code/wmf/releng/gitlab-settings (work/admin-2fa *$%) ☼ ./settings --instance https://gitlab.wikimedia.org/ view|grep two
    "require_admin_two_factor_authentication": false,
    "require_two_factor_authentication": false,
    "two_factor_grace_period": 48,

Eoghan found out all existing admins already had 2fa enabled individually - but there are also some bot accounts that might need the admin rights. He mentioned testing if password login can be disabled for those bot accounts. Other than that we are all for this, ack!

LSobanski triaged this task as High priority.
LSobanski moved this task from Incoming to Work in Progress on the collaboration-services board.

I've enabled this setting, and approved @brennen's change to include this into the settings file.

Change #1012350 had a related patch set uploaded (by Dzahn; author: Aklapper):

[operations/puppet@production] phabricator: MFA status check: Exclude bot accounts

https://gerrit.wikimedia.org/r/1012350