Skip to content

fix(security): accept reviewed platform fixtures, placeholders and hashes by commit and path - #11

Open
kert114 wants to merge 1 commit into
mainfrom
fix/platform-fixture-exceptions
Open

kert114 wants to merge 1 commit into
mainfrom
fix/platform-fixture-exceptions

Conversation

@kert114

@kert114 kert114 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Platform's weekly full-history credential scan has failed since it started. After #10, it still reports 19 path/rule pairs. 17 of them are test fixtures, documentation placeholders, a public OAuth client ID, a Secret Manager secret name and file hashes. The code owner approved excepting them. While the scan is always red, a new real finding in history would look like the usual failure.

Fix

  • Add 13 exceptions to the platform-only block. Each matches rule, path and the exact commits that added or carried the finding, all together.
  • Each exception covers one file, except two: the two entity-retriever docs share their commits and rule, and so share one exception.
  • Any other commit on these paths is still scanned and blocked.
  • No secret value appears in the exceptions.
  • The two .env findings on the stale branch cursor/docx-spurious-paragraphs-6ea9 are deliberately left out. They may be real credentials and need the owner's rotation decision.

Verification

  • Real history: I ran the workflow's scan step locally with gitleaks 8.30.1 over all platform history (FULL_HISTORY=true, REPOSITORY=60xAI/ai-brain-platform):
    • main (f15f7ec4): result=10, 19 path/rule pairs;
    • this branch: result=10, only azure-ad-client-secret .env and generic-api-key .env remain.
  • New test: test_platform_fixture_exceptions_only_cover_their_own_commits commits a synthetic key on an excepted fixture path in a new commit and requires the scan to block it.
  • Full suite: python3 -m unittest discover -s tests passes.
  • An independent review confirms that each excepted finding is not a live credential, without printing values.

Risk and rollback

Two-way door. Scan configuration only. Revert the commit to roll back.


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

Summary by CodeRabbit

  • Security
    • Secret scanning now recognizes approved fixtures, placeholders, and documentation examples in specified files and commits.
    • Added a check confirming that a synthetic API key in a test file is still flagged.

@cursor

cursor Bot commented Nov 17, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@kert114 kert114 added the two-way door Cheap to reverse and restore the previous behavior. label Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Gitleaks workflow adds commit- and path-bound allowlists for reviewed fixtures and values. A test verifies that a synthetic key outside the allowed commits is reported as a finding.

Changes: Scoped Gitleaks exceptions

Layer / File(s) Summary
Add commit- and path-bound allowlists
.github/workflows/gitleaks.yml
The workflow adds exceptions for specified rules, commits and paths. The exceptions cover test fixtures, placeholders, documentation headers and file hashes.
Check exception commit scope
tests/test_secret_scan.py
A test scans a synthetic key in a temporary Git repository and checks that the scan returns result=10 with a generic-api-key finding.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • 60xAI/.github#10: Adds an exception for the same auth.py path and rule, overlapping with the finding described for this PR.

Suggested labels: two-way door

Suggested reviewers: fergus-mw

Merge Risk: Minimal · up to 76e4c

This change narrows secret-scan exceptions to specific reviewed commits and paths, and a test confirms that new commits on those paths are still scanned. It has no runtime impact and can be reverted cleanly. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a security fix that accepts reviewed platform fixtures, placeholders and hashes, scoped by commit and path. The raw summary and PR objectives confirm that the change a…
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 names the main change: a security fix that accepts reviewed platform fixtures, placeholders and hashes, scoped by commit and path. The raw summary and PR objectives confirm that the change adds Gitleaks allowlists bound to specific rule IDs, paths and commits, plus a test for the synthetic key case. The title is specific and accurate, though it is long at 92 characters, which is above the preferred concise length.

Finishing Touches

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: 42b9eade-3dca-48f0-808b-fc276036f524
Commits

Reviewing files that changed from the base of the PR and between f15f7ec and 76e4c82.

Files selected for processing: 2

  • .github/workflows/gitleaks.yml
  • tests/test_secret_scan.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

two-way door Cheap to reverse and restore the previous behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant