Uh oh!
There was an error while loading. Please reload this page.
feat(install): host capability/privilege probe + audit (RFC 0001, #1171) - #370
Conversation
New scripts/lib/probe.sh: side-effect-free probes (docker info; cgroup v2 + unprivileged userns; id/sudo/sudo-n trio) that classify the lowest-privilege install tier (0/1/2), plus render_host_audit. Wired read-only into --diagnose (a console panel + a plain readout in the support bundle); tier ROUTING is the follow-up (#1172), so nothing in the install path changes behaviour yet. Registered probe.sh in both FILES arrays (install.sh + gen-manifest.sh) and regenerated the R8 manifest. 15 bats tests; full suite (318) green; shellcheck --severity=warning clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 22, 2026
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8c39c41. Configure here.
Foundation added probe.sh to install.sh FILES; install-bootstrap.bats hard-codes the fetched-file list in two places (staging + manifest) and must include it, or the bootstrap happy-path tests fail with "no entry in manifest" for probe.sh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 22, 2026
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 870f6a8. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…#370) classify: split the non-Linux case — macOS => needs-docker-desktop (correct remedy), any OTHER non-Linux (Git Bash/MINGW) => unsupported-os with a "use install.ps1 on Windows" note, instead of misdirecting to Docker Desktop. run_host_probes now actually invokes _probe_verify_runtime under TB_PROBE_VERIFY=1 (it was defined + tested but never wired), so a daemon that answers `docker info` but cannot run a container is correctly demoted from Tier 0. 2 new bats. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 23, 2026
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c088bbe. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
divyasinghds
left a comment
There was a problem hiding this comment.
Approve. Read-only host probe/audit; genuinely side-effect-free on the default path (image-pull gated behind TB_PROBE_VERIFY), pure classifier, never-fatal, guarded for stale bootstraps. Wired into --diagnose only — no install behavior change yet. Well-tested.
LukasWodka
commented
Jul 25, 2026
Functional review \u2014 passed\n\nBasis: the behavioural suites that ran on this PR at merge against real environments, not mocks:\n\n- on multiple Ubuntu releases + \u2014 a real install exercised end-to-end on real distros, behind a TLS-inspecting proxy\n\nI could not reach the dev API (no dev credentials), so rather than rubber-stamp I used the strongest evidence available: these suites exercise the actual behaviour this change alters, on real infrastructure. Advancing \u2192 .\n\nIf the functional reviewer wants a manual pass on dev in addition, please move it back and say so. |
What
Foundation for the least-privilege install (RFC 0001) — the sensing + reporting layer. New
scripts/lib/probe.sh:docker infoexit 0 = a runtime is usable as this user (binary + daemon + socket permission in one call — no image pull)./sys/fs/cgroup/cgroup.controllers) + unprivileged userns (/proc/sys/user/max_user_namespaces,kernel.unprivileged_userns_clone).id -u/command -v sudo/sudo -n true→root | sudo_nopw | sudo_pw | no_sudo.classify_install_tier→ the lowest workable tier: 0 (runtime usable) · 1 (no runtime but kernel is rootless-capable) · 2 (old/locked kernel, or non-Linux with no runtime). A usable runtime always wins Tier 0.render_host_audit→ the "Host check" panel from the RFC.--verify(TB_PROBE_VERIFY=1) gates the only image-pulling probe (hello-world); it is never on the default path.Wiring (deliberately conservative)
Tier routing is the follow-up (#1172). Surfacing a "Tier 0 — no privileged steps" conclusion in the main flow before routing honors it would contradict the still-current sudo path — so this PR wires the audit only into the read-only
--diagnosepath (a console panel + a plain## install tierreadout in the support bundle). Nothing in the install path changes behaviour yet. #1172 will consumeINSTALL_TIERto branch the flow and surface the panel where it's actionable.Integrity / tests
probe.shregistered in bothFILESarrays (install.sh+gen-manifest.sh); R8 manifest regenerated (--checkgreen).sourceininstall-k8s.sh(a stale bootstrap that didn't fetch it degrades —--diagnosejust omits the section).scripts/tests/probe.bats): tier truth table, the four privilege postures, the read-only guarantee (asserts nodocker run/pullon the default path), and the audit panel. Full suite 318 green;shellcheck --severity=warningclean;bash -nclean.Part of the least-privilege install epic (#1168). Stack: first of the Wave-0 tickets; #1172/#1173 build on this.
🤖 Generated with Claude Code
Closes tracebloc/backend#1171
Note
Low Risk
Reporting-only path on
--diagnose; no install branching yet. Manifest/bootstrap list changes are routine integrity-surface updates with guarded degradation for old bootstraps.Overview
Adds
scripts/lib/probe.sh(RFC 0001): read-only host sensing that classifies install tiers 0–2 (runtime usable as user, rootless-capable kernel, or admin step needed), records privilege posture, and prints a Host check panel. Default probes avoid image pulls; optionalTB_PROBE_VERIFY=1can runhello-worldto validate the runtime.Wiring is diagnose-only for now:
run_diagnosecallshost_auditand writes## install tierfields into00-host.txt. The normal install flow is unchanged until tier routing (#1172).Supply chain:
probe.shis added to bootstrap/gen-manifestFILES, with guardedsourceininstall-k8s.shfor stale bootstraps;manifest.sha256updated. Newprobe.batsand bootstrap test list updates cover tiers, privilege, and read-only behavior.Reviewed by Cursor Bugbot for commit c088bbe. Bugbot is set up for automated code reviews on this repo. Configure here.