fix(security): bind Gitleaks range to live PR merge base - #2041
fix(security): bind Gitleaks range to live PR merge base#2041seonghobae wants to merge 17 commits into
Conversation
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Signed-off-by: Seongho Bae <me@seonghobae.me>
Bind the scanner configuration to the authenticated protected live base so untrusted PR source cannot weaken secret detection. Signed-off-by: OpenAI Codex <noreply@openai.com>
|
Design-assurance repair on exact head
This new head requires a wholly fresh Security/Python/Semgrep/CodeQL generation and independent review. Keep Proposed/Draft until those exact-head gates are terminal GREEN, then rerun the original #1639 failure after protected integration to prove that only its live-base delta is scanned. |
|
Lifecycle concurrency audit for exact head
No further lifecycle toggle is being made from this lane to avoid a writer loop. The second conversion has no accompanying source defect, permission defect, wrong base, or unresolved inline finding in the live record; if Draft is intentional for a different substantive reason, that reason should be recorded explicitly. Current head remains mergeable, review submissions = 0, review threads = 0. |
Non-force stack repair before exact-head revalidation
|
Stack parent advanced after RED→GREEN repair
Because this PR is now based on the moving |
The executable workflow contract runs with set -u and must model GitHub Actions' RUNNER_TEMP environment. Preserve the real shell path while removing the harness-only unbound variable failure. RED: 1 failed, 3003 passed, 1 skipped, 21 subtests passed. GREEN focused: 7 passed. Signed-off-by: OpenAI Codex <noreply@openai.com>
|
Exact combined-tree verification update for
The PR remains Draft and merge-blocked: the exact-head hosted CodeQL workflow is still failing, and #2040 remains an unmerged prerequisite. No lifecycle toggle or merge authority is implied by the local verification. |
Preserve the four-file live-base Gitleaks delta while advancing its stack to the current canonical CodeQL successor. Resolve the append-only Gap baseline conflict by retaining both owner evidence sections.
|
Non-force stack reconciliation completed at exact head
Fresh exact-head hosted runs are CodeQL PR 34241409634, Semgrep 34241409581, Python Security 34241409659, Security Scan 34241409784, and Runtime Quality 34241409676; all were queued at publication. Ready remains review admission only. No merge, approval, auto-merge, protection bypass, manual rerun, empty push, force push, destructive rebase, or predecessor evidence transfer was performed. |
|
P1 wrong-base lifecycle finding: exact head |
Preserve the verified four-path Gitleaks delta while integrating #2040's concurrent status-publication and migration-bridge repair through ordinary ancestry.
|
Concurrent prerequisite advance reconciled non-force at exact head Relative to current #2040: 16 ahead / 0 behind, mergeable, exactly four effective paths. Exact merged-tree verification: focused CodeQL/Gitleaks 61 passed; full 3032 passed, 1 skipped, 21 subtests; statement/branch coverage 100%; public-doc coverage 100%; diff check clean. Fresh runs are Runtime Quality 34243109706, Security Scan 34243109766, Semgrep 34243109758, Python Security 34243109798, and CodeQL PR 34243109771. The PR stays Draft/Proposed because canonical #2040 is Draft and exact-head CodeQL is not GREEN; the prior Ready state and checks are not transferred. No lifecycle toggle, merge, approval, auto-merge, bypass, manual rerun, empty push, force push, destructive rebase, review dismissal, or stale-evidence transfer was performed. |
Exact-head non-force reconciliation evidenceThe current branch is now an ordinary force=false descendant of both prior #2041 and current canonical #2040 while preserving the semantic implementation boundary.
A normal history-aware merge reported clean but its result would have deleted or reverted valid current CodeQL files. That candidate was rejected before publication. The published tree uses exact #2040 tree Exact-tree validation:
Fresh exact-head hosted runs are non-terminal and remain merge gates:
No merge, approval, auto-merge authorization, protection bypass, manual rerun, empty push, force push, destructive rebase, review transfer, or predecessor Close was performed. |
Exact-head hosted CodeQL handoffFresh exact-head CodeQL PR 34245990227 is terminal failure on attempt 1, while Runtime Quality, Semgrep, Python Security, and Security Scan are terminal GREEN.
The PR remains Draft/Proposed at exact head No lifecycle toggle, rerun, empty push, synthetic status, merge, approval, auto-merge authorization, protection bypass, force push, destructive rebase, evidence transfer, or Close was performed. |
Problem
ContextualWisdomLab/.github#1639exact head6a8e8b2c279779ec7516a67ee96a02c7b9048468failed Security Scan run34195535497, job101962314786.The Gitleaks job used the pull-request event snapshot base
9330d41c92b1e6ab35261f3f5189936ea1ad8bff, which was 248 commits behind protectedmain@7fd571dbcdbae6acf29d8f4ee704d7ba6297e4db. Because #1639 had already integrated current main, that range rescanned merged base history and reported twogeneric-api-keyfixtures outside the effective three-file metadata delta.Root cause
security-scan.ymlconstructedevent_base_sha..event_head_shawithout authenticating the live PR base or deriving the current merge base. Long-lived PR event snapshots therefore turned already-merged main history into apparent PR-introduced history.Repair
github.token.git merge-base(live_base, exact_head)..exact_head..gitleaks.toml; never trust PR checkout policy.No fixture suppression, secret-rule weakening, force push, lifecycle synchronization, or unrelated metadata delta is included.
Test-first evidence
RED before implementation:
Predecessor
a28006ee72931f8b54b1dfcd567fdf394635ec86was locally GREEN before the policy-boundary forward repair:A direct boundary review found and repaired an over-restrictive same-repository-head check before completion. A second RED contract proved fork PRs would have been blocked; a third RED contract proved the live PR API lacked its explicit read permission. That predecessor authenticated the canonical base plus exact head without executing fork source and granted only
pull-requests: read; its executable temporary Git graph proved the stale event base was absent from the Gitleaks arguments. Pre-stack security head0131ff9c…additionally binds scanner configuration to the authenticated live base and adds a source contract for the boundary. Its local or hosted result is non-authorizing for the stacked head. The first full stacked-tree run exposed the executable fixture's missing Actions-providedRUNNER_TEMP(1 failed, 3003 passed, 1 skipped, 21 subtests);c760ddf6…adds only that test environment binding, and the focused Gitleaks contract is7 passed.Lifecycle and integration
Current exact head is
0f2b318c01bfa253c8ba13dc5b474cfd4349bf04, treecce2c06fe889a5a1c08c729bc345f4a3f326768e. It is an ordinary two-parent child of prior #2041c51aae180f621d709163d295f1e9113671bc9585and current canonical CodeQL successor #2040@d7bb95f6d6ca705725596df5170d6e1345080535, preserving both concurrent intents.A history-aware merge reported clean but would have reverted valid current CodeQL files, so it was rejected before publication. The published tree instead treats exact #2040 tree
588f31d1bc499112064911070c5854d8bcaf3491as authoritative and overlays only #2041's four Gitleaks-boundary paths. Relative to #2040, the stack is 17 commits ahead / 0 behind and its effective delta is exactly those four paths.Focused CodeQL/Gitleaks contracts passed 139 tests; the full exact tree passed 3090 tests with 1 skip and 21 subtests; statement/branch and public-doc coverage are 100%;
git diff --checkis clean. The PR remains Draft/Proposed while canonical #2040 is open and its exact-head hosted checks plus qualifying independent approval remain incomplete. Fresh #2041 hosted checks and a qualifying current-head independent approval remain mandatory after the prerequisite integrates; predecessor GREEN is non-authorizing.After this owner repair reaches protected
main, rerun #1639 and verify that Gitleaks scans only its effective live-base delta. #1639 remains the canonical repository-metadata writer; this PR repairs the central security owner and does not replace or retire it.