Skip to content

fix: gitleaks shall ignore uds-docs - #1527

Merged
bradclawsie merged 3 commits into
mainfrom
cli-321
Aug 31, 2026
Merged

bradclawsie merged 3 commits into
mainfrom
cli-321

Conversation

@bradclawsie

Copy link
Copy Markdown
Contributor

Description

After running uds run dev-docs, there is a directory uds-docs left behind (that is in .gitignore) that will be scanned by gitleaks via the pre-commit hook invoked by hk. Commits cannot take place since gitleaks will find objectionable matter in uds-docs.

This change causes gitleaks to skip the generated (and .gitignore'd) uds-docs path.
...

Related Issue

Fixes #CLI-321

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

This was tested by running uds run dev-docs and then trying to commit this PR change itself.

@bradclawsie
bradclawsie requested a review from a team as a code owner August 28, 2026 16:34
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents the local secret-scanning hook from scanning the generated uds-docs workspace.

  • Adds a narrowly root-anchored Gitleaks path allowlist for uds-docs/.
  • Aligns secret-scanner behavior with the repository’s existing ignore treatment for generated documentation.

Confidence Score: 5/5

The PR appears safe to merge because the exclusion is limited to the generated, gitignored root-level documentation workspace.

The configured path matches the exact workspace created by the documentation tasks, while the anchored expression avoids excluding similarly named paths elsewhere.

Important Files Changed

Filename Overview
.gitleaks.toml Adds a root-scoped allowlist for the ignored documentation workspace without affecting other repository paths.

Reviews (1): Last reviewed commit: "fix: gitleaks shall ignore uds-docs" | Re-trigger Greptile

@joelmccoy

Copy link
Copy Markdown
Member

The more clean fix would be to have the hk gitleaks take in files: https://github.com/defenseunicorns/uds-cli/blob/main/hk.pkl#L21

something like this?

check = "gitleaks dir --redact --no-banner --exit-code 1 {{files}}"

@bradclawsie

Copy link
Copy Markdown
Contributor Author

The more clean fix would be to have the hk gitleaks take in files: https://github.com/defenseunicorns/uds-cli/blob/main/hk.pkl#L21

something like this?

check = "gitleaks dir --redact --no-banner --exit-code 1 {{files}}"

I'm leaning on Codex here, this is my first contact with gitleaks. It responds:

gitleaks dir accepts a single path. With multiple arguments, Gitleaks 8.30.1 scans
  the first and silently ignores the rest, so:

  gitleaks dir ... {{files}}

  could miss secrets in every changed file after the first.

Suggested alternative in e3e1072 . Let me know what you think.

@bradclawsie
bradclawsie merged commit fb6677c into main Aug 31, 2026
32 of 42 checks passed
@bradclawsie
bradclawsie deleted the cli-321 branch August 31, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants