Standard: secrets hygiene (OWASP)
Secrets hygiene by OWASP (Secrets Management Cheat Sheet, ASVS 4.0.3 V2.10.4): no keys or tokens in repository files, .env does not get into git; a finding is only the file, the line and the kind, the value is not printed.
About the package
What the standard is. Basic secrets hygiene by OWASP. Sources: the OWASP Secrets Management Cheat Sheet (https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) and requirement V2.10.4 of OWASP ASVS 4.0.3 (https://github.com/OWASP/ASVS/tree/v4.0.3): passwords, API keys and other secrets are not kept in source code or in the repository. A secret lives in the environment or in a secret store; a leaked secret is revoked and issued again.
When to install. Always, when the project has git and at least one external service. Especially when agents write in the project: they easily paste a key from the environment straight into a file.
How to configure. The page /norms/standards/owasp-secrets.md: what not to scan (exclude, lock files by default), allow markers on a line (allowMarkers, secrets:allow and gitleaks:allow by default), the entropy and length threshold for the heuristic (minEntropy, minLength), the file size limit (maxBytes). A line with an allow marker is not checked: that is how an example in documentation or a test key is marked.
Values are not printed. A finding is a file, a line and the kind of secret. The package never prints the value itself: a check's output ends up in logs and in the agent's context.
What is checked
- SCR-R01 (MUST, enforce): no secrets of known formats: PEM/OpenSSH/PGP private keys (the header and the key body), AWS keys, GitHub, GitLab, Slack, npm, Hugging Face and DigitalOcean tokens, live Stripe keys, Google API keys, OpenAI, Anthropic, SendGrid, Telegram bot tokens,
_authTokenin.npmrc. Obvious placeholders (EXAMPLE,xxxx,${…}) are skipped. Theknowncheck. - SCR-R02 (SHOULD, observe): looks like a secret: a quoted string of 16 characters or more with high entropy under a name like
password,token,api_key,secret; a password in an addressscheme://user:password@host(except example hosts:example.com,.invalid,.test,localhost); a JWT. It is a heuristic, so it observes. Thelikelycheck. - SCR-R03 (MUST, enforce):
.envis ignored by git (git check-ignore; without git, a line in.gitignore); the repository has no environment files.env,.env.productionand similar (the templates.env.example,.env.sample,.env.templateare fine) and no private key files (id_rsa,id_ed25519,.p12,.pfx,.jks,.keystore). Theenvcheck. - SCR-R04 (SHOULD, observe): what a machine does not see: where secrets are stored, who has access to them, how they are revoked. The judge is
judges/secrets-hygiene.md.
Files are taken from git: tracked and new ones, without ignored ones (those will not be committed anyway). Without git, by walking folders. Binary files and files larger than maxBytes are skipped.
shtuk run std-owasp-secrets history [--last N | --all] looks for secrets of known formats in the lines that past commits added. This is not a check: a secret from history has to be revoked, and rewriting history is the owner's decision.
What is not checked
- A secret with no known format and low entropy (a short password): it cannot be told apart from an ordinary string.
- Whether a found key is real and still alive: the package does not go to services.
- Secrets in binary files, archives, images and outside the repository (CI, cloud).
The package only reads files and asks git (ls-files, check-ignore, log). It writes nothing.
Norms 4
| ID | Norm | Level | Mode | Enforcer |
|---|---|---|---|---|
| SCR-R01 | MUST | blocks | check |
|
| SCR-R02 | SHOULD | observes | sensor |
|
| SCR-R03 | MUST | blocks | check |
|
| SCR-R04 | SHOULD | observes | judge |
"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.
Actions 4
| Name | What it does | File | When |
|---|---|---|---|
| known | No secrets of known formats in repository files norm SCR-R01 | checks/scr01_known.ts | check |
| likely | Looks like a secret: name and entropy, a password in an address, a JWT (observes) norm SCR-R02 | checks/scr02_likely.ts | check |
| env | .env is ignored by git, no environment or key files in the repository norm SCR-R03 | checks/scr03_env.ts | check |
| history | Secrets of known formats in git history (--last N, --all) | checks/history.ts | shtuk run |
shtuk check runs the checks; shtuk run std-owasp-secrets <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.
Pages 5
They go into the project at these paths.
- /norms/rules/std-owasp-secrets/
- No secrets of known formats in repository files SCR-R01
- No values that look like a secret in files SCR-R02
- .env is ignored by git; no environment or key files in the repository SCR-R03
- Secrets are stored, issued and revoked by the rules SCR-R04
- /norms/standards/
- Settings: secrets hygiene (OWASP) page
Package files 9
They go into .shtukbase/packages/std-owasp-secrets/; actions run from there.