← Back to Pull requests

feat(node-image): bound the operator credential and add a logs-only role #611

Closed
unknown closed this pull request without merging on Sep 22, 2026 16:30 UTC
View on GitHub
unknown unknown commented on Sep 14, 2026 15:10 UTC
Author

Stacked on #552 (node-image/baked-chart).

Summary

Enable kubectl logs on 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


  • Kubelet debugging handlers stay on: they back kubectl logs and have no logs-only switch. exec, attach, port-forward and ephemeral containers are closed in admission for every principal by the baked confos-pod-exec policy. C8S_DEV=1 skips that AddOn through an RKE2 .skip marker rendered by mkosi.sync.

  • c8s:node-operators is bound to a new wildcard-free c8s-node-operator ClusterRole instead of cluster-admin. It manages tenant workloads, namespaces, namespaced RBAC, ConfidentialWorkloads and network policy cluster-wide and reads the rest. No bind/escalate/impersonate, no cluster-scoped RBAC or admission writes, no nodes/proxy, pods/proxy or services/proxy (these reach the kubelet's exec endpoint without a pods/exec admission check), no PV/StorageClass/HelmChart/Node/CSR-approval writes, no podsecurityexemptions grant.

  • New confos-operator-scope policy denies the same set in admission for any c8s:* group regardless of RBAC, plus every write in the PodSecurity-exempt namespaces. It short-circuits for every other principal.

  • New c8s-log-reader ClusterRole bound to c8s:log-readers: pods, pods/log, namespaces and events, read-only.

  • psa-ready.sh waits 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 that mkosi.sync stages under /usr/lib/confai/guards on the read-only root. server/manifests is on the writable overlay because RKE2 stages its bundled charts there; a shadowed or edited guard now keeps :8443 closed.
  • cred-release / get-kubeconfig


  • The release request carries a role. Empty or operator keeps the current identity; log-reader issues CN=log-reader, O=c8s:log-readers with 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.

  • New --log-cert-org, --log-cert-cn, --log-cert-ttl flags, 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-system or local-path-storage, mount the host through a PersistentVolume or a nodePath StorageClass, or edit or delete any guard or binding. Root-equivalent access to the guest exists only through the in-guest rke2.yaml.

    Validation


  • internal/cmds/credrelease, internal/cmds/getkubeconfig, internal/helmchart Go 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).

  • The new invariants block passes in isolation; the full script needs a confos checkout.

  • The four e2e scripts the metal lanes run with the released kubeconfig were audited against the bounded role and fit. They have not been run on hardware with this image.
  • Notes


  • The image measurement changes; regenerate the manifest on the next build.

  • Immutability of the guards against guest root is not claimed. The reference on the verity root plus the gate comparison is the strongest available, since RKE2 must write server/manifests.
  • Diff: 481 lines (+360 / -121) across 6 files Reviewer: joaosa Review duration: 11600m
    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
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.3% (MEDIUM) · Higher = larger blast radius
    47.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.7% · Safe to merge
    18.7%