1. Resources
  2. Detection rules
  3. User Created, Approved or Unblocked in GitLab

User Created, Approved or Unblocked in GitLab detection rules

A new user or service account is created in GitLab, or an account that could not sign in is approved, unblocked, unbanned or reactivated. Either way the attacker gains a working account next to the one they first used.

Platform
GitLab
Severity
Medium
Log source
GitLab audit events
Last updated
Rule formats
Sigmaand queries for: Splunk
What an attacker needs
Administrator access to create, approve or unblock users, or the Owner role on a top-level group for a service account on GitLab.com.
Impact
The attacker holds a second working account that survives the recovery of the first one, or brings back an account that was blocked on purpose.
Response
Block or delete the account, revoke its tokens and SSH keys, and treat the administrator or Owner that acted as compromised.
Mitigation
Create users through one provisioning path, require approval for new accounts, and keep administrators few and on dedicated accounts.
Audit events
service_account_createduser_approvedunblock_userunban_useruser_createduser_activateuser_access_unlocked

How the attack works

An attacker who controls an administrator, or an Owner of a top-level group, does not want to depend on that one account. The simplest second way in is another account. On GitLab Self-Managed and GitLab Dedicated an administrator can create a user, approve an account that is pending approval, and unblock, unban or reactivate an account. GitLab describes a blocked user as one who cannot sign in or access any repositories while the data is retained, and a user pending approval as functionally identical to a blocked user. Unblocking, unbanning or approving sets the state back to active. An account that was blocked when its owner left, or blocked by defenders during an incident, therefore returns with one action.

Service accounts are a second kind of new account. They represent non-human entities, authenticate with a personal access token and cannot sign in through the UI. On GitLab.com the Owner of a top-level group can create them, and on GitLab Self-Managed and GitLab Dedicated only administrators can by default. GitLab records the steps as user_created, service_account_created (GitLab 19.5 and later), user_approved, unblock_user, unban_user, user_activate and user_access_unlocked. A new account has little access until it is added to groups or projects, so these events are the start of a trail and not the end of it.

What an attacker needs

  • Administrator access on GitLab Self-Managed or GitLab Dedicated to create users by hand and to approve, unblock, unban or reactivate them, or an administrator's token for the users API.
  • For a service account, the Owner role on a top-level group on GitLab.com, or administrator access on the other offerings unless the instance lets top-level group Owners create them.
  • Log collection: audit event streaming for the instance (Ultimate, GitLab Self-Managed and GitLab Dedicated) to an HTTP destination, received as JSON. The user events have the User scope. service_account_created also has the Group and Project scopes.

Impact

The attacker holds an account that survives the recovery of the first one. A new user can be given roles, tokens and SSH keys, and a service account keeps working through its personal access token without a person behind it. A returned account comes back with the data that GitLab retained for it and is already known in the instance. The step also undoes containment when the account had been blocked on purpose.

Detection rules

GitLab Service Account Created

Detects the audit event type service_account_created (GitLab 19.5 and later), which GitLab writes when a service account is created. A service account represents a non-human entity, authenticates with a personal access token and cannot sign in through the UI. It can be created for the instance, for a group or for a project, and on GitLab.com the Owner of a top-level group can create one. An attacker with that role gains an account whose token keeps working without a person behind it. The event type has the User, Group and Project scopes and the reference lists it without its fields, so the rule matches on the event type. Follow up with the tokens created for the account and the groups and projects it is added to.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab Service Account Created
id: de12fb2b-34a8-4668-a00c-4b780f4c561a
status: experimental
description: >-
  Detects the audit event type service_account_created (GitLab 19.5 and
  later), which GitLab writes when a service account is created. A
  service account represents a non-human entity, authenticates with a
  personal access token and cannot sign in through the UI. It can be
  created for the instance, for a group or for a project, and on
  GitLab.com the Owner of a top-level group can create one. An attacker
  with that role gains an account whose token keeps working without a
  person behind it. The event type has the User, Group and Project
  scopes and the reference lists it without its fields, so the rule
  matches on the event type. Follow up with the tokens created for the
  account and the groups and projects it is added to.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/profile/service_accounts/
  - https://attack.mitre.org/techniques/T1136/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.t1136.003
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type: service_account_created
  condition: selection
falsepositives:
  - Platform teams that create service accounts for pipelines and integrations. Confirm the owner and the purpose, and record them.
  - GitLab features that provision service accounts on their own, such as the GitLab Duo Agent Platform, if they write this event on your version.
level: low

False positives

  • Platform teams that create service accounts for pipelines and integrations. Confirm the owner and the purpose, and record them.
  • GitLab features that provision service accounts on their own, such as the GitLab Duo Agent Platform, if they write this event on your version.

GitLab User Approved, Unblocked or Unbanned

Detects an account that could not sign in being made active by an administrator: user_approved (a user is approved for an instance), unblock_user and unban_user. GitLab describes a blocked or banned user as one who cannot sign in or access any repositories, and a user pending approval as functionally identical to a blocked user. Each of these actions sets the state back to active. An attacker with administrator access uses them to bring back an account that was blocked when its owner left or during an incident, or to let in an account that registered and waited for approval. The reference describes unblock_user with the words "A user is banned", which contradicts its name. In the GitLab source the event is written when a user is unblocked. The rule matches on the event types.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab User Approved, Unblocked or Unbanned
id: fa8c9888-b5aa-489d-8f5c-b19f443b082a
status: experimental
description: >-
  Detects an account that could not sign in being made active by an
  administrator: user_approved (a user is approved for an instance),
  unblock_user and unban_user. GitLab describes a blocked or banned user
  as one who cannot sign in or access any repositories, and a user
  pending approval as functionally identical to a blocked user. Each of
  these actions sets the state back to active. An attacker with
  administrator access uses them to bring back an account that was
  blocked when its owner left or during an incident, or to let in an
  account that registered and waited for approval. The reference
  describes unblock_user with the words "A user is banned", which
  contradicts its name. In the GitLab source the event is written when a
  user is unblocked. The rule matches on the event types.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/administration/moderate_users/
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.t1098
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - user_approved
      - unblock_user
      - unban_user
  condition: selection
falsepositives:
  - Administrators who approve new colleagues on an instance that requires approval for new accounts. Expect these at the pace of onboarding.
  - People who return from leave, and accounts that were blocked by mistake. Confirm with the administrator who acted.
  - Turning off the approval requirement or removing the user cap. GitLab then approves the users in pending approval state automatically, which may write many events at once.
level: medium

False positives

  • Administrators who approve new colleagues on an instance that requires approval for new accounts. Expect these at the pace of onboarding.
  • People who return from leave, and accounts that were blocked by mistake. Confirm with the administrator who acted.
  • Turning off the approval requirement or removing the user cap. GitLab then approves the users in pending approval state automatically, which may write many events at once.

GitLab User Created

Detects the audit event type user_created, which GitLab writes when a user is created. A new user is a second way into the instance for whoever created it, and it has little access until it is added to groups and projects, so the event is the first step of a trail. Users are also created every day by provisioning and, where it is open, by sign-up, which makes this a low-level signal. The event type reference lists the event without its fields, so the rule matches on the event type. Read the acting account in author_id and the new user in the entity and target fields.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab User Created
id: 9df0a70e-95ee-4712-82d5-e705252d9264
status: experimental
description: >-
  Detects the audit event type user_created, which GitLab writes when a
  user is created. A new user is a second way into the instance for
  whoever created it, and it has little access until it is added to
  groups and projects, so the event is the first step of a trail. Users
  are also created every day by provisioning and, where it is open, by
  sign-up, which makes this a low-level signal. The event type reference
  lists the event without its fields, so the rule matches on the event
  type. Read the acting account in author_id and the new user in the
  entity and target fields.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/administration/moderate_users/
  - https://attack.mitre.org/techniques/T1136/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.t1136.003
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type: user_created
  condition: selection
falsepositives:
  - Provisioning from the identity provider and onboarding by administrators. Exclude the provisioning account by author_id once confirmed, so that users created by hand remain.
  - Instances with open sign-up, if a registration writes this event on your version. Test one registration.
level: low

False positives

  • Provisioning from the identity provider and onboarding by administrators. Exclude the provisioning account by author_id once confirmed, so that users created by hand remain.
  • Instances with open sign-up, if a registration writes this event on your version. Test one registration.

GitLab User Reactivated or Access Unlocked

Detects user_activate (a user is activated) and user_access_unlocked (user access to the instance is unlocked). A deactivated user is a dormant account that an administrator or the API can reactivate. GitLab also reactivates such a user automatically when the user signs in, so the event shows that a dormant account is in use again. An unlocked account is one that GitLab had locked after several failed authentication attempts. An administrator can unlock it before the end of the unlock period, which lets the attempts go on. Both happen in normal operation, which makes this a low-level signal for review next to the other rules of the page. The event type reference lists both events without their fields, so the rule matches on the event types.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab User Reactivated or Access Unlocked
id: c401acf2-5b53-4e8c-8a51-e8728260e6b3
status: experimental
description: >-
  Detects user_activate (a user is activated) and user_access_unlocked
  (user access to the instance is unlocked). A deactivated user is a
  dormant account that an administrator or the API can reactivate.
  GitLab also reactivates such a user automatically when the user signs
  in, so the event shows that a dormant account is in use again. An
  unlocked account is one that GitLab had locked after several failed
  authentication attempts. An administrator can unlock it before the end
  of the unlock period, which lets the attempts go on. Both happen in
  normal operation, which makes this a low-level signal for review next
  to the other rules of the page. The event type reference lists both
  events without their fields, so the rule matches on the event types.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/administration/moderate_users/
  - https://docs.gitlab.com/security/unlock_user/
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.t1098
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - user_activate
      - user_access_unlocked
  condition: selection
falsepositives:
  - Users who come back after a period without activity and sign in. GitLab reactivates them automatically.
  - Users who locked themselves out with a forgotten password. GitLab unlocks such an account after the unlock period, after a password reset or an email verification, or when an administrator unlocks it by hand.
level: low

False positives

  • Users who come back after a period without activity and sign in. GitLab reactivates them automatically.
  • Users who locked themselves out with a forgotten password. GitLab unlocks such an account after the unlock period, after a password reset or an email verification, or when an administrator unlocks it by hand.

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.

Account that was blocked or banned is active again

Detection hypothesisSequence of eventsNeeds your own lists

An account is blocked for a reason: its owner left, or defenders contained it. When the same account is unblocked or unbanned later, either the reason is gone or someone is undoing the block. Pairing the two events shows which accounts came back and who brought them.

  1. An account is blocked or banned: user_blocked or ban_user, and from GitLab 19.4 user_blocked_by_ldap_sync, user_blocked_by_saml_required_group or user_blocked_by_scim_deprovisioning. Keep the account (entity_path), the actor (author_id) and the time.
  2. Later the same entity_path appears in unblock_user or unban_user.
  3. Compare the account with your list of people who left and of accounts blocked during incidents, and the author_id of the second event with the administrators who manage users.
  4. Look for a sign-in of the account (authenticated_with_password, authenticated_with_ldap, authenticated_with_oauth) and for personal_access_token_created in the following days.

Eventsuser_blockedban_useruser_blocked_by_scim_deprovisioningunblock_userunban_userpersonal_access_token_created

LimitsGitLab does not document per event type which field names the account, so confirm on a test user that entity_path holds it in both events. People who return from a long leave are unblocked for good reasons, and GitLab describes ban_user as covering bans, unbans, blocks and unblocks.

Triage

  • Identify who acted (author_name, author_id, ip_address) and which account the event is about (entity_path, target_details).
  • For a new user, check its email address, whether it is external or an administrator, and whether your provisioning created it. An account created by a person outside the usual path needs a reason.
  • For an approved, unblocked or unbanned account, find out why it could not sign in. Look for the earlier user_blocked or ban_user event, who wrote it, and whether the owner left the organization.
  • For a new service account, find where it was added as a member and which tokens were created for it.
  • Review what the account did since. Sign-ins (authenticated_with_password and the other authenticated_with_ event types), personal_access_token_created, add_ssh_key, member_created and user_admin_status_updated.

Response

Once the attack is confirmed:

  1. Block the account again, or delete a new account that nobody can explain.
  2. Revoke the personal access tokens and delete the SSH keys of the account, and remove it from the groups and projects it was added to.
  3. Treat the administrator or Owner account that acted as compromised. Reset its password and second factor, end its sessions and revoke its tokens.
  4. Review what the account read and changed while it was active, and rotate the secrets it could reach.
  5. List the other accounts that the same actor created, approved or unblocked in the period, and check each one.

Mitigation

  • Create users through one path, for example provisioning from the identity provider, so that a user created by hand stands out.
  • Disable new user accounts or require administrator approval for them in the new user account restrictions, and block auto-created users for OmniAuth and LDAP where approval is wanted.
  • Keep the number of administrators small, give them dedicated accounts with two-factor authentication, and turn on Admin Mode.
  • Leave the creation of service accounts to administrators on GitLab Self-Managed and GitLab Dedicated, and record an owner for each one.
  • Stream instance audit events to your SIEM, alert on approved, unblocked and unbanned accounts, and review new users and service accounts.

Frequently asked questions

Why would an attacker unblock an old account instead of creating a new one?

GitLab says that blocking is the choice when you do not want a user to access the instance but want to retain their data, and that unblocking sets the state back to active. A returned account is already known in the instance, while a new user has little access until someone adds it to groups and projects. The page does not claim that attackers prefer one over the other. Both leave the events these rules read.

Can a deactivated GitLab user come back without an administrator?

Yes. GitLab documents that a deactivated user can sign in and is then automatically reactivated, and that deactivation is meant for users without recent activity. That is why `user_activate` is only a low-level signal here. A blocked or banned user cannot sign in at all, so `unblock_user` and `unban_user` need an administrator and are rated higher.

Does the rule for new users fire on every sign-up?

GitLab describes `user_created` as a user is created and has a separate event type, `registration_created`, for a user who registers for instance access. The reference does not say whether a sign-up writes both. On an instance with open sign-up, test one registration and exclude what your provisioning and your sign-up page produce.

Do these events exist for a group on GitLab.com?

The moderation actions on this page belong to instance administrators of GitLab Self-Managed and GitLab Dedicated, and their event types have the User scope. `service_account_created` also has the Group and Project scopes, and on GitLab.com only top-level group Owners can create service accounts. For a GitLab.com group the service account rule is therefore the one to expect.

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.