Repository navigation
🐛 fix: fail-closed fault injection for proxy policy seams - #19227
Conversation
The review-thread ownership seams (OwnPR, HiveLogins), the GitHub lookup behind the reference-repo and review-thread gates, and the canary scanner were called bare on the proxy request path. A panic in any of them crashed the whole proxy and a hang held the request open. They now run through the same guard as the Set*Func predicates (#18994), generalised to callPolicySeam, and a failure takes the gate's deny branch. A canary scan that cannot finish refuses even in advisory canary mode, matching an unreadable body. TestPolicySeamFaultInjectionDenies drives each seam with error, panic and deadline faults and asserts a deny, with a healthy control per seam. The audit result for #18986 item 5 and the accepted risks are recorded in security-model.md section 5 and security-threat-model.md. Closes #19224 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Mutation testing2 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
ℹ️ 1 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first
Verdict: |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending - sweep will merge when green. 🐝 Hive Agent: Review findings from Read the changed proxy code at the PR head (not just the diff):
Why this is routed rather than waved through: it edits the egress proxy's policy path, a trust surface. One behaviour change is a policy choice, not an engineering detail: Docs and changelog fragment are present and consistent with the code. Suggestion only: the "canary scan / error" test row exercises the unreadable-body branch, not a scanner error, which the comment in the test explains. Evidence bundle `#192274fb533e` sha256:b096f18ccdc5b27c5fb5fd9d0d054b471cada66ca6c3ce54a4dd2dd82f7c1aad — download from the dashboard or `hivectl review evidence #19227`. |
|
Needs a decision, not a merge:
Head: verdict requires_human @0c1450c, 77/77 checks green, DCO yes, soak 0s of 10m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
/hive decision approve #19227: green head, reviewer question answered with the reversible default — proceed as implemented Rationale: no owner rule holds this back; a merge is reversible and keeps work moving. Hive decided: Approved for merge. Decided by the hive at @hosted-available-oke-11-placeholder-r05x's request as the owner's delegate under the owner-delegate policy (rule |
|
/approve Posted by @hosted-available-oke-11-placeholder-r05x from the Hive dashboard; the merge gate decides from here. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hivecommons-hive[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/hive decision approve #19227: green head, reviewer question answered with the reversible default — proceed as implemented Rationale: no owner rule holds this back; a merge is reversible and keeps work moving. Hive decided: Approved for merge. Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule |
|
Approved by @clubanderson for Hive auto-merge on green CI. |
|
New changes are detected. LGTM label has been removed. |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether this change to the proxy's fail-closed policy seams (new deny paths, new 2s/10s/15s deadlines) may land, since it edits Hive proxy policy rules.
This edits the credential-holding GitHub proxy's decision path (src/crux/proxy/), a trust surface, so I am routing it rather than signalling approval.
What I read in the diff: callPolicySeam (policy_callback_guard.go) is a straight generalisation of the existing predicate guard; every failed seam returns the zero value with ok=false, and each caller takes its deny branch (reviewThreadRefusal returns the failed-check 403, referenceLookupOrDefault returns errReferenceLookupFailed, inspectCanaryEgress returns deny even in advisory mode). In noteRefusedReviewReply the || failed check correctly follows the OwnPR call. I found no defect in the direction of any deny path, and the test covers healthy and faulted rows per seam.
For the maintainer to weigh (not defects):
- A timed-out seam keeps running in the background (documented). Under a slow
Scanor lookup, repeated requests can accumulate goroutines until each finishes; the PR accepts this. - Advisory canary mode now refuses on a scan failure, a deliberate behaviour change that the changelog fragment states.
The PR body matches the diff. No line findings.
-- hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.328
Part of the egress audit (#18986, item 5). #18994 guarded the Set*Func write-gate predicates, but four other seams on the proxy decision path were still called bare: the review-thread ownership callbacks (OwnPR, HiveLogins), the GitHub lookup behind the reference-repo and review-thread gates, and the canary scanner. A panic in any of them crashed the whole proxy, taking down egress for every agent, and a hang held the request open with no answer.
The existing guard is generalised to callPolicySeam (any result type, per-seam deadline) and those seams now run through it. A failure takes the gate's deny branch: review-thread and reference-repo writes are refused naming the failed check, and a canary scan that cannot finish refuses the write even in advisory canary mode, the same answer as an unreadable body.
TestPolicySeamFaultInjectionDenies drives each seam with error, panic and deadline faults and asserts a deny, with a healthy control per seam so the guard is not a blanket refusal. The enumeration of every failing branch, its outcome, and the accepted risks (unidentified callers keep reads; budget, credential and audit seams are intentionally unguarded; a timed-out check finishes in the background) are recorded in src/docs/security-model.md section 5 and src/docs/security-threat-model.md.
Closes #19224
🤖 Generated with Claude Code
-- hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.327 requested_by=@clubanderson