fix(sandbox): anchor corporate CA for image build TLS - #6845
Conversation
The corporate proxy CA was decoded only after the OpenClaw/mcporter reinstall path, and NODE_EXTRA_CA_CERTS was never set at build time. Behind a TLS-intercepting corporate proxy the npm audit signatures step then failed to fetch the sigstore TUF root, aborting the build with SELF_SIGNED_CERT_IN_CHAIN. Decode the CA early in the final stage and export NODE_EXTRA_CA_CERTS so build-time TLS traverses the operator proxy. Signature and integrity verification still run end to end; this only adds a transport trust anchor. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
📝 WalkthroughWalkthroughThe Dockerfile provisions an optional corporate proxy CA before build-time TLS operations, exports ChangesCorporate CA build-time TLS
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DockerBuild
participant CorporateCABundle
participant AuditSignatures
DockerBuild->>CorporateCABundle: Decode and validate corporate CA
CorporateCABundle-->>DockerBuild: Export NODE_EXTRA_CA_CERTS
DockerBuild->>AuditSignatures: Run audit-signature verification
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage remains at 96%, unchanged from the TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most impacted files.
Updated |
PR Review Advisor — InformationalAdvisor assessment: Informational / high confidence Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 1 optional E2E recommendation
1 warning · 0 suggestionsWarningsWarnings do not block.
|
Moving the corporate CA decode earlier in the runtime stage put it ahead of the AWS_EC2_METADATA_DISABLED and JITI_FS_CACHE hardening, making it the first RUN before that hardening took effect. Reorder so the hardening ENV lines stay first; the CA decode still lands well before the OpenClaw/mcporter reinstall step it targets. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
Dockerfile (2)
98-106: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winProtect
/usr/local/share/nemoclawbefore writing the CA file. A pre-existing symlink or hardlink in the base image can redirect this root-owned write to another file; the laterchown/chmoddo not prevent that overwrite. Create and lock down the directory first, write to a temp file inside it, then rename it into place.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Dockerfile` around lines 98 - 106, Update the CA installation block around /usr/local/share/nemoclaw/corporate-ca.pem to secure the directory before any write, including rejecting or removing unsafe pre-existing links as appropriate. Decode and validate the certificate bundle into a temporary file inside that directory, then atomically rename it to corporate-ca.pem before applying ownership and permissions; do not write directly to the final path.Source: Path instructions
88-116: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winClear inherited corporate CA when the build arg is empty.
If
/usr/local/share/nemoclaw/corporate-ca.pemalready exists in the base image, the empty-arg path leaves it in place whileNODE_EXTRA_CA_CERTSstill points at it. Remove the file whenNEMOCLAW_CORPORATE_CA_B64is unset, and add a regression test for an inherited CA file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Dockerfile` around lines 88 - 116, The Dockerfile’s empty NEMOCLAW_CORPORATE_CA_B64 path must remove any inherited corporate CA before setting NODE_EXTRA_CA_CERTS. Update the RUN block around NEMOCLAW_CORPORATE_CA_B64 to delete /usr/local/share/nemoclaw/corporate-ca.pem when the argument is empty, while preserving the existing decode and validation flow for non-empty values. Add a regression test covering a base image with an inherited CA file and an unset build argument.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@Dockerfile`:
- Around line 98-106: Update the CA installation block around
/usr/local/share/nemoclaw/corporate-ca.pem to secure the directory before any
write, including rejecting or removing unsafe pre-existing links as appropriate.
Decode and validate the certificate bundle into a temporary file inside that
directory, then atomically rename it to corporate-ca.pem before applying
ownership and permissions; do not write directly to the final path.
- Around line 88-116: The Dockerfile’s empty NEMOCLAW_CORPORATE_CA_B64 path must
remove any inherited corporate CA before setting NODE_EXTRA_CA_CERTS. Update the
RUN block around NEMOCLAW_CORPORATE_CA_B64 to delete
/usr/local/share/nemoclaw/corporate-ca.pem when the argument is empty, while
preserving the existing decode and validation flow for non-empty values. Add a
regression test covering a base image with an inherited CA file and an unset
build argument.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 6da91b9c-fc39-4245-8586-1eefb3d3b818
📒 Files selected for processing (1)
Dockerfile
## Summary Add v0.0.83 release notes to `docs/about/release-notes.mdx` for pre-tag release prep. ## Source Summary - #6773 -> `docs/about/release-notes.mdx`: Shared inference route changes are explicit and fail-safe; status shows recorded route, live route, and drift. - #6875 -> `docs/about/release-notes.mdx`: DGX Station GB300 express setup restored; vLLM storage preflight narrowed. - #6770 -> `docs/about/release-notes.mdx`: Risky Spark vLLM server warning during onboarding. - #6856 -> `docs/about/release-notes.mdx`: Re-onboard reuse preserves tier-default brave/tavily presets. - #6867 -> `docs/about/release-notes.mdx`: Unreachable custom endpoint routed through transport-recovery path. - #6860 -> `docs/about/release-notes.mdx`: Rebuild preflight uses model-aware token field for o-series/GPT-5. - #6845 -> `docs/about/release-notes.mdx`: Corporate CA anchored for image build TLS. - #6833 -> `docs/about/release-notes.mdx`: SSH ControlMaster-delegated forwards recognized in fallback. - #6837 -> `docs/about/release-notes.mdx`: Hermes light skin writes via stdin on macOS. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: doc-only release notes - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed - [ ] Non-success, skipped, or missing CI check accepted by maintainer ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub - [x] Normal pre-commit, commit-msg, and pre-push hooks passed - [x] `npm run docs` passes with 0 errors Signed-off-by: Jessica Yaunches <jyaunches@nvidia.com> Signed-off-by: Jessica Yaunches <jyaunches@nvidia.com>
Summary
The corporate proxy CA baked by the onboard opt-in (#6210) was decoded only late in the sandbox image build — after the OpenClaw/mcporter reinstall path — and
NODE_EXTRA_CA_CERTSwas never set at build time. Behind a TLS-intercepting corporate proxy thenpm audit signaturesstep then failed to fetch the sigstore TUF root and aborted the build withSELF_SIGNED_CERT_IN_CHAIN. This moves the CA decode ahead of the reinstall path and exportsNODE_EXTRA_CA_CERTSfor the whole final build stage, so build-time TLS traverses the operator proxy exactly as runtime already does.Related Issue
Fixes #6839
Changes
Dockerfile: movedARG NEMOCLAW_CORPORATE_CA_B64and the CA decode/validateRUNto the top of the final stage, so the decodedcorporate-ca.pemexists before the OpenClaw/mcporter reinstallRUN(which runsnpm audit signatures). The decode block text is unchanged, so the existing decode-guard contract still applies.Dockerfile: added a final-stageENV NODE_EXTRA_CA_CERTS=/usr/local/share/nemoclaw/corporate-ca.pem. Node ignores a missing file, so this is a no-op when no CA is baked;scripts/nemoclaw-start.shstill overrides it at runtime with the merged OpenShell + corporate bundle. Signature and integrity verification are unchanged — this only adds a transport trust anchor.test/corporate-ca-build-tls-anchor.test.ts: new contract test pinning that the ARG, the decodeRUN, and the anchorENVall precede the reinstallaudit signaturesstep, and that exactly one corporate CA build arg exists (the onboard patch's single replace target). The real failure only reproduces against a full image build behind a TLS-intercepting proxy, so this asserts the shipped build ordering rather than a runtime path — registered as twosecuritysource-shape contract exceptions inci/source-shape-test-budget.json.Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablevitest run --project integration test/corporate-ca-build-tls-anchor.test.ts test/corporate-ca-dockerfile-decode.test.ts→ 16 passed;vitest run --project cli src/lib/onboard/dockerfile-patch-corporate-ca.test.ts→ 6 passed;npm run source-shape:check→ cases=0, invalid=0.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit
New Features
Tests
Chores