The GitHub alert I needed in 2023 was just a file name
My .env file sat on public GitHub for three years and secret scanning never said a word. The alert that would have caught it is much dumber than a secret scanner, and GitHub sends what it needs on every plan.
- Security
- GitHub
- Jutsu

In September I wrote about the .env file that sat on my public GitHub for three years. It held the production database password, a SendGrid key, an AWS key and the Google OAuth secret. Secret scanning was switched on for that repository, and so was push protection. When I finally opened the list of secret scanning alerts, it was empty.
I ended that post saying alerts have to go somewhere a person actually looks. This is the follow-up, because there's a part I skipped: which alert I needed in the first place.
It wasn't a smarter secret scanner. It was something much dumber. A file called .env went into a public repository in March 2023, and I changed it ten more times over the next four months. Every one of those pushes told GitHub the file's name.
The GitHub alerts that matter most are boring: a file name, a repository going public, a new owner. GitHub sends every one of them, on every plan, the moment it happens. Almost nobody reads them.
Leaked secrets on GitHub, in four numbers
- New secrets in public commits, 2025
- 28.65M
- Up 34% in a year (GitGuardian)
- Valid in 2022, still valid in 2026
- 64%
- GitGuardian retested them in January 2026
- Median time to fix a leaked GitHub secret
- 94 days
- Verizon 2025 Data Breach Investigations Report
- Secret scanning on private repos
- $19
- Per active committer a month, GitHub Secret Protection
Sources: GitGuardian’s State of Secrets Sprawl 2026, the Verizon 2025 DBIR (via GitGuardian’s summary) and github.com/security/plans, read on November 29, 2026.
Secret scanning reads contents. A file name gets there first.
GitHub's secret scanning looks inside files for credentials in formats it knows, and on public repositories it runs for free. That's useful, and when it fires it's a strong signal, because GitHub can check whether some keys still work.
But it matches patterns. My file had keys in formats it knows, and it still said nothing.
A file name doesn't need any of that. If a push adds a file called .env, id_rsa or credentials.json, something is wrong whatever is inside it.
That's exactly how the GitHub rule I'd have wanted works in Jutsu, where I'm the lead engineer. It fires when a push adds or changes a file whose name looks like a credential store: a .env or .env.production, an SSH or TLS private key, a cloud credentials file, a package registry token file, a Terraform variables file. It deliberately skips .env.example and .env.sample, because every scaffolded project commits those and a rule that fires on them gets switched off within a day.
It doesn't open the file, so it can be wrong, and the alert says so: Jutsu hasn't checked whether the file holds a real credential. That's the trade. A rule that reads the name fires on the push itself. A scanner that reads the contents fires later, and only on patterns it recognises.
Had something like it been watching my account in 2023, it would have fired on the first commit. It wouldn't find a file that has been sitting there for years, though. It only sees new pushes. For old leaks you still have to go looking, which is why the gh search code command from my last post is still worth running today.
The attacks of the past year were loud inside GitHub
My .env was an accident. The bigger GitHub attacks of the past 18 months were deliberate, and they were noisy in exactly the same way.
- Nx "s1ngularity", August 2025. Stolen GitHub tokens were used to rename private repositories to
s1ngularity-repository-plus five random characters and make them public. Wiz counted at least 480 accounts and more than 6,700 repositories. - GhostAction, September 2025. Hijacked maintainer accounts pushed a new workflow,
.github/workflows/github_actions_security.yml, that sent each repository's secrets to the attacker. GitGuardian traced 3,325 secrets from 817 repositories. - Shai-Hulud 2.0, November 2025. The npm worm's second wave created more than 25,000 repositories to dump the secrets it stole.
Three attacks, tens of thousands of repository events
Repositories each attack touched, by what happened to them. Each change is an ordinary GitHub event that a webhook or a GitHub App receives as it happens.
- Private repos made public
- Repos with a malicious workflow pushed
- Repos created to dump stolen secrets
Nx "s1ngularity", Aug 2025
GhostAction, Sep 2025
Shai-Hulud 2.0, Nov 2025
Sources: Wiz (“s1ngularity’s aftermath” and its Shai-Hulud 2.0 post) and GitGuardian (the GhostAction write-up), read on November 29, 2026. The counts are the researchers’ own lower bounds.
Show the data
| Attack | Repositories | What happened | Webhook signal | Source |
|---|---|---|---|---|
| Nx "s1ngularity", Aug 2025 | 6,700+ | Private repos made public | repository renamed and publicized | Wiz, September 3, 2025 |
| GhostAction, Sep 2025 | 817 | Repos with a malicious workflow pushed | push adding .github/workflows/github_actions_security.yml | GitGuardian, September 2025 |
| Shai-Hulud 2.0, Nov 2025 | 25,000+ | Repos created to dump stolen secrets | repository created | Wiz, November 2025 |
A rename, a visibility change, a workflow file in a push, a new repository. None of these are hard to detect. Each one is an ordinary GitHub event with a name you can match on.
On Free and Team, webhooks are what you get
This is where it gets awkward for small teams. GitHub's organization audit log keeps 180 days of events, but the audit log API needs GitHub Enterprise Cloud, and standalone organizations can't stream it anywhere. On Free and Team, the audit log is a web page you have to remember to open.
What every plan does get is webhooks. GitHub's own docs say they "might be a good alternative to the audit log." A push event lists the files each commit added and changed. A repository event says when one was made public. An organization event says when someone was added. They arrive as things happen.
There's one gap I didn't expect. Turning off the organization's two-factor requirement has no webhook at all. You only see it by reading the organization's settings through the API, on a schedule, and comparing.
What I'd do this week
If you run a GitHub organization and nobody is watching it, this is where I'd start:
- Search for what's already there.
gh search code --owner <your-org> --filename .envlists every.envin your public repositories. Rotate anything real you find first, then deal with the history. - Require two-factor authentication for the whole organization. It's on every plan.
- Restrict classic personal access tokens in the organization's token policy, and keep admin approval on for fine-grained ones.
- Turn on push protection wherever you can. It's free on public repositories. Private ones need GitHub Secret Protection at $19 per active committer a month.
- Pin GitHub Actions to a full commit SHA. Since August 2025 the organization policy can make unpinned actions fail.
- Send the webhooks somewhere a person reads. A Slack channel nobody mutes beats a dashboard nobody opens.
Where Jutsu fits
Full disclosure again: I'm the lead engineer at Jutsu, so weigh this accordingly.
Jutsu connects to a GitHub organization or a personal account through a GitHub App. It can read code, settings and members but can't change any of them. It runs 22 GitHub rules on the events above, including the file-name one, and reads the organization's two-factor settings and members every six hours for the changes that have no webhook.
When a key leaks, the alert doesn't hand you an AI essay. It gives you a checklist built from GitHub's finding, in the order that matters: rotate first, and only then close the GitHub alert, because closing it revokes nothing.

What it doesn't do: it doesn't read the audit log, and it can't rotate your keys or change your GitHub settings for you. You still do those yourself. We wrote the full guide on the Jutsu blog, with the table of events to alert on and the settings to turn on first.
The verdict
My mistake in 2023 wasn't exotic, and neither were the 2025 attacks. They renamed things, made them public and pushed files with obvious names. GitHub reported all of it, and on Free and Team plans the webhooks were there the whole time.
I wrote last time that an alert nobody sees is the same as no alert. The harder truth is that in 2023 I didn't even have the alert. The signal was there. Nothing was listening.
A note on sources: the secrets numbers are from GitGuardian's State of Secrets Sprawl 2026 and Verizon's 2025 DBIR, via GitGuardian's summary. The attack details are from Wiz on s1ngularity, Wiz on Shai-Hulud 2.0 and GitGuardian on GhostAction. GitHub plan details are from GitHub's pricing page, its security plans page and GitHub Docs. Everything was read on November 29, 2026. The description of Jutsu's rules comes from its code. Everything written as "I'd" or "I think" is my opinion.