repo/no-tracked-env
No .env files are tracked
| Severity | error |
| Tiers | all |
| Stacks | any |
| Scope | each |
| Kind | expr |
| Source | library v0.0.0-20261011205826-ecb4e9b3ffd4 |
| Selected by | fleetlint-minimal@0.1.0 |
Requirement
Environment files that may hold credentials are never committed; templates with placeholder values (.env.example, .sample, .template, .dist) and encrypted files (.sops, .enc, .age, .gpg, .asc) are fine.
Why
A tracked .env is the most common way credentials leak into history.
Check
For each item in:
tracked().filter(f, f.matches('(^|/)\\.env(\\.[^/]*)?$')
&& !f.matches('\\.(example|sample|template|dist|sops|enc|age|gpg|asc)$'))falseFix
git rm –cached the .env file, add .env* to .gitignore, rotate any secret it contained.
Agent instruction: Untrack the .env file, add .env and .env.* (but not .env.example) to .gitignore, and tell the user which secrets must be rotated.
See: https://fleetlint.org/baseline/#security
Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.