How the attack works
A GitLab runner is the machine that executes CI/CD jobs. An instance runner serves every project on the instance and is created by an administrator, a group runner serves every project and subgroup of a group and needs the Owner role on the group, and a project runner needs the Maintainer role on the project. When a runner is created it receives a runner authentication token, which it uses to authenticate with GitLab when it picks up jobs from the queue. The older workflow with runner registration tokens is deprecated, but it can still be enabled in the top-level group settings on GitLab.com and in the Admin area on GitLab Self-Managed, where the runner registration settings also decide whether members of projects and groups can create runners.
GitLab's own security guidance says that the runner executes the code defined in the job and that secret variables exposed to jobs in a compromised environment can be stolen, including the CI_JOB_TOKEN. An attacker who holds one of the roles above therefore does not need to read a variable: a runner they operate receives the jobs, the source code and the variables of every project it serves. A project runner can also be enabled for other projects by someone with the Maintainer role on both, unless it is locked, and a change to its tags decides which jobs it picks up. GitLab records these steps as ci_runner_registered, ci_runner_created, ci_runner_assigned_to_project, set_runner_associated_projects, ci_runner_token_reset and ci_runner_tags_updated, and changes to the registration settings as allow_runner_registration_token_updated and runner_registration_enabled_updated.
What an attacker needs
- Administrator access for an instance runner, the Owner role on a group for a group runner, or the Maintainer role on a project for a project runner.
- A machine the attacker controls that can reach the GitLab instance, or a runner registration token where the legacy workflow is still allowed.
- Log collection: audit event streaming (Ultimate) for the top-level group or the instance, to an HTTP destination, received as JSON. Events for instance runners have the Instance scope and need the instance stream.
Impact
Every job that is routed to the runner hands it the project's source code, the CI/CD variables of the job and its job token. A group runner receives the jobs of every project below the group and an instance runner the jobs of the whole instance. A runner that is not marked as protected can also be given jobs from unprotected branches, and a runner that is assigned to a deploying project can receive the deployment credentials of that project.
Detection rules
GitLab Runner Assigned to a Project
Detects an existing runner being assigned to a project (ci_runner_assigned_to_project) and the list of projects of a runner being set (set_runner_associated_projects). A project runner can be enabled for other projects by a user with the Maintainer or Owner role on both projects unless the runner is locked, and an administrator can enable it for several projects at once. From then on the runner also receives the jobs of the new project together with their variables. No new runner is registered in this case, so the registration rule on this page stays silent. The rule matches on the event type, and the project is in entity_path.
title: GitLab Runner Assigned to a Project
id: 81d501f2-cba4-401e-ae01-db59940e2a0d
status: experimental
description: >-
Detects an existing runner being assigned to a project
(ci_runner_assigned_to_project) and the list of projects of a runner
being set (set_runner_associated_projects). A project runner can be
enabled for other projects by a user with the Maintainer or Owner role on
both projects unless the runner is locked, and an administrator can
enable it for several projects at once. From then on the runner also
receives the jobs of the new project together with their variables. No
new runner is registered in this case, so the registration rule on this
page stays silent. The rule matches on the event type, and the project
is in entity_path.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/ci/runners/runners_scope/
- https://attack.mitre.org/techniques/T1677/
author: Forestall
date: 2026-11-18
tags:
- attack.execution
- attack.t1677
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- ci_runner_assigned_to_project
- set_runner_associated_projects
condition: selection
falsepositives:
- Platform teams that share one project runner between related projects. Confirm the assignment with the owner of the runner, and keep the rule for projects that deploy to production.
level: medium
False positives
- Platform teams that share one project runner between related projects. Confirm the assignment with the owner of the runner, and keep the rule for projects that deploy to production.
GitLab Runner Registered or Created
Detects an instance, group or project runner being registered (ci_runner_registered) or created (ci_runner_created, GitLab 17.8 and later). A runner executes the CI/CD jobs routed to it and receives their source code, variables and job token, so a runner operated by an attacker collects the secrets of every project it serves. The event type reference lists both events without their fields, so the rule matches on the event type. The scope of the runner follows from entity_type and entity_path, and events for instance runners need the instance audit event stream.
title: GitLab Runner Registered or Created
id: 0c3c0fed-dc2c-4f0b-b99b-325656b47bd0
status: experimental
description: >-
Detects an instance, group or project runner being registered
(ci_runner_registered) or created (ci_runner_created, GitLab 17.8 and
later). A runner executes the CI/CD jobs routed to it and receives their
source code, variables and job token, so a runner operated by an attacker
collects the secrets of every project it serves. The event type reference
lists both events without their fields, so the rule matches on the event
type. The scope of the runner follows from entity_type and entity_path,
and events for instance runners need the instance audit event stream.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/ci/runners/runners_scope/
- https://docs.gitlab.com/runner/security/
- https://attack.mitre.org/techniques/T1677/
author: Forestall
date: 2026-11-18
tags:
- attack.execution
- attack.t1677
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- ci_runner_registered
- ci_runner_created
condition: selection
falsepositives:
- Autoscaling and provisioning systems that create or register runners all day. Exclude the account they use by author_id, and alert on every other account.
- Teams that add a project runner for their own project. Confirm the machine with the team, and look more closely at group and instance runners.
level: medium
False positives
- Autoscaling and provisioning systems that create or register runners all day. Exclude the account they use by author_id, and alert on every other account.
- Teams that add a project runner for their own project. Confirm the machine with the team, and look more closely at group and instance runners.
GitLab Runner Registration Setting Changed
Detects a change to two settings that control who can add runners. The first lets members of projects and groups create runners with runner registration tokens (allow_runner_registration_token_updated), which is the legacy workflow that GitLab no longer recommends. The second is the runner registration setting of a group (runner_registration_enabled_updated, GitLab 17.4 and later). Switching either one on widens the set of accounts that can attach a runner to the projects of the group. The event type reference does not document the field that holds the old and the new value, so the rule matches on the event type and fires in both directions.
title: GitLab Runner Registration Setting Changed
id: dfd36853-2dde-4fd5-a29d-8efcbe1dfb87
status: experimental
description: >-
Detects a change to two settings that control who can add runners. The
first lets members of projects and groups create runners with runner
registration tokens (allow_runner_registration_token_updated), which is
the legacy workflow that GitLab no longer recommends. The second is the
runner registration setting of a group
(runner_registration_enabled_updated, GitLab 17.4 and later). Switching
either one on widens the set of accounts that can attach a runner to the
projects of the group. The event type reference does not document the
field that holds 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/ci/runners/new_creation_workflow/
- https://docs.gitlab.com/administration/settings/continuous_integration/
- https://attack.mitre.org/techniques/T1677/
author: Forestall
date: 2026-11-18
tags:
- attack.execution
- attack.t1677
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- allow_runner_registration_token_updated
- runner_registration_enabled_updated
condition: selection
falsepositives:
- A group Owner who switches registration off writes the same events. Read the details of the event, or the CI/CD settings of the group, for the value now in force.
- Teams that still use the legacy registration workflow, for example with runners that register on every job. The setting should match a known exception.
level: low
False positives
- A group Owner who switches registration off writes the same events. Read the details of the event, or the CI/CD settings of the group, for the value now in force.
- Teams that still use the legacy registration workflow, for example with runners that register on every job. The setting should match a known exception.
GitLab Runner Token Reset or Runner Tags Updated
Detects the token of a runner being reset (ci_runner_token_reset) and the tags of a runner being updated (ci_runner_tags_updated, GitLab 19.6 and later). GitLab states that whoever holds a runner authentication token can clone the runner, so a reset by an unexpected account can hand a fresh token to someone else. Tags decide which jobs a runner picks up, because a job goes to a runner that has all of the tags the job asks for. A runner that is given the tags of a deployment runner starts to receive deployment jobs. Both events are routine maintenance in most cases, and the reference lists them without their fields, so this is a low-level signal for correlation with the other rules on this page.
title: GitLab Runner Token Reset or Runner Tags Updated
id: deb0812c-1535-4147-b1af-fdfc19e24e69
status: experimental
description: >-
Detects the token of a runner being reset (ci_runner_token_reset) and the
tags of a runner being updated (ci_runner_tags_updated, GitLab 19.6 and
later). GitLab states that whoever holds a runner authentication token
can clone the runner, so a reset by an unexpected account can hand a
fresh token to someone else. Tags decide which jobs a runner picks up,
because a job goes to a runner that has all of the tags the job asks
for. A runner that is given the tags of a deployment runner starts to
receive deployment jobs. Both events are routine maintenance in most
cases, and the reference lists them without their fields, so this is a
low-level signal for correlation with the other rules on this page.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/ci/runners/configure_runners/
- https://docs.gitlab.com/security/tokens/
- https://attack.mitre.org/techniques/T1677/
author: Forestall
date: 2026-11-18
tags:
- attack.execution
- attack.t1677
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- ci_runner_token_reset
- ci_runner_tags_updated
condition: selection
falsepositives:
- Scheduled rotation of runner authentication tokens and operators who retag runners. Exclude the provisioning account by author_id and confirm changes by other accounts with the owner of the runner.
level: low
False positives
- Scheduled rotation of runner authentication tokens and operators who retag runners. Exclude the provisioning account by author_id and confirm changes by other accounts with the owner of the runner.
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.
Runner registered soon after runner registration was reopened
Runner creation by members and the legacy registration token can be switched off for a group or project. An account that switches one of them back on and registers a runner shortly after has prepared the ground for a runner of its own, which is far more telling than either event alone.
- A registration setting changes: the audit event type
allow_runner_registration_token_updatedorrunner_registration_enabled_updated. Keepentity_path,author_idand the time. - Within the next 24 hours a runner is registered or created:
ci_runner_registeredorci_runner_created, with anentity_paththat is the same group or project or lies below that group. - Alert when both exist, and raise the priority when the
author_idof the two events is the same account.
Eventsallow_runner_registration_token_updatedrunner_registration_enabled_updatedci_runner_registeredci_runner_created
LimitsA team that enables registration on purpose to add its own runner produces the same sequence, so confirm the change with the group Owner. The setting events are written in both directions and the reference does not document the field that holds the new value. The 24 hours are a starting point.
Triage
- Identify who made the change (
author_name,author_id,ip_address) and where (entity_pathandentity_type, which tell a project runner from a group or instance runner). - Read
target_detailsand thedetailsobject for the runner, then open the runner in the Runners page of the project, group or Admin area and note its description, tags, owner and the address of the machine that last contacted GitLab. - Confirm the machine with the team that operates your runners. A runner on an address outside your build network needs an explanation.
- For an assignment, check which projects the runner serves now and whether any of them deploys or holds protected variables.
- For a registration setting, read the value now in force in the CI/CD settings of the group or the Admin area, because the events are written in both directions.
- Review what else the same account did in the period, such as changed CI/CD variables, new access tokens or weakened protected branches.
Response
Once the attack is confirmed:
- Pause or delete the runner so that no further job is routed to it, and remove it from the projects it was assigned to.
- List the jobs the runner executed and rotate everything those jobs could read, starting with deployment credentials stored in CI/CD variables.
- Reset the runner authentication token of any legitimate runner whose token may have been copied, because a copied token lets another machine act as that runner.
- Turn the registration settings back to their approved values, and reset the runner registration token of the project if the legacy workflow was enabled.
- Take the role from the account that made the change until it is explained, reset its credentials and revoke its tokens.
- Compare the remaining runners of the group or instance with your provisioning records.
Mitigation
- Clear the runner registration settings that let project and group members create runners where teams do not need their own, and keep the legacy runner registration token turned off.
- Mark runners that deploy as protected, so that they only run jobs on protected branches and tags, and lock project runners to their current projects.
- Use tags on purpose and do not let sensitive runners run untagged jobs, so that a new runner with no tags does not pick up jobs meant for a trusted one.
- Create runners from one provisioning identity, so that a runner created by any other account stands out.
- Rotate runner authentication tokens on a schedule and store
config.tomlwhere only the runner service can read it.
Frequently asked questions
What can a runner see of the jobs it executes?
GitLab's runner security guidance states that the runner executes the code defined in the CI/CD job and that secret variables exposed to jobs in a compromised environment can be stolen, including the `CI_JOB_TOKEN`. A person who operates the runner machine can therefore read the source code and the variables of every job routed to it.
Which role is needed to add a runner?
An instance runner needs administrator access, a group runner the Owner role on the group and a project runner the Maintainer role on the project. On GitLab Self-Managed the runner registration settings of the Admin area allow registration tokens and runner creation by project and group members by default. Enabling an existing project runner for another project needs the Maintainer or Owner role on both projects, and the runner must not be locked.
Do the registration setting events say whether registration was opened or closed?
The event type reference lists `allow_runner_registration_token_updated` and `runner_registration_enabled_updated` without their fields, so the rule matches both directions. Read the `details` object of the event or the setting itself to see the value now in force. Turning registration off is a hardening step and needs no action.
Has this been used against GitLab instances in a public incident?
No public incident report describes a rogue GitLab runner at the audit event level. The page is built on what GitLab documents about runners, namely that a runner executes the code of the job and that the secret variables of jobs in a compromised environment can be stolen. Treat the rules as coverage for a documented capability, not as a signature of a known campaign.
References
- MITRE ATT&CK T1677: Poisoned Pipeline Execution
- GitLab Docs: Audit event types
- GitLab Docs: Audit event schema and examples
- GitLab Docs: Manage runners
- GitLab Docs: Security for self-managed runners
- GitLab Docs: Configuring runners
- GitLab Docs: Migrating to the new runner registration workflow
- GitLab Docs: CI/CD settings (control runner registration)
- GitLab Docs: GitLab token overview (runner authentication tokens)