A scanner that reads its rules from the repository it is scanning can be told what to look for by that repository. If you run Gitleaks (a secret scanner) or Semgrep (a static analyzer) over code you do not fully control and file the clean report as evidence, this post gives you a way to bind that report to the config, ignore files, environment and scanner binary observed around the scan, and to refuse to call it clean when that binding fails.
When no --config flag is passed, Gitleaks picks its config from an environment variable naming a file, a second environment variable holding the TOML config text itself, a .gitleaks.toml at the target root, or its embedded defaults, in that order. It also honours a root .gitleaksignore . Semgrep has its own selectors and its own ignore sources, including .semgrepignore .…