Skip to content

Secret-scan hygiene: canary values and scanner policy - #15

Merged
imanimanyara merged 2 commits into
mainfrom
chore/secret-hygiene
Oct 8, 2026
Merged

imanimanyara merged 2 commits into
mainfrom
chore/secret-hygiene

Conversation

@imanimanyara

Copy link
Copy Markdown
Member
  • Replace the hunter2, hunter22 and s3cr3t dummies in tests and docs with redaction-canary-not-a-secret.
  • Build the credentialed URLs in SecretRedactorTest and the ThrowCommand fixture from a variable at run time, so no URL-with-password literal is in the source. Assertions are unchanged.
  • Docs describe the URL shape as scheme://<user>:<password>@host; the one redacted-output example in docs/tools/output.md carries an inline gitleaks:allow comment.
  • Add .gitleaks.toml and .gitguardian.yaml, both allowlisting tests/Fixtures/ only.

Verified locally: secret_scan.py check --worktree exits 0; pest 253 passed (667 assertions); phpstan, pint --test and rector --dry-run clean.

The redaction tests and docs used hunter2, hunter22 and s3cr3t, which
secret scanners report as leaked credentials. They now use
redaction-canary-not-a-secret, which no scanner mistakes for a key.

SecretRedactor masks passwords in URLs, so its tests need a credentialed
URL. The unit test and the ThrowCommand fixture now assemble it from a
variable, so no URL-with-password literal sits in the source; the
assertions are unchanged. The docs describe the shape with template
syntax (scheme://<user>:<password>@host), and the one redacted-output
example that must show the mask carries an inline gitleaks:allow marker.
Both allowlist tests/Fixtures only, so a fixture's fake value does not
fail a scan while src/, docs and the rest of tests stay fully scanned.
The GitGuardian GitHub App ignores .gitguardian.yaml; its exclusions
live in the GitGuardian dashboard.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@imanimanyara
imanimanyara merged commit 9f7a4a7 into main Oct 8, 2026
11 checks passed
@imanimanyara
imanimanyara deleted the chore/secret-hygiene branch October 8, 2026 19:49
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