feat(node-image): bound the operator credential and add a logs-only role #611
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 481 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.370
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #611"
general
weight: 0.35
joaosa
Stacked on #552 (
node-image/baked-chart).Summary
Enable
kubectl logson the locked node image, and stop issuing cluster-admin from cred-release so the baked guards hold against every released credential. Adds a logs-only credential for people who should not hold the operator role.Node image
kubectl logsand have no logs-only switch.exec,attach,port-forwardand ephemeral containers are closed in admission for every principal by the bakedconfos-pod-execpolicy.C8S_DEV=1skips that AddOn through an RKE2.skipmarker rendered bymkosi.sync.c8s:node-operatorsis bound to a new wildcard-freec8s-node-operatorClusterRole instead ofcluster-admin. It manages tenant workloads, namespaces, namespaced RBAC, ConfidentialWorkloads and network policy cluster-wide and reads the rest. Nobind/escalate/impersonate, no cluster-scoped RBAC or admission writes, nonodes/proxy,pods/proxyorservices/proxy(these reach the kubelet's exec endpoint without apods/execadmission check), no PV/StorageClass/HelmChart/Node/CSR-approval writes, nopodsecurityexemptionsgrant.confos-operator-scopepolicy denies the same set in admission for anyc8s:*group regardless of RBAC, plus every write in the PodSecurity-exempt namespaces. It short-circuits for every other principal.c8s-log-readerClusterRole bound toc8s:log-readers: pods,pods/log, namespaces and events, read-only.psa-ready.shwaits for all new objects, proves the operator-scope deny and allow paths with server-side dry-runs as a synthetic principal carrying the operator group, and compares every live guard object against a reference copy thatmkosi.syncstages under/usr/lib/confai/guardson the read-only root.server/manifestsis on the writable overlay because RKE2 stages its bundled charts there; a shadowed or edited guard now keeps:8443closed.cred-release / get-kubeconfig
role. Empty oroperatorkeeps the current identity;log-readerissuesCN=log-reader, O=c8s:log-readerswith a 24h default TTL. Unknown roles are a 400, never a fallback. The role sits in the token-bound body, so it cannot be swapped in transit.--log-cert-org,--log-cert-cn,--log-cert-ttlflags, spelled out in the baked unit like the operator flags.c8s get-kubeconfig --role log-reader.What a released credential can no longer do
Lower a namespace below restricted, exec, write in
kube-systemorlocal-path-storage, mount the host through a PersistentVolume or anodePathStorageClass, or edit or delete any guard or binding. Root-equivalent access to the guest exists only through the in-guestrke2.yaml.Validation
internal/cmds/credrelease,internal/cmds/getkubeconfig,internal/helmchartGo tests pass. New coverage: per-role Subject and TTL, unknown-role rejection, incomplete role config, role on the wire, role allowlist checks (rejects wildcards, dangerous verbs, guarded resources), both new policies' shape, CEL evaluation of the operator-scope policy across 36 request shapes.node-guest-image/tests/psa-ready-test.sh: 42 cases pass (13 new for guard comparison, 8 for operator scope, 3 for the pod-exec dev skip).Notes
server/manifests.