SAP has confirmed to BleepingComputer that it took urgent action to protect customers after detecting suspicious activity in its IT environment tied to GitHub. While the full scope of the incident is still being assessed, the core lesson for defenders is one we've seen play out repeatedly in 2025 and into 2026: GitHub — and developer platforms like it — have become one of the highest-value targets in enterprise intrusion campaigns. When a company the size and security maturity of SAP confirms suspicious activity around its code repositories, every organization hosting proprietary source code, CI/CD pipelines, or developer credentials on GitHub should treat this as a forcing function to audit its own exposure.
This post breaks down what defenders should assume about the threat model, how to hunt for the same tradecraft in your environment, and the concrete hardening steps that materially reduce the blast radius of a GitHub-centric compromise.
Why GitHub Incidents Are Never "Just a Repo Problem"
In nearly every source-code-platform incident I've responded to, the initial exposure is only the beginning. Attackers target GitHub organizations for four reasons:
- Hardcoded secrets. Private repositories routinely contain API keys, OAuth tokens, database connection strings, cloud credentials, and signing certificates committed by developers. A single exposed personal access token (PAT) or service account key can convert read-only repo access into production cloud compromise.
- Supply chain leverage. Access to source code — especially for a vendor like SAP whose software runs inside thousands of enterprises — enables attackers to hunt for undisclosed vulnerabilities and craft targeted exploits against downstream customers.
- CI/CD pipeline hijacking. Workflow files (
.github/workflows/*.yml) define what runs, with what secrets, on every commit. An attacker who can modify a workflow can execute arbitrary code inside your build environment and exfiltrate pipeline secrets. - Identity pivoting. Developer accounts are often over-privileged, lack phishing-resistant MFA, and hold long-lived PATs and SSH keys that bypass SSO enforcement.
SAP's confirmation that it acted "urgently" to protect customers strongly implies the company treated repository and credential exposure as a direct customer risk — which is exactly the right posture, and exactly what your organization should replicate.
Threat Model: What "Suspicious GitHub Activity" Typically Looks Like
Based on the incident pattern described, defenders should hunt for the following attack chain:
- Initial access: Compromised developer credentials, a leaked PAT (via phishing, infostealer malware, or accidental public commit), or a stolen session token.
- Discovery: Enumeration of organization repositories, team memberships, and secrets via the GitHub API (
/orgs/{org}/repos,/user/repos, code search). - Collection: Mass cloning (
git clone --mirror), bulk archive downloads (repo.download_zipaudit events), or use of the GitHub API to pull file contents at scale — often from unusual IP addresses, VPN exits, or residential proxies. - Persistence: Creation of new PATs, SSH keys, OAuth app authorizations, or a rogue collaborator invitation to survive password resets.
- Follow-on exploitation: Secrets harvested from code used against cloud providers, artifact registries, or production systems.
No CVE is associated with this incident — this is a credential- and access-abuse scenario, not a patchable software flaw. The fix is detection coverage and architectural hygiene, not a vendor hotfix.
Exploitation Status
SAP has confirmed suspicious activity and stated it took urgent protective action. As of this writing, there is no public confirmation of customer data exfiltration or downstream exploitation — but the window between initial access and monetization is shrinking across the industry. Treat any anomalous activity in your own GitHub organization as an active incident until proven otherwise.
Detection & Response
Sigma Rules
The following rules target endpoint-level behaviors we observe in GitHub-focused intrusions: bulk/mirror cloning of repositories, execution of secrets-harvesting tools, and access to stored Git credentials on disk. Tune the organization-specific strings before deployment.
---
title: Mass or Mirror Git Repository Cloning
description: Detects git clone operations using --mirror or bulk cloning patterns, consistent with attacker collection of entire repository contents after credential compromise.
references:
- https://www.bleepingcomputer.com/news/security/sap-confirms-security-incident-after-suspicious-github-activity/
- https://attack.mitre.org/techniques/T1213/
author: Security Arsenal
date: 2026/04/06
status: experimental
id: 3f8a2c1d-9b4e-4a7f-b2c6-5d1e8f9a0b3c
tags:
- attack.collection
- attack.t1213
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith:
- '\git.exe'
CommandLine|contains:
- 'clone --mirror'
- 'clone --bare'
filter_legit_ci:
CommandLine|contains:
- 'C:\actions-runner\'
- 'C:\BuildAgent\'
condition: selection and not filter_legit_ci
falsepositives:
- Legitimate repository backups and migrations performed by administrators
- CI/CD runner activity (filter or scope by host)
level: medium
---
title: Secrets Scanning Tool Execution on Endpoint
description: Detects execution of secrets-harvesting tools (TruffleHog, Gitleaks, etc.) commonly used by attackers to locate credentials in cloned source code. Also used legitimately by security teams — scope by user/host.
references:
- https://www.bleepingcomputer.com/news/security/sap-confirms-security-incident-after-suspicious-github-activity/
- https://attack.mitre.org/techniques/T1552/
author: Security Arsenal
date: 2026/04/06
status: experimental
id: 7c2e5a91-4d3b-4f8e-a1c9-6b7d2e5f8a1d
tags:
- attack.credential_access
- attack.t1552.001
logsource:
category: process_creation
product: windows
detection:
selection_img:
Image|endswith:
- '\trufflehog.exe'
- '\gitleaks.exe'
- '\git-secrets.exe'
- '\shhgit.exe'
selection_cli:
CommandLine|contains:
- 'trufflehog github'
- 'gitleaks detect'
- 'gitleaks git'
condition: 1 of selection_*
falsepositives:
- Internal red team and AppSec scanning — maintain an allowlist of authorized hosts/users
level: high
---
title: Access to Stored Git Credential Files
description: Detects read access to Git credential stores and GitHub CLI token files, which attackers target to harvest developer PATs and session tokens after initial compromise.
references:
- https://www.bleepingcomputer.com/news/security/sap-confirms-security-incident-after-suspicious-github-activity/
- https://attack.mitre.org/techniques/T1552/
author: Security Arsenal
date: 2026/04/06
status: experimental
id: 9d4f7b23-1e5c-4a9d-b3f8-2c6a9e1d4f7b
tags:
- attack.credential_access
- attack.t1552.001
logsource:
category: file_event
product: windows
detection:
selection:
TargetFilename|endswith:
- '\.git-credentials'
- '\.gitconfig'
- '\.config\gh\hosts.yml'
- '\.ssh\id_rsa'
- '\.ssh\id_ed25519'
filter_legit:
Image|endswith:
- '\git.exe'
- '\gh.exe'
- '\Code.exe'
- '\sshd.exe'
condition: selection and not filter_legit
falsepositives:
- Developer tooling, editors, and backup software reading configuration files
level: medium
KQL — Microsoft Sentinel / Defender Hunting
The highest-fidelity source for this threat is GitHub's own audit log. If you ingest the GitHub Enterprise audit log into Sentinel (via the native GitHub connector or API streaming into GitHubAuditLog_CL), hunt for mass collection and persistence events. A Defender-side query covers endpoint credential access.
// Hunt 1: Anomalous repository cloning / archive downloads in GitHub audit log
// Detects a single actor downloading or cloning an unusual volume of repos in 24h
GitHubAuditLog_CL
| where TimeGenerated > ago(7d)
| where Action_s in ("repo.clone", "repo.download_zip", "repo.archive")
| summarize RepoCount = dcount(Repository_s),
Repos = make_set(Repository_s, 50),
IPs = make_set(IPAddress_s),
UserAgents = make_set(UserAgent_s)
by Actor_s, bin(TimeGenerated, 1d)
| where RepoCount > 10
| sort by RepoCount desc
;
// Hunt 2: Persistence — new PATs, SSH keys, or OAuth authorizations created
GitHubAuditLog_CL
| where TimeGenerated > ago(14d)
| where Action_s in ("personal_access_token.create", "public_key.create",
"oauth_application.create", "oauth_authorization.create",
"org.add_member", "repo.add_collaborator")
| project TimeGenerated, Actor_s, Action_s, IPAddress_s, Repository_s, UserAgent_s
| sort by TimeGenerated desc
;
// Hunt 3: Endpoint access to Git/GitHub credential stores (Defender for Endpoint)
DeviceFileEvents
| where TimeGenerated > ago(7d)
| where FileName in~ (".git-credentials", "hosts.yml", "id_rsa", "id_ed25519")
or FolderPath has_any ("\\.config\\gh\\", "\\.ssh\\")
| where InitiatingProcessFileName !in~ ("git.exe", "gh.exe", "sshd.exe", "Code.exe",
"WindowsBackup", "MsMpEng.exe")
| project TimeGenerated, DeviceName, AccountName, FileName, FolderPath,
InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by TimeGenerated desc
Velociraptor VQL — Hunt for Exposed Git Credentials on Endpoints
Use this artifact across your fleet to identify stored GitHub credentials and recently created clone artifacts that may indicate attacker collection or user-side exposure:
-- Hunt for stored Git credentials, GitHub CLI tokens, and recent mirror-clone artifacts
SELECT Fqdn,
file.FullPath AS CredentialFile,
file.Modified AS LastModified,
file.Size AS SizeBytes
FROM foreach(
row={ SELECT Name FROM pslist() WHERE Name =~ '(?i)git|gh' },
query={
SELECT * FROM glob(globs=[
'C:/Users/*/.git-credentials',
'C:/Users/*/.config/gh/hosts.yml',
'C:/Users/*/.ssh/id_*',
'/home/*/.git-credentials',
'/home/*/.config/gh/hosts.yml',
'/root/.git-credentials'
])
})
-- Hunt for running git clone operations and their command lines (live collection activity)
SELECT Pid,
Name,
Exe,
CommandLine,
Username,
CreateTime
FROM pslist()
WHERE Name =~ '(?i)git'
AND CommandLine =~ '(?i)clone'
AND CommandLine =~ '(?i)(--mirror|--bare)'
Hardening & Audit Script
Use this script to rapidly audit a GitHub organization for the exact persistence and exposure mechanisms in the threat model — new PATs, stale deploy keys, outside collaborators, and unrotated secrets — and to enumerate endpoint credential files for scoping.
#!/usr/bin/env bash
# GitHub Organization Security Audit — run with a GitHub App token or PAT (admin:org scope)
# Usage: GITHUB_TOKEN=<token> ORG=<your-org> ./github_org_audit.sh
set -euo pipefail
ORG="${ORG:?Set ORG env var}"
AUTH="Authorization: Bearer ${GITHUB_TOKEN:?Set GITHUB_TOKEN env var}"
API="https://api.github.com"
echo "=== [1] Outside collaborators (unexpected external access) ==="
curl -s -H "$AUTH" "$API/orgs/$ORG/outside_collaborators?per_page=100" \
| jq -r '.[].login' || echo "none"
echo "=== [2] Members with legacy/2FA-disabled accounts ==="
curl -s -H "$AUTH" "$API/orgs/$ORG/members?filter=2fa_disabled&per_page=100" \
| jq -r '.[].login' || echo "none"
echo "=== [3] Deploy keys with write access (per repo) ==="
for repo in $(curl -s -H "$AUTH" "$API/orgs/$ORG/repos?per_page=100" | jq -r '.[].name'); do
keys=$(curl -s -H "$AUTH" "$API/repos/$ORG/$repo/keys" | jq -r '.[] | select(.read_only==false) | .title')
[ -n "$keys" ] && echo "$repo: WRITE deploy key -> $keys"
done
echo "=== [4] Audit log: token/key/OAuth creation events (last 7 days) ==="
curl -s -H "$AUTH" \
"$API/orgs/$ORG/audit-log?phrase=action:personal_access_token.create+created:>$(date -u -d '7 days ago' +%Y-%m-%d)" \
| jq -r '.[] | "\(.created_at) \(.actor) \(.action) from \(.ip // "n/a")"' || \
echo "Audit log API requires GitHub Enterprise — review web UI instead"
echo "=== [5] Repos with secret scanning alerts open ==="
for repo in $(curl -s -H "$AUTH" "$API/orgs/$ORG/repos?per_page=100" | jq -r '.[].name'); do
count=$(curl -s -H "$AUTH" "$API/repos/$ORG/$repo/secret-scanning/alerts?state=open" | jq 'length')
[ "$count" != "0" ] && echo "$repo: $count open secret-scanning alerts"
done
echo "Audit complete. Rotate ANY credential flagged above immediately."
Remediation & Hardening
If your organization discovers similar suspicious activity, execute in this order:
- Assume credential compromise. Revoke and rotate all PATs, fine-grained tokens, OAuth tokens, SSH keys, and deploy keys for any account that touched anomalous activity. Password resets alone do not kill token-based persistence.
- Kill persistence vectors. Audit for newly created SSH keys, PATs, OAuth app authorizations, GitHub Apps, webhooks, and outside collaborators added in the lookback window. Remove anything not provably legitimate.
- Rotate secrets found in code — don't just delete commits. Deleting a commit does not remove a secret from git history, forks, or caches. Rotate every exposed credential at the provider, then scrub history with
git filter-repoor GitHub's support-assisted removal. - Enforce phishing-resistant MFA and SSO. Require SAML SSO with your IdP and hardware-key or passkey MFA for all org members. Remove any member flagged by the
2fa_disabledquery above. - Enable GitHub's native controls: secret scanning with push protection (blocks secrets at commit time), dependency review, and code scanning on all repos — these are available on GitHub Enterprise and free for public repos.
- Reduce token blast radius. Migrate long-lived PATs to fine-grained tokens with expiration ≤ 90 days, or better, eliminate interactive PAT use in favor of GitHub Apps and OIDC-based CI/CD identity (no stored cloud secrets in Actions).
- Constrain network exposure. If on GitHub Enterprise Cloud, enable IP allow lists for the organization and IdP conditional access policies restricting token use to corporate egress.
- Stream audit logs. Configure GitHub audit log streaming to your SIEM (Sentinel, Splunk, S3) — retention inside GitHub's UI alone is insufficient for forensic lookback during an incident.
- Validate CI/CD integrity. Review all
.github/workflows/*.ymlchanges in the lookback window, pin third-party Actions to full commit SHAs, and require approvals for workflow runs from forked/external contributors. - Engage your supply chain. If you consume SAP products (or any vendor reporting repo incidents), monitor their security advisories and the SAP Security Notes portal for any follow-on guidance, and inventory where that vendor's software and credentials exist in your environment.
References: BleepingComputer — SAP confirms security incident · GitHub Secret Scanning & Push Protection · GitHub Audit Log Streaming
Related Resources
Security Arsenal Managed SOC Services AlertMonitor Platform Book a SOC Assessment soc-mdr Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.