Month: December 2026

Detecting stolen GitHub tokens after SAP’s incident: 4 Sigma rules for the audit log

Detecting stolen GitHub tokens after SAP’s incident: 4 Sigma rules for the audit log

When a vendor says “suspicious activity” and the insiders say “stolen GitHub tokens,” the useful question for a defender is not what happened at SAP. It’s whether you would notice the same thing in your own GitHub organisation. In my analysis of the SAP incident I separated what SAP confirmed from what an insider told Der Spiegel and what company sources told Handelsblatt. This post is the practical half.

You get four Sigma rules for the GitHub audit log: one correlation for bulk cloning by a single token, two rules for attempts to get code past branch protection, and one hunting rule to find the classic personal access tokens that make this kind of theft worthwhile. None of them uses an indicator from the SAP case, because none has been published.

At a glance

  • Rules: 4 (one is a Sigma v2 correlation with its base rule in the same file).
  • Domain: Cloud-SaaS (GitHub).
  • Log source: product: github, service: audit, streamed from your organisation or enterprise to the SIEM, with Git events and token metadata.
  • ATT&CK: T1213.003 Code Repositories, T1550.001 Application Access Token, T1562.001 Disable or Modify Tools, T1565.001 Stored Data Manipulation.
  • Status: all experimental. The logic is inferred from reported behaviour, not from published IOCs.
  • GitHub: Detection Rules/Cloud/SaaS.

The case in brief

SAP confirmed on November 26, 2026 that it had identified suspicious activity and found no evidence of unauthorized access to customer business data. An insider cited by Der Spiegel said attackers had obtained SAP employees’ GitHub authentication tokens, which let them copy and alter source code. Handelsblatt reported a response called “Project Granite”; SecurityWeek, CyberInsider and the CSA, citing Handelsblatt, add that SAP limited GitHub access, paused automated development and replaced signing keys. SAP has confirmed none of those details, and nobody has said how the tokens were stolen. The analysis has the full picture.

For detection, that reported story breaks into four steps with different footprints. Nobody has said how the tokens were stolen; wherever that happened, it was outside GitHub, so the audit log won’t show it. Copying code shows up as git.clone and repo.download_zip events. Altering code shows up as git.push, and if branch protection is in the way, as overrides, rejected pushes or changes to the protection itself. GitHub attaches a hashed_token (a SHA-256 of the token) and a programmatic_access_type to many audit events, which is what ties those steps back to one credential.

Detection map

Detection map: GitHub audit log stream and Git events feed four Sigma rules (bulk clone correlation, protection change, override or rejected push, classic token hunt), mapped to T1213.003, T1550.001, T1562.001 and T1565.001, with token theft marked as a gap.
One log source, four rules. The theft of the token itself stays outside GitHub’s view.

Everything here depends on one telemetry source, and that is both the strength and the weakness of the set. If you stream the GitHub audit log with Git events, all four rules have their data, with one caveat: token metadata on Git events is still in public preview, and rules 1, 3 and 4 lean on token fields. If you don’t, none of them do, and you can’t fix it after the fact: Git events never show up in the web interface, and on Enterprise Cloud the REST API keeps them for seven days. The dashed box on the right is the honest gap: the theft of the token itself is outside GitHub’s view.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Single token clones many repositories within one hourCloud-SaaSgithub / auditCollection / T1213.003; Defense Evasion / T1550.001MediumExperimental
Branch protection removed or signing and force-push rules changedCloud-SaaSgithub / auditDefense Evasion / T1562.001MediumExperimental
Protected-branch override or rejected push using a tokenCloud-SaaSgithub / auditImpact / T1565.001; Defense Evasion / T1550.001MediumExperimental
Git activity with a classic personal access tokenCloud-SaaSgithub / auditDefense Evasion / T1550.001Low (hunting)Experimental

The rules

Single GitHub access token clones many distinct repositories within one hour

Context: “copy source code” is the reported step with the clearest log trail. A developer’s token usually touches a handful of repositories a day. An attacker with that token and a list of everything it can read tends to pull as much as possible, quickly, before someone revokes it.

Condition: a base rule keeps git.clone and repo.download_zip events that carry a hashed_token. The correlation counts distinct repo values (a common field on GitHub audit events; check your pipeline keeps the name) per hashed_token and fires at 25 or more within one hour.

ATT&CK: Collection (TA0009) – T1213.003 Data from Information Repositories: Code Repositories; Defense Evasion (TA0005) – T1550.001 Use Alternate Authentication Material: Application Access Token.

title: GitHub Git Clone or Source Archive Download Using an Access Token
id: 73613233-1c56-4b42-81ea-1750b63b4979
name: github_audit_git_clone_or_archive_download_by_token
status: experimental
description: |
    Base rule for the correlation below. Matches GitHub audit log git.clone and repo.download_zip events
    that carry a hashed token, meaning they were authenticated with a token or key rather than a browser session.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/identifying-audit-log-events-performed-by-an-access-token
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM with Git events included. Git events are not shown in the web UI and the Enterprise Cloud REST API keeps them for 7 days. Token metadata on Git events is in public preview. The correlation counts the repo field (a common GitHub audit field); check your pipeline does not rename it.'
detection:
    selection:
        action:
            - 'git.clone'
            - 'repo.download_zip'
    filter_main_no_token:
        hashed_token: null
    condition: selection and not filter_main_no_token
falsepositives:
    - CI runners, mirroring jobs, backup tools and code-scanning services that clone many repositories with one token
level: low
---
title: Single GitHub Access Token Clones Many Distinct Repositories Within One Hour
id: 1550313d-5018-4c24-8e89-72ca663dd413
status: experimental
description: |
    Detects one GitHub access token (grouped by hashed_token) cloning or downloading archives of 25 or more
    distinct repositories within one hour. In the SAP incident, an insider reported that stolen employee GitHub
    tokens let attackers copy source code; bulk cloning with a developer's token is how that would look in the audit log.
    Threshold and logic are inferred, not taken from a published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-sap-source-code-token-compromise-20261129/
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
    - attack.defense-evasion
    - attack.t1550.001
correlation:
    type: value_count
    rules:
        - github_audit_git_clone_or_archive_download_by_token
    group-by:
        - hashed_token
    timespan: 1h
    condition:
        gte: 25
        field: repo
falsepositives:
    - Automation tokens used by CI, backup, mirroring or code-scanning tools; allowlist their hashed_token values after review
    - Developers bootstrapping a new machine with a script that clones every team repository
level: medium

View on GitHub

False positives and tuning: CI runners, repository mirrors, backup tools and code-scanning services do exactly this every night. Run the base rule alone for a week, list the tokens that cross 25, and allowlist the ones you can explain by hashed_token, not by user name (a stolen token keeps its owner’s name). Then think about lowering the threshold for human accounts. If your SIEM can’t do Sigma correlations, convert the base rule and do the distinct count in the SIEM’s own query language.

How to test: in a lab organisation, create a test token and clone 25 or more small test repositories in a loop within an hour. Confirm that git.clone events with a hashed_token reach the SIEM first; if they don’t, fix the streaming setup before touching the rule.

GitHub branch protection removed or signing and force-push rules changed

Context: altering code that ships means getting past the controls on release branches: required reviews, required signed commits, no force pushes, rules that also bind administrators. An attacker with an admin’s token can simply switch those off. So can a tired admin at 11 p.m., which is why this rule is medium and not high.

Condition: alert on any of protected_branch.destroy, protected_branch.update_signature_requirement_enforcement_level, protected_branch.update_allow_force_pushes_enforcement_level, protected_branch.update_admin_enforced or repository_ruleset.destroy.

ATT&CK: Defense Evasion (TA0005) – T1562.001 Impair Defenses: Disable or Modify Tools.

title: GitHub Branch Protection Removed or Signing and Force-Push Rules Changed
id: 343e1a93-36da-430b-b720-970323305025
status: experimental
description: |
    Detects GitHub audit log events where branch protection is deleted, a repository ruleset is deleted, or the
    required-signature, force-push or admin-enforcement settings of a protected branch are changed. An attacker
    who wants to alter source code, as an insider reported in the SAP incident, has to get past these controls first.
    Inferred logic; no published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - 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://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.defense-evasion
    - attack.t1562.001
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM.'
detection:
    selection:
        action:
            - 'protected_branch.destroy'
            - 'protected_branch.update_signature_requirement_enforcement_level'
            - 'protected_branch.update_allow_force_pushes_enforcement_level'
            - 'protected_branch.update_admin_enforced'
            - 'repository_ruleset.destroy'
    condition: selection
falsepositives:
    - Repository administrators reorganising branch rules or migrating from branch protection to rulesets
    - The update events may also fire when a setting is tightened, not only loosened; check the new value in the event
level: medium

View on GitHub

False positives and tuning: the “update” events may also fire when a setting is tightened, so look at the new value in the event before escalating, or add a filter once you know how your SIEM parses it. Scope the rule to repositories that feed builds or releases if your organisation has thousands of scratch repos. Expect a burst of noise during a migration from branch protection to rulesets; suppress by change ticket, not forever.

How to test: in a test repository with a protected branch, turn “Require signed commits” off and back on, then delete the protection rule.

GitHub protected-branch override or rejected push using an access token

Context: this is the integrity signal. A token, not a person in the browser, either forcing a change past a protected-branch requirement or trying to push to a protected branch and being refused. The refused attempt matters as much as the successful one: it tells you someone with a token is probing your release branches.

Condition: alert on protected_branch.policy_override or protected_branch.rejected_ref_update when the event carries a hashed_token.

ATT&CK: Impact (TA0040) – T1565.001 Data Manipulation: Stored Data Manipulation; Defense Evasion (TA0005) – T1550.001 Application Access Token.

title: GitHub Protected Branch Override or Rejected Push Using an Access Token
id: aa421b51-1377-46e7-a151-ba9b3f319167
status: experimental
description: |
    Detects a protected-branch requirement being overridden, or a push to a protected branch being rejected,
    when the event was authenticated with a token or key (hashed_token present). An insider reported that stolen
    SAP employee GitHub tokens let attackers alter source code; a token pushing straight at protected branches,
    successfully or not, is the integrity signal to chase. Inferred logic; no published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - 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://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.impact
    - attack.t1565.001
    - attack.defense-evasion
    - attack.t1550.001
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM; token metadata (hashed_token, programmatic_access_type) present on events.'
detection:
    selection:
        action:
            - 'protected_branch.policy_override'
            - 'protected_branch.rejected_ref_update'
    filter_main_no_token:
        hashed_token: null
    condition: selection and not filter_main_no_token
falsepositives:
    - Release automation or bots that hold bypass rights on protected branches; allowlist their actor or hashed_token
    - Developers whose local Git client pushes to a protected branch by mistake (rejected_ref_update)
level: medium

View on GitHub

False positives and tuning: release bots and merge automation that hold bypass rights will trigger overrides; allowlist them by actor and hashed_token. Rejected pushes from developers who forgot which branch they were on are common and harmless; if they swamp you, require two rejected pushes from one token within ten minutes, or drop rejected pushes to low and keep overrides at medium.

How to test: with a personal access token in a lab repository, push a commit directly to a protected branch that requires pull requests. You should see a rejected ref update tied to the token’s hash.

GitHub Git activity authenticated with a classic personal access token

Context: this one is a hunt, not an alert. GitHub’s docs say a classic personal access token can access every repository its owner can, and GitHub recommends fine-grained tokens instead. That breadth makes classic tokens the most valuable thing to steal. You can’t protect tokens you don’t know exist.

Condition: list git.clone, git.fetch, git.push and repo.download_zip events where programmatic_access_type contains “classic”. I could not confirm GitHub’s exact string for this field from the docs, so check a real event and adjust the match.

ATT&CK: Defense Evasion (TA0005) – T1550.001 Application Access Token.

title: GitHub Git Activity Authenticated With a Classic Personal Access Token
id: 20a118bf-0c33-4456-a141-331a7a3230e4
status: experimental
description: |
    Hunting rule. Lists Git clone, fetch and push events and source archive downloads authenticated with a classic
    personal access token. A classic token can access every repository its owner can, which makes it the most useful kind
    to steal. Use the result to build a token inventory and to spot tokens used from unusual places or times.
references:
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-sap-source-code-token-compromise-20261129/
    - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/identifying-audit-log-events-performed-by-an-access-token
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.defense-evasion
    - attack.t1550.001
    - detection.threat-hunting
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub audit log streamed to the SIEM with Git events and token metadata (public preview for Git events). Check the exact programmatic_access_type value in your own events and adjust the match.'
detection:
    selection_action:
        action:
            - 'git.clone'
            - 'git.fetch'
            - 'git.push'
            - 'repo.download_zip'
    selection_token:
        programmatic_access_type|contains: 'classic'
    condition: all of selection_*
falsepositives:
    - Legitimate scripts and integrations still using classic tokens; that is the point of the hunt, review and migrate them
level: low

View on GitHub

False positives and tuning: every hit is a legitimate use until proven otherwise, and that’s fine. Group the results by hashed_token and actor, and turn the list into a migration plan to fine-grained, expiring tokens. Once a team has migrated, any new classic-token activity from that team becomes worth an alert.

How to test: clone any repository in a lab organisation with a classic token and look for the event.

Coverage and gaps

Step in caseTacticTechniqueRuleCovered?
Employee token stolenCredential Access (TA0006)Unknown method–Gap: outside GitHub
Stolen token usedDefense Evasion (TA0005)T1550.001Hunting, correlation, override rulesPartial
Source code copiedCollection (TA0009)T1213.003Bulk clone correlationYes, for bulk; not for slow, targeted cloning
Protections weakenedDefense Evasion (TA0005)T1562.001Protection or signing changedPartial: ruleset edits and review-setting changes not covered
Source code alteredImpact (TA0040)T1565.001Override or rejected pushPartial: pushes to unprotected branches are invisible
Altered code built and shippedInitial Access, downstream (TA0001)T1195.002–Gap: needs build provenance and signature checks

Three gaps matter. First, the token theft happened outside GitHub, by a method nobody has disclosed, so catching it needs endpoint, CI or browser-side telemetry, not GitHub logs. Second, Sigma can’t express “first time this token has been seen from this network”; do that in the SIEM with a lookup of hashed_token against past source addresses. Third, a quiet attacker pushes to a feature branch and waits for a reviewer to merge it. No log rule catches that. Required reviews, required signed commits and build provenance (SLSA attestations, Sigstore signatures) do, which is why the second rule protects those settings.

Deploying the rules

Grab the YAML from the GitHub folder and convert it with sigma-cli for your SIEM. GitHub audit logs have no standard field mapping in most backends, so check that action, hashed_token, programmatic_access_type and repo match what your ingest pipeline produces, and add a small custom pipeline if they don’t. For example:

sigma convert -t splunk --without-pipeline github_audit_branch_protection_or_signing_requirement_changed.yml
sigma convert -t lucene --without-pipeline github_audit_protected_branch_override_or_rejected_push_by_token.yml
sigma convert -t kusto --without-pipeline github_audit_classic_pat_git_activity.yml

Correlation rules need a backend that supports Sigma correlations; check yours before relying on the bulk-clone rule, or rebuild the count in the SIEM. Run everything in alert-only mode for a week before paging anyone, and make sure the audit log stream actually includes Git events before you trust a quiet dashboard.

My take

Stolen-token activity is detectable in GitHub, but only if you decided to collect the right log before you needed it. My guess is that plenty of organisations have the audit log but not Git events in it, and certainly not more than a week of them. If I could turn on only one thing after reading the SAP story, it would be audit log streaming with Git events. The rule I’d enable first is the protection-change rule, because it is quiet in a well-run organisation and catches the attacker who switches off release controls instead of working around them. It won’t see a push to a feature branch that a reviewer later merges.

I’d also like GitHub to make two things default: Git events visible in the regular audit log search, and a warning when a classic token with no expiration is used against a repository with protected branches. Detection should not depend on setting up streaming in advance to find out that a token was used to clone everything you own.

Sources

SAP’s reported GitHub token theft: a short statement and the integrity question it skips

SAP’s reported GitHub token theft: a short statement and the integrity question it skips

On Thursday evening, November 26, 2026, SAP put out a short statement: it had identified suspicious activity, taken measures, and found “no evidence of unauthorized access to customer business data.” That last line is true as far as anyone knows, and it answers the wrong question. The incident, as insiders describe it, is not about customer data at all. It is about who could read and change SAP’s source code, and for how long.

SAP confirms it saw suspicious activity and took countermeasures. Der Spiegel, citing an insider, reports that attackers stole SAP employees’ GitHub authentication tokens, which let them copy and alter source code. Handelsblatt, citing company sources, names the internal response “Project Granite”; SecurityWeek, CyberInsider and the CSA, citing Handelsblatt, add that SAP restricted GitHub access, paused automated development and replaced signing keys. SAP has confirmed none of this.

I rate this high. Not because anything bad has been shown to reach customers (nothing has), but because a possible integrity problem in the development pipeline of a major ERP vendor touches a very large number of organisations, and the public record is still thin.

At a glance

  • Victim: SAP. Reported location: GitHub (dpa), in software development (Handelsblatt).
  • Confirmed by SAP (November 26, 2026): suspicious activity identified, measures taken, no evidence so far of unauthorized access to customer business data.
  • Reported, not confirmed: stolen employee GitHub tokens that let attackers copy and alter source code (Der Spiegel insider); detection the week before, “Project Granite” (Handelsblatt); GitHub access restricted, automation paused, signing keys replaced (outlets citing Handelsblatt).
  • Attribution: none. No actor has been publicly named.
  • Shipped products: no public evidence that altered code reached software delivered to customers.
  • CVE / patch: none. This is an incident, not a vulnerability.
  • Who should care: SAP customers (especially anyone pulling SAP code from npm, Maven or GitHub, or applying SAP Notes and transports), and every organisation that keeps its own code on GitHub with long-lived tokens.
Three columns: what SAP confirmed, what insiders and press report, and what is still unknown about the SAP GitHub incident.
Only the left column comes from SAP. Everything in the middle is insider reporting that SAP has not confirmed, as of December 1, 2026.

What we know

Der Spiegel broke the story on November 26, citing SAP insiders and an internal notice to employees. The German news agency dpa reviewed part of that internal communication and reported that the suspicious activity was found within GitHub, and that employees were asked to check whether they needed to change their login credentials.

SAP’s statement, shared with several outlets including SecurityWeek, says it identified suspicious activity and took measures to protect customers and secure its services. It does not say when the activity began, how the attackers got in, whether code was copied or changed, or whether any release was affected. It names no attacker.

Handelsblatt, citing people inside the company, adds three things: SAP noticed the incident the week before the press reports, the target was software development, and the internal response runs under the name “Project Granite” with multiple teams affected. SecurityWeek, CyberInsider and the Cloud Security Alliance all attribute the same reported measures to Handelsblatt: restricted GitHub access, paused automated development workflows and replaced signing keys.

Two other things got mixed into the coverage and should be kept apart. In late October 2026 the Gentlemen ransomware group listed SAP on its leak site, pointing at Latin American operations; SecurityWeek says the two incidents do not appear to be connected. And on April 29, 2026, malicious versions of four SAP-related npm packages (mbt 1.2.48 and three @cap-js packages) were published in the “Mini Shai-Hulud” campaign, built to steal GitHub and npm tokens among other secrets. That April story is about token theft too, which makes the link tempting, but no public source connects it to Project Granite.

Timeline from the reported detection in the week of November 16, 2026, through the internal memo, the November 26 Spiegel report and SAP statement, to coverage on November 27 and the CSA note on November 29.
Detection date is approximate: Handelsblatt says only that SAP noticed the incident the week before its report.

How the attack reportedly unfolded

All of this comes from insider accounts, so read it as the reported shape, not a forensic timeline. Attackers obtained authentication tokens belonging to SAP employees. Nobody has said what kind: a personal access token (a long string a developer creates so scripts and tools can act as them), an OAuth token issued to some app, or a browser session. Nobody has said how they were stolen either.

Whatever the type, a GitHub token is a bearer credential. Whoever holds it gets the owner’s access, with no second factor and no password prompt. If the employee could read a repository, so could the attacker. If the employee could push to it, so could the attacker. That is why the two verbs in the Spiegel report matter so much. “Copy” means an attacker now has source code to study for bugs at leisure, which is a confidentiality problem with a long tail. “Alter” is an integrity problem, and its blast radius depends entirely on one question: did any changed code pass review, get built, get signed and get shipped?

The reported response measures fit that worry. Pausing automated development processes stops a build pipeline from turning a poisoned commit into a release. Replacing signing keys means future artefacts carry a new signature, whether or not the old keys were actually exposed. As the CSA note points out, key rotation is common precaution and does not by itself prove the keys were compromised.

Der Spiegel’s sources also suggested the attackers may have had help from AI. There is no technical detail behind that yet. A same-day BSI warning about agentic AI in attacks does not mention SAP, so I wouldn’t connect the two.

Who is affected and how badly

I’d expect customer business data to live in production systems and cloud tenants, not in a source-code platform, so SAP’s “no evidence” sentence is plausible and also not very informative. The real exposure sits in three places.

  • Code you consume from SAP: SAP Notes and transports, npm and Maven packages under SAP namespaces, SDKs and samples cloned from SAP’s GitHub organisations. If any altered code was released (nothing says it was), this is where it would land.
  • Signature verification: if signing keys were replaced, anything that pins SAP key fingerprints or certificates will need the new ones, and anything signed with the old keys around the incident window deserves a second look once SAP says which window that is.
  • Future vulnerabilities: if proprietary source was copied, expect bug discovery against SAP products to get easier for whoever has it. That is a reason to keep SAP patch latency short.

My honest risk rating for a typical SAP customer as of December 1, 2026: low immediate risk, high uncertainty. The uncertainty is the problem, and only SAP can remove it.

What to do now

For SAP customers:

  1. Ask your SAP account team, in writing, four questions: which repositories were accessed, whether any of them feed shipped products, whether any released build contains unauthorised changes, and the new signing key fingerprints with guidance on how to verify them.
  2. Inventory SAP-originated code entering your environment. The CSA suggests a look-back to April 2026, which also catches anything left over from the npm incident.
  3. Pin SAP open-source dependencies to reviewed versions with lockfile integrity hashes instead of floating ranges, and turn off install-time scripts in CI where you can.
  4. Keep applying security-critical SAP Notes after normal verification. Holding every patch because of an unconfirmed report trades a known risk for an unknown one.
  5. Rotate any credentials you share with SAP-operated developer tooling or GitHub integrations, and confirm the April npm cleanup is finished (SAP Note 3747787).

For anyone running a GitHub organisation, this is a good week to check your own house. Inventory personal access tokens and move people to fine-grained, expiring tokens with SSO enforced. Require signed commits and branch protection on release branches, with the rules applied to administrators too. And stream the audit log to your SIEM, because Git events (clones, fetches, pushes) never show up in the web interface and, on Enterprise Cloud, the REST API keeps them for only seven days.

Detection and monitoring

Nobody has published indicators for this incident: no IPs, no token hashes, no branch names. So I can’t give you a rule that says “you were hit by the same people.” What I can give you is a set of rules for the behaviour the insiders describe, aimed at your own GitHub organisation. All of them read the GitHub audit log, which records a hashed_token (a SHA-256 of the token) and a programmatic_access_type on many events. That is what lets you trace one stolen token across everything it touched.

RuleCategoryLog sourceATT&CKLevel
One token clones 25+ repositories in an hourGeneric TTP (correlation)GitHub auditT1213.003, T1550.001Medium
Branch protection removed or signing / force-push rules changedGeneric TTPGitHub auditT1562.001Medium
Protected-branch override or rejected push by a tokenGeneric TTPGitHub auditT1565.001, T1550.001Medium
Git activity with a classic personal access tokenHuntingGitHub auditT1550.001Low

The one I’d switch on first is the bulk-clone correlation, because “copy source code” is the part of the story with the clearest log trail. A base rule picks out git.clone and repo.download_zip events that were authenticated with a token. The correlation then counts distinct repositories (GitHub’s common repo field; check your pipeline keeps that name) per token and fires at 25 within one hour. The threshold is my guess, not a published indicator, so tune it to your own CI and backup tooling before it pages anyone.

title: GitHub Git Clone or Source Archive Download Using an Access Token
id: 73613233-1c56-4b42-81ea-1750b63b4979
name: github_audit_git_clone_or_archive_download_by_token
status: experimental
description: |
    Base rule for the correlation below. Matches GitHub audit log git.clone and repo.download_zip events
    that carry a hashed token, meaning they were authenticated with a token or key rather than a browser session.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/identifying-audit-log-events-performed-by-an-access-token
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM with Git events included. Git events are not shown in the web UI and the Enterprise Cloud REST API keeps them for 7 days. Token metadata on Git events is in public preview. The correlation counts the repo field (a common GitHub audit field); check your pipeline does not rename it.'
detection:
    selection:
        action:
            - 'git.clone'
            - 'repo.download_zip'
    filter_main_no_token:
        hashed_token: null
    condition: selection and not filter_main_no_token
falsepositives:
    - CI runners, mirroring jobs, backup tools and code-scanning services that clone many repositories with one token
level: low
---
title: Single GitHub Access Token Clones Many Distinct Repositories Within One Hour
id: 1550313d-5018-4c24-8e89-72ca663dd413
status: experimental
description: |
    Detects one GitHub access token (grouped by hashed_token) cloning or downloading archives of 25 or more
    distinct repositories within one hour. In the SAP incident, an insider reported that stolen employee GitHub
    tokens let attackers copy source code; bulk cloning with a developer's token is how that would look in the audit log.
    Threshold and logic are inferred, not taken from a published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-sap-source-code-token-compromise-20261129/
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
    - attack.defense-evasion
    - attack.t1550.001
correlation:
    type: value_count
    rules:
        - github_audit_git_clone_or_archive_download_by_token
    group-by:
        - hashed_token
    timespan: 1h
    condition:
        gte: 25
        field: repo
falsepositives:
    - Automation tokens used by CI, backup, mirroring or code-scanning tools; allowlist their hashed_token values after review
    - Developers bootstrapping a new machine with a script that clones every team repository
level: medium

For monitoring, the hard part is retention, not logic. Git events never appear in the web interface, and on Enterprise Cloud the REST API holds them for seven days, so if you are not streaming the audit log today, you can’t look back at last month. Turn streaming on, then keep watching for protection changes and token-driven pushes for at least as long as your longest-lived token stays valid.

I wrote up all four rules, with tuning notes, lab tests and ATT&CK coverage, in a separate detection post. The YAML lives in my Detection Rules repo.

My take

SAP’s statement is written for a data breach, and this is not shaping up as one. For a company whose product is code, the sentence customers need is different: “We have verified that no unauthorised change reached any released artefact, and here is how you can check.” Until SAP says something like that, with dates, the customer-data line is reassurance about a question nobody serious was asking.

I’m not saying SAP is hiding anything. A week or two into a source-code investigation, the honest answer to “was anything altered?” is often “we’re still diffing.” Pausing pipelines and rotating keys is what I’d want them to do. But the industry has learned, the hard way, that build-pipeline compromises are judged by the release record, not by the press statement, and customers will rightly expect a code-integrity disclosure, not only a data-breach one.

The bigger pattern is boring and therefore important. Tokens are the perimeter now. This year we have seen poisoned npm packages built to steal developer tokens, a forgotten vendor key behind Barracuda’s cloud breach, and now, reportedly, employee GitHub tokens at SAP. A personal access token without an expiry date is a password with no MFA that never gets typed, so nobody notices it is gone. If you do one thing this week, list every long-lived token that can push to your release branches and kill the ones nobody can explain.

Sources