GitHub Secret Scanning Alert for a Publicly Leaked Secret

Last updated a day ago on 2026-11-02
Created a day ago on 2026-11-02

About

Detects GitHub secret scanning creating an alert for a secret that it has determined is publicly leaked ("github.publicly_leaked == true"). Unlike a generic secret-scanning finding, a publicly leaked secret means GitHub observed the credential exposed outside the repository's access boundary (for example in a public repository, gist, or other public location), so it should be treated as a confirmed credential compromise requiring immediate rotation rather than a low-signal scanner event. Gating on the public-leak flag also removes most of the noise from dummy strings and test fixtures, which are typically confined to private repositories and are not flagged as publicly leaked.
Tags
Domain: CloudDomain: SaaSPlatform: GitHubUse Case: Threat DetectionTactic: Credential AccessData Source: GitHub Audit LogsService: GitHub Code ScanningRule Type: ESQLLanguage: esql
Severity
high
Risk Score
73
MITRE ATT&CK™

Credential Access (TA0006)(external, opens in a new tab or window)

False Positive Examples
Example or dummy tokens that are themselves committed to a public repository can still be flagged as publicly leaked. Tune by repository, pattern name (`github.secret_type`), or known test org when such keys are expected.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Integration Pack
Prebuilt Security Detection Rules
Related Integrations

github(external, opens in a new tab or window)

Query
text code block:
from logs-github.audit-* metadata _id, _index, _version | where event.module == "github" and data_stream.dataset == "github.audit" and event.action == "secret_scanning_alert.create" and github.publicly_leaked == true | 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, github.secret_type_display_name, github.publicly_leaked, github.multi_repo

Install detection rules in Elastic Security

Detect GitHub Secret Scanning Alert for a Publicly Leaked Secret in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).