Repository navigation
fix(kas): trust the OS certificate store on the bundle route - #32587
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Crew's own KAS bundle runs Node directly, and Node trusts only its built-in roots unless NODE_USE_SYSTEM_CA is set. Behind a TLS-inspecting proxy whose CA lives only in the OS store, every engine call failed on the bundle route. kiro-cli already defaults the variable to 1 when it spawns KAS, so the relay route worked. The bundle spawn now defaults NODE_USE_SYSTEM_CA=1. An operator's own value, 0 included, is kept, as on kiro-cli. The relay is left to kiro-cli. Fixes #32561
69e5c14 to
d33f04f
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design concerns: one Notes
[DESIGN-REVIEWED] d33f04f Description read[DESCRIPTION-READ] 286c04cc933e84b33add0b998bfbbe8961e809095d81c2c8aceea02da0f548d7 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. A one-line env default fixes a reported defect (#32561) that the description reproduces, at the point where Crew itself starts the bundle's Node, and an operator's own value still wins. Not checked: the claim that kiro-cli's What this change shipsInventory (2 items) — 2 justifiedIntent: KAS sessions on Crew's own engine bundle work behind a TLS-inspecting proxy whose CA is only in the OS store. FIX.
[FIRST-PRINCIPLES-REVIEWED] d33f04f Description read[DESCRIPTION-READ] 5271e62272e174c94cade1c8f79d967e63841a5a798ca22995a119f1f7f66dfb That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] d33f04f Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
bolichen97
left a comment
There was a problem hiding this comment.
Approving d33f04f as maintainer. All 97 checks pass. Fixes #32561.
On the engine-bundle route, apply_spawn_env now sets NODE_USE_SYSTEM_CA=1 with setdefault, so an operator's own value, 0 included, still wins. Node then trusts the OS certificate store as well as its built-in roots, so a corporate CA in the OS store works, the same default kiro-cli applies when it spawns KAS. The relay route is unchanged and left to kiro-cli. The three tests pin the bundle default, the operator override and the untouched relay spawn.
Crew's own KAS bundle runs Node directly, and Node trusts only its built-in roots unless NODE_USE_SYSTEM_CA is set. Behind a TLS-inspecting proxy whose CA lives only in the OS store, every engine call failed on the bundle route. kiro-cli already defaults the variable to 1 when it spawns KAS, so the relay route worked. The bundle spawn now defaults NODE_USE_SYSTEM_CA=1. An operator's own value, 0 included, is kept, as on kiro-cli. The relay is left to kiro-cli. Fixes #32561 (cherry picked from commit 9b5bbfb) Original author: @iamwhatever
Crew's own KAS bundle runs Node directly, and Node trusts only its built-in roots unless NODE_USE_SYSTEM_CA is set. Behind a TLS-inspecting proxy whose CA lives only in the OS store, every engine call failed on the bundle route. kiro-cli already defaults the variable to 1 when it spawns KAS, so the relay route worked. The bundle spawn now defaults NODE_USE_SYSTEM_CA=1. An operator's own value, 0 included, is kept, as on kiro-cli. The relay is left to kiro-cli. Fixes #32561 (cherry picked from commit 9b5bbfb) Original author: @iamwhatever
Crew's own KAS bundle runs Node directly, and Node trusts only its built-in roots unless NODE_USE_SYSTEM_CA is set. Behind a TLS-inspecting proxy whose CA lives only in the OS store, every engine call failed on the bundle route. kiro-cli already defaults the variable to 1 when it spawns KAS, so the relay route worked. The bundle spawn now defaults NODE_USE_SYSTEM_CA=1. An operator's own value, 0 included, is kept, as on kiro-cli. The relay is left to kiro-cli. Fixes #32561 (cherry picked from commit 9b5bbfb) Original author: @iamwhatever
Problem / Motivation
Goal: KAS sessions on Crew's own engine bundle work behind a TLS-inspecting proxy whose CA is in the OS certificate store, as they already do through kiro-cli.
On the bundle route (Crew's own engine and Node, no kiro-cli in the chain), every engine TLS call fails behind such a proxy. Node trusts only its built-in roots unless
NODE_USE_SYSTEM_CAis set, and Crew sets nothing (grep NODE_USE_SYSTEM_CA src/returned 0 hits on main). kiro-cli defaults the variable to1when it spawns KAS (apply_node_system_ca_envincrates/chat-cli/src/launch.rs), so the relay route works.Why it matters
Enterprise hosts behind TLS inspection cannot use the bundle route at all, and the bundle route is where Crew sends users whose kiro-cli cannot run KAS. This is row P0-20 of the kiro-cli to KAS migration gap list.
Not a goal
NODE_EXTRA_CA_CERTS: kiro-cli does not, and the measurement below showsNODE_USE_SYSTEM_CAalone is enough.What changed (motivation → approach → change)
Symptom: TLS fails on the bundle route behind a corporate proxy. Cause: the bundle's Node runs without
NODE_USE_SYSTEM_CA. Change:KasHarness.apply_spawn_envcallsenv.setdefault("NODE_USE_SYSTEM_CA", "1")in the branch that already detects Crew's own engine bundle (_runs_crew_engine_bundle). An operator's own value,0included, is kept, which is kiro-cli's rule too. The launch scrub (sandbox_spawn.scrub_agent_subprocess_env) keeps the variable; checked directly.Measured on a real OS run. The pinned bundle's Node is 22.23.3 (
kas/0.66.33/manifest.json; sha256 of the download checked against the manifest). In adebian:bookworm-slimcontainer, a private CA was added to the OS store only (update-ca-certificates), a local HTTPS server used a leaf signed by it, and the pinned Node fetched it:Rest of batch N11, re-checked on main
347225fcdc. No open PR covers any of them.session.autocompact_pctnot sentchat.defaultModelnode_modules/@cedar-policy/cedar-wasm/nodejsships in the pinned 0.66.33 linux-x64 bundleBackwards compatibility
Compatible: the variable is only added when unset, on the bundle route only; an operator's value is untouched.
Removes nothing: the diff adds one environment default and a test.
Tests
test/test_kas_bundle_system_ca_env.py: the bundle gets1; an operator0or1is kept; a relay or unknown binary gets nothing.Proof: not provable -- other: prove.py returned INCONCLUSIVE (collection error on this AL2 host); a manual revert of kas.py to origin/main makes test_bundle_spawn_trusts_the_os_store fail with KeyError (head 69e5c14)
Manual verification
The container run above, with the pinned Node 22.23.3 binary.
Related Issues
Fixes #32561
Sibling sweep
Swept: git grep -nE "node_bin|build_kas_bundle_argv|NODE_USE_SYSTEM_CA" -- src/
Siblings: none -- the bundle route is the only place Crew itself starts the KAS Node; the relay is kiro-cli's own spawn
Pattern harvest
Not generalizable: a single missing env default for one runtime, mirrored from kiro-cli's own spawn.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.