1. Resources
  2. Detection rules
  3. Password Guessing Against GitLab Accounts

Password Guessing Against GitLab Accounts detection rules

Repeated failed sign-ins for one GitLab account, with a wrong password or a wrong second factor, show someone trying credentials against it. A run of wrong second factors means the password is already known.

Platform
GitLab
Severity
Medium
Log source
GitLab audit events
Last updated
Rule formats
Sigmaand queries for: Splunk
What an attacker needs
The user name of an account and network access to the sign-in page, with password sign-in or a form-based provider enabled.
Impact
A correct guess gives the attacker the account and everything it can reach, and a series of wrong guesses locks its owner out.
Response
Block the source address, and block and reset any account that signed in successfully after the failures.
Mitigation
Enforce two-factor authentication or single sign-on without password sign-in, and keep the account lock limits low.
Audit events
login_failed_with_standard_authenticationomniauth_login_failedlogin_failed_with_otp_authenticationlogin_failed_with_webauthn_authenticationuser_access_locked

How the attack works

A GitLab account with a password can be attacked from the sign-in page by anyone who knows its user name. The attacker tries likely or leaked passwords, and once a password is right and the account has two-factor authentication, tries codes for the second factor. GitLab limits this by locking the account: on instances without account email verification every account locks after 10 or more failed attempts and unlocks after 10 minutes, while on GitLab.com and on instances that use account email verification an account without two-factor authentication or an external identity locks after three or more failed attempts in 24 hours. GitLab Self-Managed and GitLab Dedicated can change both limits with the max_login_attempts and failed_login_attempts_unlock_period_in_minutes application settings.

Each failed attempt is an audit event of its own. login_failed_with_standard_authentication is a sign-in that fails with standard authentication such as a password, omniauth_login_failed is a failed OmniAuth login, login_failed_with_otp_authentication is a sign-in that fails because of an incorrect one-time password, and login_failed_with_webauthn_authentication is a failure with a WebAuthn device. user_access_locked is written when access of a user to the instance is locked. One failure means little, so two rules on this page count failures per account and a third reads the lock. A fourth rule counts the accounts that failed from one source address, the ip_address of the audit event schema, which is the shape of password spraying.

What an attacker needs

  • The user name or email address of an account, and network access to the sign-in page of the instance.
  • Password sign-in enabled for the web interface, or a form-based external provider such as LDAP.
  • Log collection: audit event streaming (Ultimate) for the instance or the top-level group, to an HTTP destination, received as JSON. These events have the User scope, and the standard and OmniAuth failures also the Instance scope.

Impact

A correct guess gives the attacker the account with every project and group it can reach, including its access tokens page, its SSH keys and the CI/CD variables of the projects it maintains. A series of wrong guesses locks the account, so the attempts can also keep its owner out. Wrong second factors after a correct password show that the password is in the attacker's hands even when the sign-in never succeeds.

Detection rules

Failed Password Sign-Ins for Many GitLab Accounts From One Address

Counts, per source address, the different accounts with a failed sign-in: the audit event types login_failed_with_standard_authentication and omniauth_login_failed, for events whose entity_type is User, counted by entity_path and grouped by ip_address. Password spraying tries one or two likely passwords against many accounts, so each account stays below its lock limit and below a count per account, while the source address collects failures for account after account. Ten or more different accounts from one address within 30 minutes fit that pattern. The audit event schema documents ip_address as the IP address of the host used to trigger the event and entity_path as the path of the entity the event belongs to. The event type reference does not repeat the fields per event, so validate on your version that a failed sign-in carries the client address and the account. The count and the window are starting points to tune.

Fires when one ip_address has at least 10 different entity_path values within 30 minutes.

Threshold ruleLevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab Password Sign-In Failed (Password Spraying Base Event)
id: 09c714be-3a06-409d-9170-9de14d0e3d26
name: gitlab_password_sign_in_failed_by_address
status: experimental
description: >-
  Base event of the threshold rule in this file. A sign-in to GitLab that
  failed with standard authentication such as a password
  (login_failed_with_standard_authentication) or a failed OmniAuth login
  (omniauth_login_failed), recorded for an existing user (entity_type
  User).
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - login_failed_with_standard_authentication
      - omniauth_login_failed
    entity_type: User
  condition: selection
level: low
---
title: Failed Password Sign-Ins for Many GitLab Accounts From One Address
id: eda47553-84b1-4858-9982-7da363792b8a
status: experimental
description: >-
  Counts, per source address, the different accounts with a failed
  sign-in: the audit event types
  login_failed_with_standard_authentication and omniauth_login_failed,
  for events whose entity_type is User, counted by entity_path and
  grouped by ip_address. Password spraying tries one or two likely
  passwords against many accounts, so each account stays below its lock
  limit and below a count per account, while the source address collects
  failures for account after account. Ten or more different accounts
  from one address within 30 minutes fit that pattern. The audit event
  schema documents ip_address as the IP address of the host used to
  trigger the event and entity_path as the path of the entity the event
  belongs to. The event type reference does not repeat the fields per
  event, so validate on your version that a failed sign-in carries the
  client address and the account. The count and the window are starting
  points to tune.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/compliance/audit_event_schema/
  - https://docs.gitlab.com/security/unlock_user/
  - https://attack.mitre.org/techniques/T1110/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1110.001
  - attack.t1110.003
correlation:
  type: value_count
  rules:
    - gitlab_password_sign_in_failed_by_address
  group-by:
    - ip_address
  timespan: 30m
  condition:
    field: entity_path
    gte: 10
falsepositives:
  - A reverse proxy or load balancer that does not pass the client address to GitLab, so that every failure carries the same address. Fix the forwarding before using the rule.
  - Many users behind one office or VPN address after a forced password change, or an integration that signs in for many users with old passwords. These come from an address you know.
  - The values of 10 accounts and 30 minutes are starting points, not tested limits. A small instance can alert on a lower count.
level: medium

False positives

  • A reverse proxy or load balancer that does not pass the client address to GitLab, so that every failure carries the same address. Fix the forwarding before using the rule.
  • Many users behind one office or VPN address after a forced password change, or an integration that signs in for many users with old passwords. These come from an address you know.
  • The values of 10 accounts and 30 minutes are starting points, not tested limits. A small instance can alert on a lower count.

Many Failed Password Sign-Ins for One GitLab Account

Counts failed sign-ins per account: the audit event types login_failed_with_standard_authentication and omniauth_login_failed, counted by entity_path for events whose entity_type is User. Five or more failures for one account within 10 minutes fit someone trying passwords for it. GitLab locks an account after 10 or more failed attempts by default, and after three in 24 hours for accounts without two-factor authentication where account email verification is used, so keep the count at or below the limit that applies to you. The event type reference does not say which field names the account. In the GitLab source a failure for an existing user is written with that user as the entity, and a failure through a form-based provider such as LDAP is the OmniAuth event. Validate both on your version. The count and the window are starting points to tune.

Fires when one entity_path has at least 5 matching events within 10 minutes.

Threshold ruleLevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab Password Sign-In Failed (Password Guessing Base Event)
id: 3cef9592-d388-427c-bbbd-1496b4696c78
name: gitlab_password_sign_in_failed
status: experimental
description: >-
  Base event of the threshold rule in this file. A sign-in to GitLab that
  failed with standard authentication such as a password
  (login_failed_with_standard_authentication) or a failed OmniAuth login
  (omniauth_login_failed), recorded for an existing user (entity_type
  User).
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - login_failed_with_standard_authentication
      - omniauth_login_failed
    entity_type: User
  condition: selection
level: low
---
title: Many Failed Password Sign-Ins for One GitLab Account
id: 8acf8097-6e13-4db6-8861-2888b0bc3a44
status: experimental
description: >-
  Counts failed sign-ins per account: the audit event types
  login_failed_with_standard_authentication and omniauth_login_failed,
  counted by entity_path for events whose entity_type is User. Five or more
  failures for one account within 10 minutes fit someone trying passwords
  for it. GitLab locks an account after 10 or more failed attempts by
  default, and after three in 24 hours for accounts without two-factor
  authentication where account email verification is used, so keep the
  count at or below the limit that applies to you. The event type
  reference does not say which field names the account. In the GitLab
  source a failure for an existing user is written with that user as the
  entity, and a failure through a form-based provider such as LDAP is the
  OmniAuth event. Validate both on your version. The count and the window
  are starting points to tune.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/compliance/audit_event_schema/
  - https://docs.gitlab.com/security/unlock_user/
  - https://attack.mitre.org/techniques/T1110/001/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1110.001
correlation:
  type: event_count
  rules:
    - gitlab_password_sign_in_failed
  group-by:
    - entity_path
  timespan: 10m
  condition:
    gte: 5
falsepositives:
  - A script, a Git client or an integration that keeps trying an old password after a change. These fail at regular intervals from one known address.
  - A user who forgot a password. Confirm with the user, and look for a password reset afterwards.
  - The values of 5 failures and 10 minutes are starting points, not tested limits. Adjust them to your lock settings.
level: medium

False positives

  • A script, a Git client or an integration that keeps trying an old password after a change. These fail at regular intervals from one known address.
  • A user who forgot a password. Confirm with the user, and look for a password reset afterwards.
  • The values of 5 failures and 10 minutes are starting points, not tested limits. Adjust them to your lock settings.

Many Failed Second Factor Sign-Ins for One GitLab Account

Counts sign-ins that failed at the second factor per account: the audit event types login_failed_with_otp_authentication and login_failed_with_webauthn_authentication, counted by entity_path. The second factor is asked after the password was accepted, so five or more such failures for one account within 10 minutes fit someone who holds the password and is trying codes. GitLab describes the same situation for its email notification about wrong verification codes. Both event types have the User scope. The reference does not say which field names the account, and the rule uses entity_path, the path of the entity the event belongs to. Validate it on your version. The count and the window are starting points to tune.

Fires when one entity_path has at least 5 matching events within 10 minutes.

Threshold ruleLevelHighStatusExperimentalLog sourceGitLab audit events
title: GitLab Second Factor Sign-In Failed (Second Factor Guessing Base Event)
id: 283e2707-5dae-4c39-93ba-0aba57849bd9
name: gitlab_second_factor_sign_in_failed
status: experimental
description: >-
  Base event of the threshold rule in this file. A sign-in that failed
  because of an incorrect one-time password
  (login_failed_with_otp_authentication) or a failure with a WebAuthn
  device (login_failed_with_webauthn_authentication).
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - login_failed_with_otp_authentication
      - login_failed_with_webauthn_authentication
  condition: selection
level: low
---
title: Many Failed Second Factor Sign-Ins for One GitLab Account
id: 0491aa96-b815-496e-bbbd-5167308af6ff
status: experimental
description: >-
  Counts sign-ins that failed at the second factor per account: the audit
  event types login_failed_with_otp_authentication and
  login_failed_with_webauthn_authentication, counted by entity_path. The
  second factor is asked after the password was accepted, so five or more
  such failures for one account within 10 minutes fit someone who holds
  the password and is trying codes. GitLab describes the same situation
  for its email notification about wrong verification codes. Both event
  types have the User scope. The reference does not say which field names
  the account, and the rule uses entity_path, the path of the entity the
  event belongs to. Validate it on your version. The count and the window
  are starting points to tune.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/compliance/audit_event_schema/
  - https://docs.gitlab.com/user/profile/notifications/
  - https://attack.mitre.org/techniques/T1110/001/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1110.001
correlation:
  type: event_count
  rules:
    - gitlab_second_factor_sign_in_failed
  group-by:
    - entity_path
  timespan: 10m
  condition:
    gte: 5
falsepositives:
  - A user whose authenticator clock is wrong, or who uses a new phone that was not registered. The failures stop after the user is helped.
  - The values of 5 failures and 10 minutes are starting points, not tested limits. An instance with few users can alert on a lower count.
level: high

False positives

  • A user whose authenticator clock is wrong, or who uses a new phone that was not registered. The failures stop after the user is helped.
  • The values of 5 failures and 10 minutes are starting points, not tested limits. An instance with few users can alert on a lower count.

GitLab User Access Locked

Detects the audit event type user_access_locked, which GitLab writes when the access of a user to the instance is locked. GitLab locks an account after several failed authentication attempts: after 10 or more by default, and after three or more in 24 hours for accounts without two-factor authentication where account email verification is used. A lock therefore marks the point at which a series of wrong passwords or wrong codes reached the limit, and it needs no threshold. The reference lists the event without its fields. In the GitLab source the message of the event carries the reason for the lock, which is not part of a documented schema.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab User Access Locked
id: 1f77b0b6-c79e-40ff-be3a-a9be149a0ff0
status: experimental
description: >-
  Detects the audit event type user_access_locked, which GitLab writes
  when the access of a user to the instance is locked. GitLab locks an
  account after several failed authentication attempts: after 10 or more
  by default, and after three or more in 24 hours for accounts without
  two-factor authentication where account email verification is used. A
  lock therefore marks the point at which a series of wrong passwords or
  wrong codes reached the limit, and it needs no threshold. The reference
  lists the event without its fields. In the GitLab source the message of
  the event carries the reason for the lock, which is not part of a
  documented schema.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/security/unlock_user/
  - https://docs.gitlab.com/security/email_verification/
  - https://attack.mitre.org/techniques/T1110/001/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1110.001
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type: user_access_locked
  condition: selection
falsepositives:
  - Users who forgot a password and clients that keep trying an old one. Confirm with the user before the account is unlocked.
  - Instances with account email verification, where the lock limit for accounts without two-factor authentication is three failed attempts in 24 hours. Read the reason in the message of the event, and lower the level of this rule if it is too noisy.
level: medium

False positives

  • Users who forgot a password and clients that keep trying an old one. Confirm with the user before the account is unlocked.
  • Instances with account email verification, where the lock limit for accounts without two-factor authentication is three failed attempts in 24 hours. Read the reason in the message of the event, and lower the level of this rule if it is too noisy.

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.

Burst of failed sign-ins followed by a successful sign-in of the same account

Detection hypothesisSequence of events

Guessing that works ends with a sign-in. A series of failed sign-ins for one account that is followed by a successful sign-in of that account, above all from the address the failures came from, is the point at which an attempt turned into access.

  1. Count login_failed_with_standard_authentication and omniauth_login_failed events per account, the entity_path of events whose entity_type is User. Keep the accounts that reach your count, for a start 5 within 10 minutes.
  2. Look for a successful sign-in of the same account within the next 60 minutes: authenticated_with_password, authenticated_with_ldap, authenticated_with_two_factor or authenticated_with_webauthn.
  3. Compare the ip_address of the failures with the ip_address of the sign-in. The same address on both sides is the guessing pattern.
  4. Look for user_access_locked and user_access_unlocked for the account in between. An unlock in that gap means the attempts could go on.

Eventslogin_failed_with_standard_authenticationomniauth_login_failedauthenticated_with_passwordauthenticated_with_ldapuser_access_lockeduser_access_unlocked

LimitsA user who mistypes a password and then gets it right produces the same sequence, so the count and both time spans are starting points. The successful sign-in event types exist only from GitLab 17.11 and 18.3, and GitLab does not document per event type which field names the account, so confirm on one test sign-in that entity_path holds it in both kinds of event.

Triage

  • Read the account (entity_path) and the source address (ip_address) of the failures, and count the failures for that account and from that address over the last day.
  • Regular failures at fixed intervals point to a script or integration with an old password. A burst from an address the user never used points to guessing.
  • Look for a successful sign-in of the same account after the failures. From GitLab 18.3 these are the event types authenticated_with_password, authenticated_with_two_factor and authenticated_with_webauthn, and from GitLab 17.11 authenticated_with_ldap and authenticated_with_oauth.
  • For failures of the second factor, treat the password as known to someone else and ask the user whether the attempts were theirs.
  • For a locked account, read the message of the event for the reason, and check whether and by whom the account was unlocked again (user_access_unlocked).
  • Give priority to administrators, group Owners and accounts that maintain deploying projects.

Response

Once the attack is confirmed:

  1. Block the source address of the attempts at the network edge or the reverse proxy in front of GitLab.
  2. If a sign-in followed the failures, treat the account as compromised. Block it, reset its password and second factor, and end its sessions before it is unblocked.
  3. Revoke the access tokens and delete the SSH keys that were added to the account after that sign-in, and review what the account changed.
  4. Reset the password of an account that saw wrong second factors even when no sign-in succeeded, because the first factor was correct.
  5. Unlock accounts only after their owners have confirmed which failures were their own, and watch the targeted accounts for new attempts.

Mitigation

  • Enforce two-factor authentication for all users, or sign in through an identity provider and disable password authentication for the web interface in the sign-in restrictions.
  • Keep the lock limits low. On GitLab Self-Managed and GitLab Dedicated they are the max_login_attempts and failed_login_attempts_unlock_period_in_minutes application settings.
  • Turn on account email verification on GitLab Self-Managed and GitLab Dedicated, so that a locked account needs a code sent to its email address.
  • Deactivate accounts that are no longer used, so that fewer names can be tried.
  • Stream audit events to your SIEM and alert on bursts of failed sign-ins and on locked accounts.

Frequently asked questions

Why does the threshold start at five failures?

GitLab locks an account after 10 or more failed attempts on instances without account email verification, and after three or more failed attempts in 24 hours for accounts without two-factor authentication where email verification is used. A count above your lock limit may never be reached, so five failures in 10 minutes is a starting point. Set it at or below the limit that applies to your instance.

Why are wrong second factors rated higher than wrong passwords?

The second factor is asked only after the first one was accepted. GitLab says the same about its own email notification for wrong verification codes, which can show that a bad actor has the user name and password and is trying to brute force two-factor authentication. People do mistype codes, so the rule counts several failures for one account before it fires.

Do these rules see password spraying across many accounts?

One of them does. The two per-account threshold rules count failures for one account, and spraying is one source that fails once or twice for many accounts, which stays below them. A third threshold rule counts the accounts with a failed sign-in per source address, the `ip_address` field that the audit event schema describes as the IP address of the host used to trigger the event. It counts existing accounts only, and behind a proxy that hides client addresses all failures share one address.

Are failed sign-ins with user names that do not exist counted?

Not by the per-account rule. The event types for standard and OmniAuth failures have the User and Instance scopes, and the rule keeps only events whose `entity_type` is User. In the GitLab source a failure for a name that matches no account is written on the instance scope with an unauthenticated author. That behaviour is not part of the documented schema, so check it with a test sign-in.

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.