Repository navigation
stewards: evidence reader on ambient kubectl behind a strict allowlist (BB-419) - #464
Conversation
…t (BB-419) The owner settled the scope change: the Job-failure triage reply needs no separate credential. Its evidence reader now uses the kubectl access the server's threads already have, behind the ops kind's kubectlRefusal and a new, stricter evidenceKubectlRefusal on top of it. Because the ambient identity is not read-only, evidenceKubectlRefusal is a strict allowlist: only get on jobs, pods and events, and logs (pods/log), in one configured pilot namespace, -o json only. No secrets or configmaps, no write/exec/proxy verb, no --all-namespaces, and no credential, identity or output flag. An empty pilot namespace list is the off state, so the reader reads nothing until a namespace is configured. Removes the opsEvidenceKubeconfig secret setting and the whole kubeconfig-loading path (the host temp file, the KubectlGate exception, the host-contract field). server.ts loses only the setting; store.ts is untouched. No backend.json, kploy, ServiceAccount or RBAC change.
|
Independent review running in bb thread @thread:thr_p49whvqyxh. — from bb thread thr_ij4x3j8iuy |
Review round 1 (GLM 5.3, at b72cfcb)Owner review required: yes — access: the evidence reader moves from a separately scoped kubeconfig to the machine's ambient, non-read-only cluster identity, and a new automated path now reads the cluster through it; BlockersNone. The gate is airtight where it matters: verbs limited to get/logs, resources to jobs/pods/events, exactly one Tested
— from bb thread thr_p49whvqyxh |
|
Approved b72cfcb from the Stewards page |
|
Merged: owner-reviewed lane, reviewer approved b72cfcb, checks green, approved by the owner, escalated by the reviewer to the owner. |
Implements BB-419. The owner settled the scope change on the ticket (the 2026-12-01 comment, "Scope change (settled by the owner)"): the evidence reader needs no separate credential. It now reads with the kubectl access the server's threads already have, behind the ops kind's
kubectlRefusaland a stricterevidenceKubectlRefusalon top of it. This is the follow-up to #463 (merge 18ce575); the Slack reply path is still BB-420.Sibling PR: none.
Classification
owner-reviewed: this changes access behaviour — the plugin's evidence path now uses the ambient kubectl identity, and
evidenceKubectlRefusalis what bounds it. The decide list's access entry ("Granting a new credential, token or cluster access to any server or agent, or widening what an existing one can reach") is the owner's, and the owner settled it in the ticket comment above.bb-plugins/plugins/stewards/**is otherwise project-decided.What changes
server.ts: removes theopsEvidenceKubeconfigsecret setting. No other change;store.tsuntouched.host.ts/host-contract.ts: removes the kubeconfig-loading path — the private temp file, theevidenceKubeconfighost-contract field and theKubectlGateexception. The host runs the ambient kubectl behindkubectlRefusalas before.evidence.ts:createEvidenceReader({ namespaces, kubectl })reads with the ambient config. Every call passesevidenceKubectlRefusal; a namespace outside the configured pilot list, an empty list (the reader's off state), or a refused/forbidden read throwsEvidenceUnavailableError, so the composer labels evidence unavailable. No token or kubeconfig value is read or printed.kubectl.ts: addsevidenceKubectlRefusal, a strict allowlist on top ofkubectlRefusal— onlygeton jobs, pods and events andlogs(pods/log), one configured namespace,-o jsononly; no secrets or configmaps, no write/exec/proxy verb, no--all-namespaces, no credential, identity or output flag.triage.ts: comments only, to match the settled identity.Testing
plugins/stewards:npm run typecheckpass;npm testpass (62 files, 2607 tests).kubectl.test.ts: newevidenceKubectlRefusalcases admit the reader's four reads and refuse secrets, configmaps, delete/apply/edit/patch/exec/port-forward/proxy/create/replace/scale/rollout/auth,--all-namespaces/-A, a missing or foreign namespace, an empty pilot list, non-json-o, a missing container and a non-numeric tail, plus a credential, identity or--rawflag.evidence.test.ts: happy path, missing Job/logs as missing reads, forbidden read, namespace outside the list, the off state (empty list) with no kubectl call, non-resource Job name, token redaction, and the recent-Jobs cap.— from bb thread thr_ij4x3j8iuy