Repository navigation
π fix(github): sentinel release and Prow-rejection checks trust only known identities - #15275
Conversation
β¦only Prow for rejection replies Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the Prow-rejection skip may believe only the built-in kubestellar-prow[bot] (as this PR does) or must honour project.label_driven_trusted_bots before it lands.
Read both gates against the tree. The core change is correct and fails closed as described; one plumbing gap worth a decision before merge.
Sentinel release (#15262) β correct. markerAuthorTrusted (src/pkg/github/label_approval.go:436-441) returns true for any author when knowsOwnAccounts() is false, and resolveSelfLogin (bot_user.go:103-106) warns exactly that on a failed GET /user. Replacing it with knowsOwnAccounts() && isHiveAccount(user) at sentinel_clearance.go:126 and :202 closes the forged-/approve path; isHiveAccount (label_approval.go:123-135) only ever matches configured bot logins, the resolved self login, or the configured identity, so nothing else can satisfy it. The knowsOwnAccounts() call sits inside the per-comment loop, but the failure cooldown in resolveSelfLogin means it is not a GET /user per comment. The two new sweep tests exercise exactly the identity-unknown case.
Prow rejection (#15263) β correct, but hard-codes the default. pr_decision_operator.go:129-137 compares the commenter against config.DefaultLabelDrivenTrustedBots directly. That variable is the fallback for project.label_driven_trusted_bots (src/pkg/config/repo_policy.go:152-157), and the configured value is what reaches this package elsewhere as TrustedBots (label_approval.go:35-37). An operator who names a different Prow login in config will have the skip silently stop firing: the hive posts /lgtm + /approve again on every decision and Prow rejects them again. Fail-safe (noise, not a trust regression), so I'd not block on it β but the body's "the Prow instance the repo already names" overstates what the code reads. Either plumb LabelDrivenTrustedBots() through, or say in the comment that only the built-in default is believed.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read both call sites and the identity helpers in the tree. Both fixes do what they say; one low-severity gap worth a maintainer's glance.
Sentinel release / clearance record β looks correct.
sentinel_clearance.go:126and:202now requireknowsOwnAccounts() && isHiveAccount(...). Under unknown identityknowsOwnAccounts()reachesresolveSelfLogin(label_approval.go:155), which caches failures forselfLoginRetryAfter(bot_user.go:60-62), so calling it per comment inside the loop does not re-hitGET /user.- Checked the interaction with the sweep: the branch that calls
recordSentinelClearanceis gated on!posted(sentinel_sweep.go:460), andpostedcomes fromfindOwnMarkerComment, which still uses the legacymarkerAuthorTrustedrule (sentinel_sweep.go:618). So under unknown identity the hive posts one fresh clearance comment, the next sweep sees a marker and does not re-enter β no per-sweep comment growth. Good. isHiveAccountalready returns false when nothing is configured and/useris unresolved, so the extraknowsOwnAccounts()guard is belt-and-braces rather than load-bearing; the explicit fail-closed read is still clearer. Fine.
Prow rejection β correct, with one gap (low).
pr_decision_operator.go:131-137trusts onlyconfig.DefaultLabelDrivenTrustedBots(kubestellar-prow[bot],repo_policy.go:109). But operators can override that list viaproject.label_driven_trusted_bots, and the rest of the hive honours the override:cmd/hive/main.go:10168passescfg.LabelDrivenTrustedBots()into the label-approval policy (label_approval.go:37). An operator who points that at a different Prow login gets a Prow whose rejections this check now ignores, so every dashboard Approve re-posts/lgtm+/approveand Prow re-rejects them β noise, not a security hole (the direction is fail-safe, as the body says).- Suggestion, not a blocker: thread the configured list in (the
Clienthas no*config.Configtoday, so a setter or a field onPullRequestApprovalOptionswould do), falling back to the default when empty. Fine as a follow-up if you prefer to land the fail-closed sentinel change now.
Tests: the three new cases each exercise the exact path that changed; I did not re-run them here.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Both checks decided security- or merge-relevant outcomes from comments whose author they could not actually vouch for.
Sentinel release (#15262). The dashboard-approval release and the clearance-record write reused
markerAuthorTrusted, whose legacy any-author fallback applies when the hive has no configured identity andGET /userhas not resolved. That fallback is acceptable for once-only bookkeeping markers, but here a comment releases a security alert: in that degraded configuration the PR author could post the rendered/approvecomment for their own head and the sentinel would stand down. These gates now require a known hive account, failing closed (the alert stays) when identity is unknown. OthermarkerAuthorTrustedcallers are unchanged.Prow rejection replies (#15263). Any non-hive bot quoting a Prow rejection phrase against a hive command comment was taken as proof the hive bot is not an approver, so any other installed app could suppress the
/lgtm+/approveposting. Only the Prow instance the repo already names (config.DefaultLabelDrivenTrustedBots) is now believed; the skip remains fail-safe.Each change comes with a test that fails without it (identity-unknown forged approval, identity-unknown clearance record, third-party bot quoting the rejection).
Closes #15262
Closes #15263
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88