Yellow Theme

Next start · October 2026

Notes / 11

2026-09-13

The example key does not fail the scan

We published a secret-scan sample so a reader could watch a pull request fail on a planted key. That file is not on the required job, so the default branch should stay green. The planted string is the AWS documentation example, AKIAIOSFODNN7EXAMPLE. It is not a credential. We pointed the default scanner at that file. It exited 0 and said no leaks were found.

Thesis: Default gitleaks rules ignore that well-known example. A fixture that uses it will not prove the scanner works unless a local rule names the string. The job that is supposed to stay green must not load that rule, or the sample fails for the demonstration instead of for a real leak.

What we tried first

The sample has two paths. The required job scans the application tree and should pass when that tree is clean. A second command, written in the README, points at a fixture and should fail, so a reader can see the gate work without turning the default branch red. We put the example key in the fixture and ran the default rules against it. Exit code 0. "No leaks found." The required job was also green, which is what we wanted. The fixture was green for the wrong reason. A documented fail path that passes does not demonstrate the control.

The working shape

The fail command uses a config with one rule for that exact string. Default rules stay on the required job. That job does not scan the fixture directory.

default rules on the example key → exit 0
local rule for that string → exit 1
required job does not load the local rule

Checklist

Related: the action tag fails before it scans. The fixture is in the public sample. How we deliver: methodology.

Engineering commentary only — not audit, legal, or certification advice.