1. Resources
  2. Detection rules
  3. Secret Scanning or Push Protection Disabled in GitHub

Secret Scanning or Push Protection Disabled in GitHub detection rules

An attacker with admin rights turns off secret scanning or push protection for a repository, an organization or an enterprise, so that credentials committed afterwards are neither blocked nor reported.

Platform
GitHub
Severity
Medium
Log source
GitHub audit log
Last updated
MITRE ATT&CK technique
T1685Disable or Modify Tools
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Admin rights on a repository, or control of an organization owner, security manager or enterprise owner account for the wider scopes.
Impact
Credentials pushed to the affected repositories are neither blocked nor reported, so a leaked token or key stays usable until someone notices it.
Response
Turn the controls back on at the scope where they were disabled, and rotate every credential that the returning alerts report.
Mitigation
Apply secret scanning and push protection through an enforced security configuration, and limit who can bypass a push protection block.
Audit actions
repository_secret_scanning_push_protection_bypass_list.disableorg_secret_scanning_push_protection_bypass_list.disablerepository_secret_scanning_push_protection_bypass_list.addorg_secret_scanning_push_protection_bypass_list.addsecret_scanning_push_protection.bypassrepository_secret_scanning_push_protection.disableorg.secret_scanning_push_protection_disableorg.secret_scanning_push_protection_new_repos_disablebusiness_secret_scanning_push_protection.disablebusiness_secret_scanning_push_protection.disabled_for_new_reposrepository_secret_scanning.disablesecret_scanning.disableand 15 more in the rules below

How the attack works

GitHub has two controls against credentials in code. Secret scanning searches the entire Git history on all branches of a repository for hardcoded credentials such as API keys, passwords and tokens, and raises an alert for each one it finds. Push protection works earlier: it blocks a push that contains a secret before the secret reaches the repository. Both can be switched on and off for a single repository, for an organization and for an enterprise, and separately as the default for new repositories. Push protection for repositories is disabled by default and can be enabled by a repository administrator, an organization owner, a security manager or an enterprise owner.

An attacker who controls such an account turns the controls off to work unseen. Afterwards a credential that lands in the repository raises no alert, whether a developer commits it by accident or the attacker places it there, and a push that contains one is no longer stopped. The change is a quiet form of defense impairment, because nothing breaks for developers.

GitHub records each change with an action name that states the scope: repository_secret_scanning.disable for one repository, secret_scanning.disable and secret_scanning_new_repos.disable for an organization, business_secret_scanning.disable for an enterprise, and matching actions for push protection. A related, smaller event is a contributor bypassing a push protection block, recorded as secret_scanning_push_protection.bypass. By default anyone with write access to the repository can do that by giving a reason. Two quieter changes leave both controls enabled and have their own actions: opening the push protection bypass list to anyone with write access or adding a role or team to it, and switching off a single detector such as non-provider patterns, generic secrets or a custom pattern.

What an attacker needs

  • Admin rights on a repository, or control of an organization owner, security manager or enterprise owner account for the wider scopes.
  • No enforced security configuration that blocks repository owners from changing the feature.
  • For a bypass, only write access to the repository, unless delegated bypass limits who may bypass.

Impact

Credentials pushed to the affected repositories while the controls are off are not blocked and produce no alert, so a leaked token or key can be used for as long as nobody notices it. At organization or enterprise scope a single change removes the control from every repository at once. A bypass lets one secret through with a stated reason and leaves an alert behind.

Detection rules

GitHub Push Protection Bypass List Opened or Extended

Detects a change that lets more people bypass a push protection block. The bypass_list.disable actions are written when the setting "Users who can bypass push protection for secret scanning" is changed from "Specific roles or teams" to "Anyone with write access", at repository or organization level, which ends delegated bypass. The bypass_list.add actions are written when a role or team is added to the bypass list. Push protection stays enabled in both cases, so the disable rules on this page do not fire, but a contributor can again push a detected secret without a review of the request.

LevelMediumStatusExperimentalLog sourceGitHub audit log
title: GitHub Push Protection Bypass List Opened or Extended
id: e4cc923f-7543-47a4-a1c6-4ae7bbc179c1
status: experimental
description: >-
  Detects a change that lets more people bypass a push protection block.
  The bypass_list.disable actions are written when the setting "Users who
  can bypass push protection for secret scanning" is changed from "Specific
  roles or teams" to "Anyone with write access", at repository or
  organization level, which ends delegated bypass. The bypass_list.add
  actions are written when a role or team is added to the bypass list.
  Push protection stays enabled in both cases, so the disable rules on this
  page do not fire, but a contributor can again push a detected secret
  without a review of the request.
references:
  - https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
  - https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/secret-security/delegated-bypass
  - https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.t1685
logsource:
  product: github
  service: audit
detection:
  selection:
    action:
      - repository_secret_scanning_push_protection_bypass_list.disable
      - org_secret_scanning_push_protection_bypass_list.disable
      - repository_secret_scanning_push_protection_bypass_list.add
      - org_secret_scanning_push_protection_bypass_list.add
  condition: selection
falsepositives:
  - Security teams that add a reviewing team or a role to the bypass list on purpose. Confirm the addition, and treat a change back to anyone with write access as the more serious of the two.
level: medium

False positives

  • Security teams that add a reviewing team or a role to the bypass list on purpose. Confirm the addition, and treat a change back to anyone with write access as the more serious of the two.

GitHub Secret Scanning Push Protection Bypassed

Detects a user bypassing push protection on a secret that secret scanning detected in a push. The secret reaches the repository with the reason the user gave, and GitHub creates an alert for it. A low-level signal for review: the reason is in push_protection_bypass_reason and the kind of secret in secret_type.

LevelLowStatusExperimentalLog sourceGitHub audit log
title: GitHub Secret Scanning Push Protection Bypassed
id: 78cabb5e-ec63-40ec-a067-0168a698324f
status: experimental
description: >-
  Detects a user bypassing push protection on a secret that secret scanning
  detected in a push. The secret reaches the repository with the reason the
  user gave, and GitHub creates an alert for it. A low-level signal for
  review: the reason is in push_protection_bypass_reason and the kind of
  secret in secret_type.
references:
  - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
  - https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/secret-security/push-protection
  - https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/secret-security/delegated-bypass
  - https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-16
tags:
  - attack.defense-impairment
  - attack.t1685
logsource:
  product: github
  service: audit
detection:
  selection:
    action: secret_scanning_push_protection.bypass
  condition: selection
falsepositives:
  - Developers who push test fixtures or values that are not real secrets and say so in the reason. Where bypasses are frequent, limit who can bypass with delegated bypass and alert only on reasons that leave an open alert.
level: low

False positives

  • Developers who push test fixtures or values that are not real secrets and say so in the reason. Where bypasses are frequent, limit who can bypass with delegated bypass and alert only on reasons that leave an open alert.

GitHub Secret Scanning Push Protection Disabled

Detects push protection for secret scanning being disabled for a repository, for an organization, as the default for new repositories, or for an enterprise. Pushes that contain a secret are no longer blocked in the affected repositories. The action name states the scope, and the repository-level action names the repository in repo.

LevelMediumStatusExperimentalLog sourceGitHub audit log
title: GitHub Secret Scanning Push Protection Disabled
id: 1d56754e-9ac2-4972-ab9f-28d13729fe25
status: experimental
description: >-
  Detects push protection for secret scanning being disabled for a
  repository, for an organization, as the default for new repositories, or
  for an enterprise. Pushes that contain a secret are no longer blocked in
  the affected repositories. The action name states the scope, and the
  repository-level action names the repository in repo.
references:
  - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
  - https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
  - https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/secret-security/push-protection
  - https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-16
tags:
  - attack.defense-impairment
  - attack.t1685
logsource:
  product: github
  service: audit
detection:
  selection:
    action:
      - repository_secret_scanning_push_protection.disable
      - org.secret_scanning_push_protection_disable
      - org.secret_scanning_push_protection_new_repos_disable
      - business_secret_scanning_push_protection.disable
      - business_secret_scanning_push_protection.disabled_for_new_repos
  condition: selection
falsepositives:
  - Deliberate changes, such as a migration that pushes old history containing secrets, or a move to security configurations. Confirm the reason and the planned end with the actor, and check that push protection was turned on again.
level: medium

False positives

  • Deliberate changes, such as a migration that pushes old history containing secrets, or a move to security configurations. Confirm the reason and the planned end with the actor, and check that push protection was turned on again.

GitHub Secret Scanning Disabled

Detects secret scanning being disabled for a repository, for all existing repositories of an organization, as the default for new repositories, or for an enterprise. Credentials committed to the affected repositories afterwards raise no alert. The action name states the scope, and the repository-level action names the repository in repo.

LevelMediumStatusExperimentalLog sourceGitHub audit log
title: GitHub Secret Scanning Disabled
id: 40be4d8d-c853-4b3e-b60b-425b8ab77596
status: experimental
description: >-
  Detects secret scanning being disabled for a repository, for all existing
  repositories of an organization, as the default for new repositories, or
  for an enterprise. Credentials committed to the affected repositories
  afterwards raise no alert. The action name states the scope, and the
  repository-level action names the repository in repo.
references:
  - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
  - https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
  - https://docs.github.com/en/enterprise-cloud@latest/code-security/concepts/secret-security/secret-scanning
  - https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-16
tags:
  - attack.defense-impairment
  - attack.t1685
logsource:
  product: github
  service: audit
detection:
  selection:
    action:
      - repository_secret_scanning.disable
      - secret_scanning.disable
      - secret_scanning_new_repos.disable
      - business_secret_scanning.disable
      - business_secret_scanning.disabled_for_new_repos
  condition: selection
falsepositives:
  - Deliberate changes, such as a licence decision, the retirement of a repository or a move to security configurations. Confirm the reason with the actor, and treat organization and enterprise scope as more urgent than a single repository.
level: medium

False positives

  • Deliberate changes, such as a licence decision, the retirement of a repository or a move to security configurations. Confirm the reason with the actor, and treat organization and enterprise scope as more urgent than a single repository.

GitHub Secret Scanning Pattern Coverage Reduced

Detects secret scanning being narrowed without being switched off. The actions cover three detectors at repository, organization and enterprise level: secret scanning for non-provider patterns disabled, generic secrets disabled, and a custom pattern removed or its push protection disabled. Secret scanning itself stays enabled, so the disable rules on this page do not fire, but credentials of the kind the removed detector covered are no longer reported or blocked. A custom pattern is often the only detector for an organization's own token format, which makes its removal the most telling of these changes.

LevelLowStatusExperimentalLog sourceGitHub audit log
title: GitHub Secret Scanning Pattern Coverage Reduced
id: 47c3a9b2-52fe-4283-82d6-1087d17630f2
status: experimental
description: >-
  Detects secret scanning being narrowed without being switched off. The
  actions cover three detectors at repository, organization and enterprise
  level: secret scanning for non-provider patterns disabled, generic
  secrets disabled, and a custom pattern removed or its push protection
  disabled. Secret scanning itself stays enabled, so the disable rules on
  this page do not fire, but credentials of the kind the removed detector
  covered are no longer reported or blocked. A custom pattern is often the
  only detector for an organization's own token format, which makes its
  removal the most telling of these changes.
references:
  - https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
  - https://docs.github.com/en/enterprise-cloud@latest/code-security/reference/secret-security/supported-secret-scanning-patterns
  - https://attack.mitre.org/techniques/T1685/
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.t1685
logsource:
  product: github
  service: audit
detection:
  selection:
    action:
      - repository_secret_scanning_non_provider_patterns.disabled
      - org_secret_scanning_non_provider_patterns.disabled
      - business_secret_scanning_non_provider_patterns.disabled
      - repository_secret_scanning_generic_secrets.disabled
      - org_secret_scanning_generic_secrets.disabled
      - business_secret_scanning_generic_secrets.disabled
      - repository_secret_scanning_custom_pattern.delete
      - org_secret_scanning_custom_pattern.delete
      - business_secret_scanning_custom_pattern.delete
      - repository_secret_scanning_custom_pattern_push_protection.disabled
      - org.secret_scanning_custom_pattern_push_protection_disabled
      - business_secret_scanning_custom_pattern_push_protection.disabled
  condition: selection
falsepositives:
  - Security teams that retire a custom pattern which produced too many false alerts, or replace it with a corrected one. Confirm that a replacement was published.
  - Detectors that are switched off for a repository of test data. Exclude that repository by repo.
level: low

False positives

  • Security teams that retire a custom pattern which produced too many false alerts, or replace it with a corrected one. Confirm that a replacement was published.
  • Detectors that are switched off for a repository of test data. Exclude that repository by repo.

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.

Push protection turned off for a repository, pushed to, and turned on again

Detection hypothesisSequence of events

Push protection acts only at the moment of a push and does not look back. Someone who wants one push through without a block can switch it off for the repository, push, and switch it on again, so that the setting looks unchanged at the next review and the disable alert seems to have been corrected. A disable and an enable for the same repository within minutes, with a push in between, is a control lifted for exactly one push.

  1. Push protection is turned off for a repository: repository_secret_scanning_push_protection.disable. Keep repo, actor and the time.
  2. Within 60 minutes it is turned on again for the same repo: repository_secret_scanning_push_protection.enable.
  3. Between both, look for git.push events for the same repo. GitHub delivers Git events through the REST API, audit log streaming and exports only, and keeps them for seven days.
  4. Alert when a push falls into the window, raise the priority when the account that pushed is the one that changed the setting, and read the commits of that push in the repository.

Eventsrepository_secret_scanning_push_protection.disablerepository_secret_scanning_push_protection.enablegit.push

LimitsA migration that pushes old history with known test secrets produces the same pattern, and its owner should be able to name the push. The documented fields of git.push do not name the branch or the commits. The organization and enterprise actions change many repositories at once and are not covered here. The 60 minutes are a starting point.

Triage

  • Identify who made the change (actor) and read the scope from the action name, which is one repository (repo), all existing repositories of the organization, new repositories or the enterprise.
  • Confirm the change with the actor through a separate channel. A deliberate change has a reason, for example a licence decision or the retirement of a repository.
  • List the pushes to the affected repositories since the change, and check whether the same actor changed other protections, such as branch protection or rulesets.
  • For a bypass, read the reason and the secret type (push_protection_bypass_reason, secret_type) and check the alert GitHub created. A bypass with the reason that it will be fixed later leaves an open alert that needs an owner.
  • Check whether delegated bypass was opened to everyone with write access around the same time. GitHub records that as a change to the push protection bypass list.

Response

Once the attack is confirmed:

  1. Turn the controls back on at the scope where they were disabled. Secret scanning searches the whole Git history, so it reports secrets that were committed while it was off.
  2. Rotate every credential that the new alerts report. GitHub's guidance is to rotate an exposed credential immediately, and it calls removing the secret from the Git history often unnecessary once the credential is revoked.
  3. Secure the account that made the change. Reset its password and second factor, end its sessions and revoke its personal access tokens and SSH keys.
  4. Review the commits and workflow changes pushed to the affected repositories while the controls were off, by the acting account and by others.
  5. Enforce the security configuration, so that the same change cannot be made at repository level again.

Mitigation

  • Apply secret scanning and push protection through a security configuration and enforce it, which blocks repository owners from changing the features the configuration sets.
  • Configure delegated bypass for push protection, so that only named roles and teams can bypass a block and everyone else has to request it.
  • Keep repository admin rights, the security manager role and owner accounts to the people who need them.
  • Stream the audit log to your SIEM and alert on every disable action. Review push protection bypasses regularly.

Frequently asked questions

Are secrets that were pushed while secret scanning was off lost to detection?

Not once it is back on. GitHub states that secret scanning scans the entire Git history on all branches of a repository, so the secrets committed during the gap are reported after the feature is enabled again. Push protection is different. It acts only at the moment of a push and does not go back, so everything pushed while it was off is already in the repository.

Does a push protection bypass mean that a secret leaked?

It means a contributor pushed something that GitHub recognised as a secret and chose to let it through with a reason. GitHub creates an alert, adds the bypass to the audit log and notifies owners, security managers and repository administrators who watch the repository. The reasons "used in tests" and "false positive" create a closed alert, and "I'll fix it later" creates an open one.

How do I tell from the event how many repositories are affected?

From the action name. `repository_secret_scanning.disable` and `repository_secret_scanning_push_protection.disable` concern one repository, named in `repo`. `secret_scanning.disable` covers all existing repositories of an organization, the `new_repos` actions change the default for new repositories, and the `business_secret_scanning` actions apply to the enterprise.

Do these rules also see a change made through a security configuration?

GitHub's event reference does not say whether detaching or editing a security configuration also writes the disable actions these rules read. Configuration changes have their own audit actions, such as `repository_security_configuration.removed` and `security_configuration.update`. If your organization manages the features through configurations, watch those actions as well.

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.