Skip to content

πŸ› fix(github): sentinel release and Prow-rejection checks trust only known identities - #15275

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-15262
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-15262

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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 and GET /user has 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 /approve comment 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. Other markerAuthorTrusted callers 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 + /approve posting. 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

…only Prow for rejection replies

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/github/pr_decision_operator.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:126 and :202 now require knowsOwnAccounts() && isHiveAccount(...). Under unknown identity knowsOwnAccounts() reaches resolveSelfLogin (label_approval.go:155), which caches failures for selfLoginRetryAfter (bot_user.go:60-62), so calling it per comment inside the loop does not re-hit GET /user.
  • Checked the interaction with the sweep: the branch that calls recordSentinelClearance is gated on !posted (sentinel_sweep.go:460), and posted comes from findOwnMarkerComment, which still uses the legacy markerAuthorTrusted rule (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.
  • isHiveAccount already returns false when nothing is configured and /user is unresolved, so the extra knowsOwnAccounts() 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-137 trusts only config.DefaultLabelDrivenTrustedBots (kubestellar-prow[bot], repo_policy.go:109). But operators can override that list via project.label_driven_trusted_bots, and the rest of the hive honours the override: cmd/hive/main.go:10168 passes cfg.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 + /approve and 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 Client has no *config.Config today, so a setter or a field on PullRequestApprovalOptions would 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

@hivecommons-hive
hivecommons-hive Bot merged commit 6c92c46 into v5 Oct 29, 2026
79 of 82 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15262 branch October 29, 2026 03:53
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#152755198a3b` sha256:abdeb1ed25f1675cd444c4ae9bb735d714cf5fdfc33b6143ef0ce20de399a534 β€” download from the dashboard or `hivectl review evidence #15275`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

0 participants