fleetlint Policy for a fleet of repositories
v0.3
Getting started

hooks/secret-scan

Hooks scan for secrets

Severityerror
Tiers1, 2
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.0.0-20261011205826-ecb4e9b3ffd4
Selected byfleetlint-minimal@0.1.0

Requirement

A pre-commit hook blocks commits containing secrets.

Why

Secrets must be stopped before they enter history; removing them afterwards means rotation and rewrites.

Applies when

file(".pre-commit-config.yaml")

Check

yaml(".pre-commit-config.yaml").repos.exists(r,
  r.repo.contains("gitleaks") ||
  (has(r.hooks) && r.hooks.exists(h, h.id in ["gitleaks", "detect-private-key", "detect-secrets"])))

Fix

Add the gitleaks hook (repo: https://github.com/gitleaks/gitleaks) to .pre-commit-config.yaml.

Agent instruction: Add the gitleaks pre-commit hook to .pre-commit-config.yaml and run prek update.


Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.