Skip to content

fix(security): accept the reviewed platform sign-in webhook by commit and path - #10

Merged
kert114 merged 1 commit into
mainfrom
fix/platform-webhook-exception
Nov 17, 2026
Merged

kert114 merged 1 commit into
mainfrom
fix/platform-webhook-exception

Conversation

@kert114

@kert114 kert114 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Platform's weekly full-history credential scan has failed since it started (run https://github.com/60xAI/ai-brain-platform/actions/runs/43804138912). One of its 20 path/rule pairs is the sign-in Slack webhook in backend/app/api/routes/auth.py, rule slack-webhook-url. The code owner reviewed it and decided to keep it (https://github.com/60xAI/ai-brain-platform/issues/1601). The same webhook in pipelines history was handled in #9.

Fix

  • Add one exception, active only when the caller is 60xAI/ai-brain-platform. It matches rule, path and exact commit together.
  • It lists the five commits that added or carried the webhook on platform development: 3757fbb3, 43c569cf, 9799135e, b83bddef, dd8da03b.
  • The same value or path in any other commit still fails.
  • No secret value appears in the exception.
  • It is a top-level [[allowlists]] with targetRules, like the pipelines block, not a second [[rules]] block (see Secret scan: a second generic-api-key rule block silently drops the first block's exceptions for the workspace #8).

Verification

  • Real history: I ran the workflow's scan step locally with gitleaks 8.30.1 over a fresh clone of all platform history (FULL_HISTORY=true, REPOSITORY=60xAI/ai-brain-platform):
    • main (b07fd2dd): result=10, 20 path/rule pairs, including slack-webhook-url backend/app/api/routes/auth.py;
    • this branch: result=10, the same pairs minus the webhook pair (19).
  • New test: test_platform_webhook_exception_only_covers_its_own_commits commits a synthetic, unissued webhook on the excepted path in a new commit and requires the scan to block it. With the commits binding removed, it fails; with the binding, it passes.
  • What each check proves: the new test is the blocking side: a new commit on the excepted path still fails. A test cannot create the five historical commit SHAs, so the suppression side is proven by the real-history scan above.
  • Full suite: python3 -m unittest discover -s tests: 10 tests OK.

What this does not fix

The scan stays red on 19 other pairs. Two are on .env in a stale branch (cursor/docx-spurious-paragraphs-6ea9) and may be real credentials, so they need a rotation review, not an exception. The other 17 look like test fixtures, placeholders, Secret Manager names and hashes, and need an owner decision before any exception is added.

Rollout

After this lands, platform's secret-scan.yml pin moves to the new main commit in its own PR.

Risk and rollback

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

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

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workflow adds a Gitleaks allowlist for a Slack webhook finding in one repository, restricted to specified commits and a file path. A test verifies that the scanner still reports a synthetic finding for that rule.

Changes: Scoped Gitleaks exception

Layer / File(s) Summary
Scoped exception and scan test
.github/workflows/gitleaks.yml, tests/test_secret_scan.py
The workflow limits the exception to one repository, the slack-webhook-url rule, five commits and backend/app/api/routes/auth.py. The test checks that a synthetic finding is reported with result 10 and that rule ID.

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

Possibly related PRs

  • 60xAI/.github#9: It adds a caller-scoped exception for the same rule and file path using the same Gitleaks allowlist mechanism.

Suggested reviewers: fergus-mw

Merge Risk: Minimal · up to 950ad

The change adds a narrowly scoped secret-scan exception for one reviewed webhook and keeps new findings on the same path blocked. No actionable merge-blocking risk was found, and rollback is a configuration revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a security fix that accepts the reviewed platform sign-in webhook, scoped by commit and path. The raw summary confirms a Gitleaks allowlist for the Slack webhook rule,…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: a security fix that accepts the reviewed platform sign-in webhook, scoped by commit and path. The raw summary confirms a Gitleaks allowlist for the Slack webhook rule, limited to five commits and backend/app/api/routes/auth.py, plus a test that checks the exception covers only those commits. The title is specific and matches the changeset. The conventional-commit prefix is acceptable.

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: 4aa6a3a4-bc7b-441f-88f0-cad3e8095e92
Commits

Reviewing files that changed from the base of the PR and between b07fd2d and 950ad50.

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.

@kert114
kert114 merged commit f15f7ec into main Nov 17, 2026
3 checks passed
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