1. Resources
  2. Detection rules
  3. Two-Factor Authentication Requirement Disabled in GitLab

Two-Factor Authentication Requirement Disabled in GitLab detection rules

The setting that forces GitLab users to register a second factor is turned off for a group or the instance, or an account's second factor is removed. Password-only sign-in returns, and a phished or reused password is enough again.

Platform
GitLab
Severity
High
Log source
GitLab audit events
Last updated
Rule formats
Sigmaand queries for: Splunk
What an attacker needs
The Owner role on the group, or administrator access on a GitLab Self-Managed or GitLab Dedicated instance.
Impact
Accounts in the group or instance can sign in with a password alone, so a guessed, reused or phished password is enough again.
Response
Switch the requirement back on where it was cleared, and take the Owner role or administrator access from the acting account until the change is explained.
Mitigation
Enforce 2FA at the top-level group, where it applies to all subgroups, and for all users on GitLab Self-Managed and GitLab Dedicated.
Audit events
group_two_factor_grace_period_updatedallow_mfa_for_subgroups_updatedgroup_require_two_factor_authentication_updatedapplication_setting_updateduser_disable_passkeyuser_disable_two_factor
Threat groups
Scattered Spider

How the attack works

GitLab can require two-factor authentication (2FA) at two levels. A group Owner can require it for all direct and inherited members of a group, and an administrator of a GitLab Self-Managed or GitLab Dedicated instance can require it for all users or for administrators only. Each requirement is one checkbox or one API attribute.

An attacker who holds an Owner or administrator session can clear the requirement, so that accounts they control or later compromise do not need a second factor. Clearing the requirement does not remove factors that users already registered, so attackers also remove the second factor of a specific account: an administrator can disable 2FA for another user, and a top-level group Owner on GitLab.com can do it for enterprise users. GitLab records the group setting as group_require_two_factor_authentication_updated, instance settings as application_setting_updated with the setting name in details.change, and a removed factor as user_disable_two_factor. Two quieter group changes shape the same requirement and have their own rule: a long grace period (group_two_factor_grace_period_updated) delays enforcement while the requirement still shows as on, and allow_mfa_for_subgroups_updated changes whether subgroups may enforce a requirement of their own. A deleted passkey, which is the default second factor of an account that has one, is recorded as user_disable_passkey from GitLab 18.7.

What an attacker needs

  • The Owner role on the group, or administrator access on a GitLab Self-Managed or GitLab Dedicated instance.
  • Log collection: audit event streaming (Ultimate) to an HTTP destination, received as JSON. Group events arrive through a top-level group or instance stream. Instance settings and user events need the instance stream; user_disable_two_factor also has a group scope from GitLab 17.6.

Impact

Accounts in the group or instance can sign in with a password alone. This weakens every account at once: a guessed, reused or phished password is enough again, and an attacker keeps access to an account whose second factor they could not satisfy.

Detection rules

GitLab Two-Factor Grace Period or Subgroup Enforcement Setting Changed

Detects a change to two group settings that shape how the two-factor requirement is applied: the grace period (group_two_factor_grace_period_updated) and the setting that lets subgroups enforce their own requirement (allow_mfa_for_subgroups_updated). The grace period is the number of hours by which enforcement is delayed, so a long value leaves members without a second factor while the requirement still shows as on. With the subgroup setting disabled, subgroups cannot set a requirement of their own. The event type reference does not document the fields that hold the old and the new value, so the rule matches on the event type and fires in both directions.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab Two-Factor Grace Period or Subgroup Enforcement Setting Changed
id: fd2936b2-f7f0-4b99-8ad2-dba5dc1ad403
status: experimental
description: >-
  Detects a change to two group settings that shape how the two-factor
  requirement is applied: the grace period
  (group_two_factor_grace_period_updated) and the setting that lets
  subgroups enforce their own requirement
  (allow_mfa_for_subgroups_updated). The grace period is the number of hours
  by which enforcement is delayed, so a long value leaves members without a
  second factor while the requirement still shows as on. With the subgroup
  setting disabled, subgroups cannot set a requirement of their own. The
  event type reference does not document the fields that hold the old and
  the new value, so the rule matches on the event type and fires in both
  directions.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/security/two_factor_authentication/
  - https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.persistence
  - attack.credential-access
  - attack.t1556.006
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - group_two_factor_grace_period_updated
      - allow_mfa_for_subgroups_updated
  condition: selection
falsepositives:
  - A group Owner who shortens the grace period or switches the subgroup setting on writes the same events. Read the details of the event, or the settings of the group, for the value now in force.
  - A grace period set for the rollout of the requirement. It should match a planned change and end on a known date.
level: low

False positives

  • A group Owner who shortens the grace period or switches the subgroup setting on writes the same events. Read the details of the event, or the settings of the group, for the value now in force.
  • A grace period set for the rollout of the requirement. It should match a planned change and end on a known date.

GitLab Two-Factor Authentication Requirement Turned Off

Detects the two-factor authentication requirement being turned off for a GitLab group (group_require_two_factor_authentication_updated) or for the instance (application_setting_updated for require_two_factor_authentication or require_admin_two_factor_authentication). Events that turn the requirement on are excluded through details.to. The details keys follow GitLab's documented change events and were checked against the GitLab source.

LevelHighStatusExperimentalLog sourceGitLab audit events
title: GitLab Two-Factor Authentication Requirement Turned Off
id: 73c52b00-ea34-4f8f-8050-01a06ab01d29
status: experimental
description: >-
  Detects the two-factor authentication requirement being turned off for a
  GitLab group (group_require_two_factor_authentication_updated) or for the
  instance (application_setting_updated for require_two_factor_authentication
  or require_admin_two_factor_authentication). Events that turn the
  requirement on are excluded through details.to. The details keys follow
  GitLab's documented change events and were checked against the GitLab source.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/security/two_factor_authentication/
  - https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-11
tags:
  - attack.defense-impairment
  - attack.persistence
  - attack.credential-access
  - attack.t1556.006
logsource:
  product: gitlab
  service: audit
detection:
  selection_group:
    event_type: group_require_two_factor_authentication_updated
  selection_instance:
    event_type: application_setting_updated
    details.change:
      - require_two_factor_authentication
      - require_admin_two_factor_authentication
  filter_enabled:
    details.to: 'true'
  condition: 1 of selection_* and not filter_enabled
falsepositives:
  - A planned move of the requirement to the identity provider under enforced SSO. Confirm the replacement control exists.
level: high

False positives

  • A planned move of the requirement to the identity provider under enforced SSO. Confirm the replacement control exists.

GitLab User Passkey Disabled

Detects a passkey being disabled on a GitLab account (audit event type user_disable_passkey, GitLab 18.7 and later). A passkey lets a user sign in without a password, and with two-factor authentication turned on it is the default second factor. When the last passkey is deleted GitLab also disables passkey sign-in for the account, which then depends on its password and its remaining factors. GitLab gives the event the User scope, and the Group scope for enterprise users only. The event type reference does not say whether someone other than the account owner can cause it, so compare the author of the event with its target.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab User Passkey Disabled
id: 132b674c-09e1-4704-84f5-9752ecc6a004
status: experimental
description: >-
  Detects a passkey being disabled on a GitLab account (audit event type
  user_disable_passkey, GitLab 18.7 and later). A passkey lets a user sign in
  without a password, and with two-factor authentication turned on it is the
  default second factor. When the last passkey is deleted GitLab also
  disables passkey sign-in for the account, which then depends on its
  password and its remaining factors. GitLab gives the event the User scope,
  and the Group scope for enterprise users only. The event type reference
  does not say whether someone other than the account owner can cause it, so
  compare the author of the event with its target.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/auth/passkeys/
  - https://docs.gitlab.com/user/profile/account/two_factor_authentication/
  - https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.persistence
  - attack.credential-access
  - attack.t1556.006
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type: user_disable_passkey
  condition: selection
falsepositives:
  - Users who replace a phone, a laptop or a security key and delete the old passkey. Raise the priority when the account is an Owner or an administrator, or when a password change or a new sign-in location comes with it.
level: low

False positives

  • Users who replace a phone, a laptop or a security key and delete the old passkey. Raise the priority when the account is an Owner or an administrator, or when a password change or a new sign-in location comes with it.

GitLab User Two-Factor Authentication Disabled

Detects two-factor authentication being disabled for a GitLab account (audit event type user_disable_two_factor). The event is written when users remove their own factor and when an administrator or, for enterprise users on GitLab.com, a top-level group Owner removes it for them.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab User Two-Factor Authentication Disabled
id: 89a9eeca-c284-4e5a-b38e-bda84f3657a1
status: experimental
description: >-
  Detects two-factor authentication being disabled for a GitLab account
  (audit event type user_disable_two_factor). The event is written when users
  remove their own factor and when an administrator or, for enterprise users
  on GitLab.com, a top-level group Owner removes it for them.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/security/two_factor_authentication/
  - https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-11
tags:
  - attack.defense-impairment
  - attack.persistence
  - attack.credential-access
  - attack.t1556.006
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type: user_disable_two_factor
  condition: selection
falsepositives:
  - Users replacing a phone or security key, and help desk resets. Raise the priority when the author differs from the target or the target is an Owner or administrator.
level: medium

False positives

  • Users replacing a phone or security key, and help desk resets. Raise the priority when the author differs from the target or the target is an Owner or administrator.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Second factor removed by another account, then a password sign-in of the affected account

Detection hypothesisSequence of eventsJoins two logsNeeds your own lists

An administrator or Owner account in an attacker's hands can remove the second factor of another user and then sign in as that user with a password the attacker knows. A removal by someone other than the user, followed by a password sign-in of the same user from an unusual address, or from the address the removal came from, is that order of steps. A help desk reset is followed by the owner's own sign-in from a usual address.

  1. A second factor is removed: user_disable_two_factor whose author (author_id) is not the affected account. Keep the affected account, the author, the author's ip_address and the time.
  2. Within 24 hours the affected account signs in with a password: authenticated_with_password (GitLab 18.3 and later).
  3. Raise the priority when the sign-in comes from the author's ip_address, or GitLab reports an unseen address for the account (user_signed_in_from_unseen_ip, GitLab 19.0 and later), and when the author is not one of your help desk or administrator accounts.

Eventsuser_disable_two_factorauthenticated_with_passworduser_signed_in_from_unseen_ip

LimitsA help desk reset for a lost phone is followed by the owner's own password sign-in, which looks the same unless the address is unusual. GitLab does not document which field names the affected account in user_disable_two_factor or the user in the sign-in events, so check one test event of each. The list of help desk and administrator accounts is yours to keep. The 24 hours are a starting point.

Triage

  • Read details.from and details.to to confirm the requirement was turned off, and entity_path for the group or gitlab_instance for the instance.
  • Identify the actor (author_name, ip_address) and confirm the change through a separate channel.
  • For user_disable_two_factor, compare the author with the target. A user removing their own factor is usually a device change; an Owner or administrator removing it for someone else needs a support ticket.
  • Review sign-ins without a second factor after the change (authenticated_with_password events) and turn the requirement back on.

Response

Once the attack is confirmed:

  1. Switch the requirement back on where it was cleared. On an instance, check both the setting for all users and the setting for administrators.
  2. Take the Owner role or administrator access from the acting account until the change is explained, reset its credentials and revoke its tokens.
  3. For each account whose second factor was removed by someone else, reset the password, revoke its tokens and have the owner register a new factor before the account is used again.
  4. Treat an account that signed in with a password alone during the period as compromised when its owner cannot confirm the sign-in.
  5. List the accounts that have no second factor and confirm that each one registers again. Disabling a user's factor is permanent, so it does not return when the requirement does.

Mitigation

  • Enforce 2FA at the top-level group, where it applies to all subgroups, and for all users on GitLab Self-Managed and GitLab Dedicated.
  • Where sign-in is delegated to an identity provider with SSO enforcement, enforce phishing-resistant methods there and treat these GitLab settings as a second line.
  • Keep Owner and administrator accounts few, dedicated and protected with WebAuthn devices.
  • Alert on every change that turns a 2FA requirement off and on every 2FA reset performed by someone other than the user.

Frequently asked questions

Does clearing the requirement remove the second factors users already registered?

No. Clearing the requirement stops GitLab from demanding a second factor, but factors that users already registered stay in place. That is why attackers also remove the factor of a specific account, which GitLab records as `user_disable_two_factor` and a separate rule on this page reports.

Which audit stream delivers each of these events?

The group setting arrives through a top-level group stream or the instance stream. Instance settings, reported as `application_setting_updated`, and user events need the instance stream. `user_disable_two_factor` also has a group scope from GitLab 17.6. All of them depend on audit event streaming, which needs the Ultimate tier.

How do I tell a phone replacement from an attack in a 2FA removal?

Compare the author of the event with the target. A user who removes their own factor is usually replacing a phone or security key. An Owner or administrator who removes it for someone else should be able to show a support ticket. Raise the priority when the target is an Owner or an administrator.

Is the alert still relevant when sign-in goes through an identity provider?

Yes, but it can be a planned change. Where sign-in is delegated to an identity provider with SSO enforcement, the second factor is enforced there and the GitLab settings act as a second line. A planned move of the requirement to the identity provider is the known benign cause, so confirm that the replacement control exists before you close the alert.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.