Two ways of catching one
By variable name. A piece of text stored in a variable calledkey, token, secret, password, auth, credential or api, including common variants, is reported.
By format. Some values are recognisable whatever they are called, because the service that issued them gives them a fixed prefix:
- GitHub tokens (
ghp_) - OpenAI and Stripe keys (
sk-) - AWS access key IDs (
AKIA) - Google API keys (
AIza) - Slack tokens (
xoxb-/xoxp-) - Bearer tokens written into the code
const apiKey = "..." and a real token stored in a variable called x.
Placeholders are left out automatically:
your_key_here, changeme, REPLACE_ME and all-caps templates. Reporting the example in a README would teach people to ignore the warnings. When both checks match the same line, you get one finding rather than two.CLI scanning
The CLI is the set of Iris Code commands you type in a terminal.iris secrets is free and needs no account:
Configuration
To switch secrets detection off, set this in.irisconfig.json:
inlineDiagnostics.hardcodedSecrets to false instead.
If one has already been committed
Deleting a key from a file does not delete it from your Git history: every earlier commit still contains it. Git history secrets scans past commits for exactly this case. Either way, replace the credential with a new one. A secret that has reached a shared repository should be treated as compromised.Security smells covers nine further risky patterns, such as
eval usage, SQL built from strings, weak hashing and switched-off certificate checks. They run alongside secrets detection and count toward the same Blockers total.