How the attack works
GitLab has two controls that inspect a push before it is accepted. Secret push protection (Ultimate) runs in the pre-receive hook, checks the pushed changes for keys and tokens and blocks the push when it finds one. Push rules (Premium and Ultimate) are pre-receive checks that a project can enable, among them a rule that prevents pushing secret files, a rule that rejects unsigned commits and rules that verify the committer. Both are configured by the people who work in the project: secret push protection and its exclusions by the Security Manager, Maintainer or Owner role, and push rules in the repository settings of the project.
Each way of weakening them leaves its own audit event type. Secret push protection is switched for a group with group_secret_push_protection_updated, and a change to a project's security settings is project_security_setting_updated. An exclusion for a path, a value or a detection rule is project_security_exclusion_created. A user who tells GitLab to skip the check for one push produces skip_secret_push_protection. Changes to the push rules are written per rule, for example project_push_rules_prevent_secrets_updated and project_push_rules_reject_unsigned_commits_updated. From GitLab 19.3 there are also events for pushes that were accepted without a scan, because the push was too large or the scan timed out.
What an attacker needs
- The Security Manager, Maintainer or Owner role on the project for secret push protection and its exclusions, and the right to change the repository settings for push rules.
- For a skipped check, only the right to push to the project.
- Log collection: audit event streaming (Ultimate) for the top-level group or the instance, to an HTTP destination, received as JSON.
Impact
Credentials reach the repository and stay in its history, where every person and token with read access can find them. Without the rule for signed commits or verified committers, commits can also be pushed under another person's name. For an attacker who already has write access, a disabled check removes the control that would have blocked a planted credential or flagged a commit, and for the defender it removes the signal.
Detection rules
GitLab Push Accepted Without a Secret Push Protection Scan
Detects three audit event types that GitLab writes from version 19.3 when secret push protection lets a push through without scanning it: the push contains too many changed paths (spp_too_many_changed_paths), the push contains too many changed lines (spp_too_many_lines), or the scan timed out and the push was accepted (spp_scan_timeout). GitLab skips the scan when a push changes more than 3,150 paths or 350,000 lines, to prevent push timeouts. A very large push is therefore a way to carry a credential past the check with no setting changed. Large merges and imports do the same by accident, so this is a low-level signal. The reference lists the events without their fields.
title: GitLab Push Accepted Without a Secret Push Protection Scan
id: b2736d8f-c140-4cbf-893a-f815e2a61624
status: experimental
description: >-
Detects three audit event types that GitLab writes from version 19.3
when secret push protection lets a push through without scanning it:
the push contains too many changed paths (spp_too_many_changed_paths),
the push contains too many changed lines (spp_too_many_lines), or the
scan timed out and the push was accepted (spp_scan_timeout). GitLab
skips the scan when a push changes more than 3,150 paths or 350,000
lines, to prevent push timeouts. A very large push is therefore a way
to carry a credential past the check with no setting changed. Large
merges and imports do the same by accident, so this is a low-level
signal. The reference lists the events without their fields.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/application_security/secret_detection/secret_push_protection/
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- spp_too_many_changed_paths
- spp_too_many_lines
- spp_scan_timeout
condition: selection
falsepositives:
- Imports, vendored dependencies, generated code and merges of long-lived branches, which exceed the limits without any intent. Run pipeline secret detection on those commits instead of alerting on each event.
level: low
False positives
- Imports, vendored dependencies, generated code and merges of long-lived branches, which exceed the limits without any intent. Run pipeline secret detection on those commits instead of alerting on each event.
GitLab Push Rule for Secrets or Commit Verification Changed
Detects a change to four push rules of a project or a group: prevent pushing secret files (push_rules_prevent_secrets), reject unsigned commits (push_rules_reject_unsigned_commits), reject unverified users (push_rules_commit_committer_check) and the check that the commit author is a GitLab user (push_rules_reject_member_check). Each exists as a project_ and a group_ event type. The group types date from GitLab 15.0. Of the project types, the committer check exists from 16.5 and the others from 18.6, so older instances report group changes only. Push rules work as templates: a group rule is copied to projects created later, and a project rule takes effect in that project at once. The event type reference lists these events without their fields, so the rule fires in both directions.
title: GitLab Push Rule for Secrets or Commit Verification Changed
id: 0306fdae-b071-48f2-8ff6-aa8c08fe6f23
status: experimental
description: >-
Detects a change to four push rules of a project or a group: prevent
pushing secret files (push_rules_prevent_secrets), reject unsigned
commits (push_rules_reject_unsigned_commits), reject unverified users
(push_rules_commit_committer_check) and the check that the commit author
is a GitLab user (push_rules_reject_member_check). Each exists as a
project_ and a group_ event type. The group types date from GitLab 15.0.
Of the project types, the committer check exists from 16.5 and the
others from 18.6, so older instances report group changes only. Push
rules work as templates: a group rule is copied to projects created
later, and a project rule takes effect in that project at once. The
event type reference lists these events without their fields, so the
rule fires in both directions.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/project/repository/push_rules/
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- project_push_rules_prevent_secrets_updated
- project_push_rules_reject_unsigned_commits_updated
- project_push_rules_commit_committer_check_updated
- project_push_rules_reject_member_check_updated
- group_push_rules_prevent_secrets_updated
- group_push_rules_reject_unsigned_commits_updated
- group_push_rules_commit_committer_check_updated
- group_push_rules_reject_member_check_updated
condition: selection
falsepositives:
- Maintainers who switch a rule on write the same events. Read the details of the event, or the Push rules section of the repository settings, for the value now in force.
- Projects that relax the signed commit rule for a bot or a migration. The change should be temporary and match a ticket.
level: low
False positives
- Maintainers who switch a rule on write the same events. Read the details of the event, or the Push rules section of the repository settings, for the value now in force.
- Projects that relax the signed commit rule for a bot or a migration. The change should be temporary and match a ticket.
GitLab Secret Detection Exclusion Created or Updated
Detects a project security exclusion being created (project_security_exclusion_created) or updated (project_security_exclusion_updated), both from GitLab 17.5. An exclusion tells secret push protection to ignore a path, a raw value or a rule of the default ruleset in one project. It is meant for false positives, and the Security Manager, Maintainer or Owner role can add one. A path exclusion that covers most of a repository, or an excluded rule for a common token type, has the effect of switching the protection off while the toggle stays on. The event type reference lists the events without their fields, so read the exclusion in the secret detection configuration of the project.
title: GitLab Secret Detection Exclusion Created or Updated
id: 0a78d3ee-ab63-4b47-b74c-e7dd94f437b0
status: experimental
description: >-
Detects a project security exclusion being created
(project_security_exclusion_created) or updated
(project_security_exclusion_updated), both from GitLab 17.5. An
exclusion tells secret push protection to ignore a path, a raw value or
a rule of the default ruleset in one project. It is meant for false
positives, and the Security Manager, Maintainer or Owner role can add
one. A path exclusion that covers most of a repository, or an excluded
rule for a common token type, has the effect of switching the
protection off while the toggle stays on. The event type reference
lists the events without their fields, so read the exclusion in the
secret detection configuration of the project.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/application_security/secret_detection/exclusions/
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- project_security_exclusion_created
- project_security_exclusion_updated
condition: selection
falsepositives:
- Exclusions for test directories, documentation and third-party code, which GitLab itself recommends. Confirm that the path is narrow and that someone other than the author reviewed it.
level: medium
False positives
- Exclusions for test directories, documentation and third-party code, which GitLab itself recommends. Confirm that the path is narrow and that someone other than the author reviewed it.
GitLab Secret Push Protection Setting Changed
Detects secret push protection being enabled or disabled for a group and its child groups and projects (group_secret_push_protection_updated, GitLab 17.7 and later) and a project's security setting being updated (project_security_setting_updated, GitLab 17.0 and later). In the GitLab source the project toggle of secret push protection writes that event, with a message that says whether protection was enabled or disabled. The message is not part of a documented schema. Secret push protection blocks a push that contains keys or tokens, and the Security Manager, Maintainer or Owner role on a project can switch it off. The event type reference lists both events without their fields, so the rule fires when protection is switched on as well, and the project event may also be written for other security settings of a project.
title: GitLab Secret Push Protection Setting Changed
id: 6fe3ec28-7097-4cfc-b060-ebb172aa6405
status: experimental
description: >-
Detects secret push protection being enabled or disabled for a group and
its child groups and projects (group_secret_push_protection_updated,
GitLab 17.7 and later) and a project's security setting being updated
(project_security_setting_updated, GitLab 17.0 and later). In the GitLab
source the project toggle of secret push protection writes that event,
with a message that says whether protection was enabled or disabled.
The message is not part of a documented schema. Secret push protection
blocks a push that contains keys or tokens, and the Security Manager,
Maintainer or Owner role on a project can switch it off. The event type
reference lists both events without their fields, so the rule fires
when protection is switched on as well, and the project event may also
be written for other security settings of a project.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/application_security/secret_detection/secret_push_protection/
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: gitlab
service: audit
detection:
selection:
event_type:
- group_secret_push_protection_updated
- project_security_setting_updated
condition: selection
falsepositives:
- Teams that switch protection on during a rollout, which writes the same events. Read the details of the event, or the Security configuration page, for the value now in force.
- Other security settings of a project that share the project event. Keep the events whose details name secret push protection once you have seen one of your own.
level: medium
False positives
- Teams that switch protection on during a rollout, which writes the same events. Read the details of the event, or the Security configuration page, for the value now in force.
- Other security settings of a project that share the project event. Keep the events whose details name secret push protection once you have seen one of your own.
GitLab Secret Push Protection Skipped by a User
Detects the audit event type skip_secret_push_protection, which GitLab writes when a user skips secret push protection for a push (GitLab 16.11 and later). GitLab offers the skip for cases such as a placeholder secret in a test, and anyone who can push to the project can use it. The push is then accepted without the check. GitLab documents that the event details include the skip method, the account, the project, the target branch and the commits, but not under which keys, so the rule matches on the event type. Read the commits for what was pushed.
title: GitLab Secret Push Protection Skipped by a User
id: 7625af16-0526-44c5-8535-e01e67d0dc47
status: experimental
description: >-
Detects the audit event type skip_secret_push_protection, which GitLab
writes when a user skips secret push protection for a push (GitLab 16.11
and later). GitLab offers the skip for cases such as a placeholder
secret in a test, and anyone who can push to the project can use it.
The push is then accepted without the check. GitLab documents that the
event details include the skip method, the account, the project, the
target branch and the commits, but not under which keys, so the rule
matches on the event type. Read the commits for what was pushed.
references:
- https://docs.gitlab.com/user/compliance/audit_event_types/
- https://docs.gitlab.com/user/application_security/secret_detection/secret_push_protection/
- https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: gitlab
service: audit
detection:
selection:
event_type: skip_secret_push_protection
condition: selection
falsepositives:
- Developers who push test fixtures with placeholder credentials, or who skip the check after a timeout. Confirm with the person who pushed, and move recurring fixtures to an exclusion that is reviewed once.
level: medium
False positives
- Developers who push test fixtures with placeholder credentials, or who skip the check after a timeout. Confirm with the person who pushed, and move recurring fixtures to an exclusion that is reviewed once.
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.
Protection switched off, push received, protection switched back on
Someone who wants one push to pass unchecked can switch the protection off and on again within minutes, which leaves the settings page unchanged. Two setting events for the same project by the same account with a push in between show a check that was lifted for exactly one push.
- A setting changes for a project:
project_security_setting_updatedor one of theproject_push_rules_*_updatedevent types. Keepentity_path,author_id, the event type and the time. - Within the next 60 minutes a second event of the same type is written for the same
entity_path. - Between both, look for a push to that project: the streamed
repository_git_operationevent with the sameentity_path. GitLab's examples show the Git action indetails.custom_message. - Alert when the two setting events share the
author_id, and raise the priority when the push came from the same account.
Eventsproject_security_setting_updatedproject_push_rules_prevent_secrets_updatedproject_push_rules_reject_unsigned_commits_updatedrepository_git_operation
LimitsA Maintainer who saves the settings form twice produces the first two steps without any push. The Git operation event is not saved to the database and exists only in audit event streaming, and it covers fetches as well as pushes. The 60 minutes are a starting point.
Triage
- Identify who acted (
author_name,author_id,ip_address), which control was changed (the event type) and where (entity_path). - For a setting or push rule event, read the
detailsobject for the old and the new value, and compare it with the Security configuration or the Push rules of the project. The events are written in both directions. - For a skipped check, GitLab documents that the event details include the skip method, the account, the project, the target branch and the commits. Read those commits for what was pushed.
- For an exclusion, open the secret detection configuration of the project and read the path, value or rule that is now excluded. A path that covers most of the repository is the same as switching the protection off.
- Check what was pushed to the project after the change, and whether pipeline secret detection reported anything for those commits.
Response
Once the attack is confirmed:
- Switch secret push protection and the push rules back on, and delete exclusions that have no documented reason.
- Revoke and rotate every credential that was pushed while the check was off, skipped or excluded. Removing it from the latest commit does not remove it from the history.
- Review the commits pushed in that period for changes that nobody reviewed, in particular unsigned ones where signatures were required.
- Ask the account that made the change for the reason, and take the role from it until the change is explained if the reason does not hold.
- Run pipeline secret detection over the full history of the affected projects.
Mitigation
- Enable secret push protection for whole groups through the API instead of project by project, and review projects that switch it off.
- Run pipeline secret detection as well. GitLab scans the content of all commits after the push when it is enabled, which also covers skipped and excluded pushes.
- Keep the Maintainer role small on projects that hold deployment code, because it can switch the protection off and add exclusions.
- Review exclusions regularly, as GitLab recommends, and keep path exclusions narrow.
- Alert on every skipped check and every new exclusion, and confirm each one with the person who pushed.
Frequently asked questions
Is a skipped secret push protection check always a problem?
No. GitLab documents the skip option for cases such as a placeholder secret in a test or a push that runs into a timeout, and it logs an audit event whenever the check is skipped. The event is a prompt to look at the commits. It becomes a finding when the pushed content holds a real credential or the person cannot explain the push.
Do the setting events say whether protection was switched on or off?
GitLab describes `group_secret_push_protection_updated` as protection being enabled or disabled for a group, and `project_security_setting_updated` only as a project's security setting being updated. The event type reference lists both without their fields, so the rule fires in both directions. In the GitLab source the message of the project event says whether protection was enabled or disabled, which is not a documented schema. Read the `details` object or the Security configuration page for the value now in force.
Can a push get past secret push protection without any setting being changed?
Yes. GitLab lists what the check does not cover, including binary files, files or diffs larger than 1 MiB and the initial push that creates a repository, and it skips the scan when a push changes more than 3,150 paths or 350,000 lines. From GitLab 19.3 it writes audit events when a push is accepted for those reasons or after a scan timeout, which a low-level rule on this page reads.
Do group push rules apply to existing projects?
No. GitLab describes push rules as templates, not inherited settings. Group and instance push rules are copied to projects created afterwards, and existing projects keep their own copy. A change to a group push rule therefore affects new projects only, while a change to a project push rule takes effect in that project at once.