Skip to content

fix(security): scope native metadata false positives exactly - #4

Closed
Fergus-MW wants to merge 1 commit into
mainfrom
codex/gitleaks-native-provenance-20261104
Closed

Fergus-MW wants to merge 1 commit into
mainfrom
codex/gitleaks-native-provenance-20261104

Conversation

@Fergus-MW

@Fergus-MW Fergus-MW commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

The inherited generic-api-key rule mistakes one public Xano resource route and three source-file SHA256 values for credentials in pipelines PR1133. Extend only that rule with two reviewed allowlists requiring both an exact file path and the entire exact finding match. No file, commit, arbitrary hash, or credential format is excluded; other findings on the same line still block.

Default and custom credential rules, history ranges, caller-suppression rejection, redaction, scanner-error handling, and enforcement remain unchanged. The three hashes were recomputed from their source bytes; the two connector versions also match immutable Git blobs at 3239387f61d1ed01b0c18fd2a7dc1d686dbcc198.

Validation with pinned Gitleaks 8.30.1:

  • The actual PR1133 history range 733f7efc88e3e0a83590bc00ee43e672d5fa1a19..52f76693cb0161454bc68e628b2847c32c2a3431 --diff-merges=first-parent reproduces four findings before and zero after. The workflow scan step and direct scanner enforcement agree.
  • Seven actual-workflow tests pass. Exact metadata passes PR and full-history scans; generic and AI Brain synthetic credentials in the same files and on the same lines still fail. Changed values, other paths and assignment names still fail. Removed credentials and merge-resolution credentials remain detectable. Reports omit values and raw output is removed.
  • The two new false-positive regression tests fail on the original policy in all four PR/full-history subcases, then pass with this policy.
  • All four native-stack PR history ranges pass with the proposed policy. The central PR history range passes too.
  • actionlint, new-test Ruff checks and formatting, and git diff --check pass.

Run PATH="<gitleaks-8.30.1-bin>:$PATH" python3 -m unittest discover -s tests -v to reproduce the durable policy tests. Configuration semantics follow Gitleaks v8.30.1 rule-specific allowlists.

Rollout remains separate: review this central policy, then pin its immutable commit in the pipelines foundation workflow and restack descendants. No caller workflow has been edited, no PR has been merged, and none of the native image's 281 build inputs changed.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Credential scanning now permits a small set of exact, reviewed values while continuing to flag other credentials and variations.
  • Documentation
    • Updated guidance to explain the exceptions and how to run the expanded credential-scanning tests.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Gitleaks workflow adds exact-match exceptions for one public route and three catalog digests. The README documents these exceptions and the test command. Integration tests check allowed matches, non-matching credentials and metadata, and scan results for PR ranges and full history.

Changes: Credential scan exceptions

Layer / File(s) Summary
Define and document exact-match exceptions
.github/workflows/gitleaks.yml, README.md
The generic-api-key rule allows the specified route and catalog digests only when both the repository-relative path and full match meet the configured conditions. The README documents these exceptions and states that other findings remain subject to the inherited rule.
Verify scan behaviour
tests/test_native_false_positives.py, README.md
Integration tests run the workflow against temporary Git repositories. They check allowed matches, other credentials and metadata, changed paths and values, and PR-range versus full-history results. The README updates the test command and coverage description.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: kert114

Merge Risk: Minimal · up to 8ac6b

No merge-blocking risk is established. Run the documented scanner tests before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(security): scope native metadata false positives exactly" matches the main change. The PR adds two exact-match Gitleaks allowlists for the generic-api-key rule, covering one public Asym…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(security): scope native metadata false positives exactly" matches the main change. The PR adds two exact-match Gitleaks allowlists for the generic-api-key rule, covering one public Asymmetrix companies route and three source-file SHA256 provenance entries. The title is concise, specific, and follows a conventional commit style. It does not list files and does not use vague terms.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 1 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Errors were encountered while retrieving linked issues.

Errors: 1
  • LINEAR integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 42eb7ca2-24f2-4637-9ed9-ace63ab78264
Commits

Reviewing files that changed from the base of the PR and between 5075c00 and 8ac6b3c.

Files selected for processing: 3
  • .github/workflows/gitleaks.yml
  • README.md
  • tests/test_native_false_positives.py

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@kert114

kert114 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Superseded by #7, which landed these same four false-positive exceptions on main (ada7359) with your authorship kept. Thanks Fergus.

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