At a glance
- Controls
- CWE-798 · A07:2021 Identification and Authentication Failures
What it is
Secrets end up in source control when a developer hard-codes a key, commits a config file or pastes a token into a deploy workflow. Deleting the line later does not remove it. The secret stays in the repository history and in every copy of it.
Anyone with read access to the code, a leaked copy or a public fork can use the secret directly. That can mean full access to a database, a cloud account or a payment provider. AI-assisted attackers scan code and history for secret patterns at scale and test each key they find straight away.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Config files and environment templates committed by mistake
- CI and deploy workflow files with tokens written inline
- Test scripts and seed scripts with real credentials
- Old commits where a secret was added and later deleted
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Scan the current code and the full commit history through read-only GitHub access for secret patterns.
- 02Confirm each candidate is live with a harmless, read-only identity call to its provider.
- 03Report the location and scope of each live secret without using it for anything further.
No secret may be stored in source control.
Executable checkscan: every file in the repository at HEAD scan: every commit in the history expect: zero matches for key, token and password patterns expect: secrets referenced only by name from a secret store
Every rule MATT holds →What the fix looks like
- 01
Revoke and rotate every exposed secret first, since history keeps the old value.
- 02
Move secrets into a secret manager or the CI platform's encrypted secrets.
- 03
Add a secret scanner to pre‑commit hooks and to the pipeline so new leaks fail the build.
- 04
Give each secret the smallest scope it needs, so one leak opens as little as possible.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →