EXPLORE
← Back to Explore
elasticmediumTTP

GitHub Secret Scanning Push Protection Bypassed or Disabled

Detects bypass of GitHub secret scanning push protection, approval of a bypass request, or disabling push protection at enterprise, organization, or repository scope. This is separate from turning secret scanning off. Bypass means a detected secret was allowed into the repository — the pattern used after tj-actions and similar CI secret-dump attacks.

MITRE ATT&CK

defense-evasion

Detection Query

from logs-github.audit-* metadata _id, _index, _version
| where
  data_stream.dataset == "github.audit"
    and event.action in (
      "secret_scanning_push_protection.bypass",
      "secret_scanning_push_protection_request.approve",
      "business_secret_scanning_push_protection.disable",
      "business_secret_scanning_push_protection.disabled_for_new_repos",
      "org.secret_scanning_push_protection_disable",
      "org.secret_scanning_push_protection_new_repos_disable",
      "repository_secret_scanning_push_protection.disable"
    )
| keep
    _id,
    _index,
    _version,
    @timestamp,
    event.action,
    user.name,
    github.org,
    github.repo,
    github.actor_ip,
    github.hashed_token,
    github.programmatic_access_type,
    github.user_agent,
    github.secret_type

Author

Elastic

Created

2026/11/02

Data Sources

GithubGitHub Audit Logs

Tags

Domain: CloudDomain: SaaSPlatform: GitHubUse Case: Threat DetectionTactic: Defense EvasionData Source: GithubData Source: GitHub Audit LogsRule Type: ESQLResources: Investigation Guide
Raw Content
[metadata]
creation_date = "2026/11/02"
integration = ["github"]
maturity = "production"
updated_date = "2026/11/02"

[rule]
author = ["Elastic"]
description = """
Detects bypass of GitHub secret scanning push protection, approval of a bypass request, or disabling push protection at
enterprise, organization, or repository scope. This is separate from turning secret scanning off. Bypass means a
detected secret was allowed into the repository — the pattern used after tj-actions and similar CI secret-dump attacks.
"""
false_positives = [
    """
    Documented test of push protection using a dummy token, or a temporary disable while fixing a noisy pattern.
    Re-enable afterward and confirm no live secret was pushed.
    """,
]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "GitHub Secret Scanning Push Protection Bypassed or Disabled"
note = """## Triage and analysis

### Investigating GitHub Secret Scanning Push Protection Bypassed or Disabled

`secret_scanning_push_protection.bypass` fires when a user pushes a detected secret anyway. `secret_scanning_push_protection_request.approve` is a reviewer allowing that push. `business_secret_scanning_push_protection.disable`, `org.secret_scanning_push_protection_disable`, and `repository_secret_scanning_push_protection.disable` turn the control off at enterprise, organization, and repository scope respectively (the `*_new_repos_disable` actions turn it off for newly created repositories). This is separate from disabling secret scanning itself, which is covered by the `GitHub Secret Scanning Disabled` rule.

### Possible investigation steps

- Identify `user.name`, `github.repo`, `event.action`, and `github.secret_type`, and confirm whether the actor is expected to bypass or administer this control.
- Review `github.actor_ip` and `github.user_agent` to validate the source of the change, and pivot on `github.hashed_token` / `github.programmatic_access_type` to determine whether it was performed via the UI or a token.
- For a bypass or approved bypass: inspect the commit that landed, rotate the secret type reported in `github.secret_type`, and check workflow logs for printed credentials.
- For a disable: re-enable push protection and review commits pushed during the window it was off.
- Correlate with other control changes in the same window (secret scanning disabled, bypass-list additions, new owners, PAT grants) that may indicate broader tampering.

### False positive analysis

- Security team testing push protection with a known dummy value during an approved exercise.
- A noisy custom pattern that maintainers temporarily disable. Confirm no live secret was pushed and that the control is re-enabled afterward.

### Response and remediation

- Re-enable push protection at the affected scope. Rotate any secret that was bypassed.
- Restrict who can bypass or disable the control, and review the push-protection bypass list.
- Review Actions secrets and PATs created in the same window, and confirm the acting account is not compromised.
"""
references = [
    "https://github.com/SigmaHQ/sigma/blob/master/rules/application/github/audit/github_push_protection_bypass_detected.yml",
    "https://docs.github.com/en/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line",
]
risk_score = 47
rule_id = "0b026848-9d06-44ba-8a56-6af27790452d"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Domain: SaaS",
    "Platform: GitHub",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Github",
    "Data Source: GitHub Audit Logs",
    "Rule Type: ESQL",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-github.audit-* metadata _id, _index, _version
| where
  data_stream.dataset == "github.audit"
    and event.action in (
      "secret_scanning_push_protection.bypass",
      "secret_scanning_push_protection_request.approve",
      "business_secret_scanning_push_protection.disable",
      "business_secret_scanning_push_protection.disabled_for_new_repos",
      "org.secret_scanning_push_protection_disable",
      "org.secret_scanning_push_protection_new_repos_disable",
      "repository_secret_scanning_push_protection.disable"
    )
| keep
    _id,
    _index,
    _version,
    @timestamp,
    event.action,
    user.name,
    github.org,
    github.repo,
    github.actor_ip,
    github.hashed_token,
    github.programmatic_access_type,
    github.user_agent,
    github.secret_type
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "event.action",
    "user.name",
    "github.org",
    "github.repo",
    "github.actor_ip",
    "github.hashed_token",
    "github.programmatic_access_type",
    "github.user_agent",
    "github.secret_type",
]