Skip to content

fix(onboard): report a dropped corporate CA import - #9410

Open
udsy19 wants to merge 1 commit into
NVIDIA:mainfrom
udsy19:fix/8454-corporate-ca-runtime
Open

fix(onboard): report a dropped corporate CA import#9410
udsy19 wants to merge 1 commit into
NVIDIA:mainfrom
udsy19:fix/8454-corporate-ca-runtime

Conversation

@udsy19

@udsy19 udsy19 commented Aug 18, 2026

Copy link
Copy Markdown

Summary

Onboarding resolved and validated a corporate CA from a conventional CA variable or a host
trust-store anchor, then dropped it with no diagnostic when the staged Dockerfile declared neither
build argument that root-owned runtime trust needs. Onboarding now reports the source variable,
the source path, and the reason.

Related Issue

Contributes to #8454. This PR does not close #8454.

The reported run does not reach the branch this PR changes. On the shipped Dockerfile that run
bakes the anchor and onboarding prints a positive bake message. This PR corrects one adjacent
silent drop found while tracing the report. See "Root cause" for what the trace established and
what it did not.

Changes

  • Replace the silent no-op branch in patchStagedDockerfile with an operator warning when a
    resolved corporate CA cannot be baked into the staged Dockerfile. The explicit
    NEMOCLAW_CORPORATE_CA_BUNDLE source keeps its existing fail-closed behavior.
  • Report the source variable, the source path, and the missing build argument through the existing
    warnCorporateCa() helper. No new helper, configuration, or fallback path is added.
  • Extend the two existing tests that already own these branches to assert the diagnostic.

Root cause

Established, and it explains MERGED_CA_EXIT:1 in the report:

The documented runtime trust contract in docs/security/configure-corporate-ca-trust.mdx
root-owned /usr/local/share/nemoclaw/corporate-ca.pem plus a merged
/run/nemoclaw/managed-startup-ca-bundle.pem — is implemented only by mergeCorporateCa() at
src/lib/onboard/managed-startup/image-runtime.ts:1031-1059. An onboard that is not
tempManagedRuntime and is not a rebuild gets managedImages: null at
src/lib/onboard/managed-workload/onboard-orchestration.ts:141-148, which makes
managedImageRuntimeSupportError() return a reason at src/lib/onboard/workload/source.ts:131-133,
which makes src/lib/onboard/workload/preparation.ts:234-253 return a legacy-dockerfile workload
with fallbackDiagnostic: null. No managed startup profile is built, so mergeCorporateCa() never
runs. The legacy path writes its merged bundle to /tmp/nemoclaw-ca-bundle.pem
(scripts/lib/corporate-ca-runtime.sh:23).

scripts/nemoclaw-start.sh has never written /run/nemoclaw/managed-startup-ca-bundle.pem, so the
shared-helper extraction in #9244 preserved behavior and is not the reported regression.

Not established, and this is why the PR does not close the issue:

CORPORATE_CA_EXIT:1 does not follow from the checked-in source. Patching the shipped Dockerfile
with the reporter's variable and agent bakes the anchor, sets
ARG NEMOCLAW_MANAGED_IMAGE_RUNTIME_USER=root, and prints the bake message. Dockerfile:659-665
writes the anchor as root:root 0444 in the single final stage. Distinguishing a skipped or cached
image rebuild needs the reporter's build log, which I requested on the issue.

QA escape

Two detection gaps, at different sizes.

The gap this PR closes: the two branches that dropped a resolved corporate CA already had tests in
src/lib/onboard/dockerfile-patch-corporate-ca.test.ts
does not bake a fallback corporate CA without root startup selection (#8803) and
stays a no-op for a fallback CA when a custom Dockerfile lacks the ARG. Both assert the correct
outcome, that the build argument stays empty and that onboarding does not throw. Neither asserts
that NemoClaw tells the operator, so a validated CA could be dropped in silence. Both tests keep
their assertions unchanged and still pass. The two tests added here assert the diagnostic.

The larger gap, which this PR does not close, has two parts.

Onboarding prints baking corporate proxy CA ... into the sandbox image trust when it patches the
staged Dockerfile, before any image build, and nothing later verifies that the built image carries
the anchor. A skipped or cached rebuild therefore produces a positive bake message, exit code 0,
and a Ready phase with no anchor in the sandbox.

End-to-end coverage asserts the documented runtime contract only for a managed image.
scripts/checks/run-managed-image-direct-e2e.ts:638-658 and
scripts/checks/run-managed-image-openshell-e2e.ts:468-472 require
/run/nemoclaw/managed-startup-ca-bundle.pem at 0:0:444. The legacy path that an ordinary
onboard takes has no equivalent assertion, so the difference the reporter measured was never
observed by a test.

Closing this gap needs maintainer direction on where trust state belongs in readiness output, so I
have not built it here.

What this PR does not change

The legacy direct-start path still writes /tmp/nemoclaw-ca-bundle.pem rather than
/run/nemoclaw/managed-startup-ca-bundle.pem. Making the legacy image publish the managed runtime
bundle adds a root-owned trust anchor to an image that
docs/security/configure-corporate-ca-trust.mdx describes as read-only by mode and not a privilege
boundary. Under the Product Scope Gate in CLAUDE.md, that needs an accepted issue or design
decision defining ownership, lifecycle, compatibility, security, and validation. I requested
maintainer direction on the issue rather than establishing it in a bug fix.

The second comment on the issue reports an inference.local HTTP 503 on an OpenAI-compatible
route. The reporter states that gateway-side TLS diagnostics are still needed to confirm the cause,
so this PR does not claim to address it.

Type of Change

  • Code change (feature, bug fix, or refactor)

Quality Gates

  • Tests added or updated for changed behavior
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference,
    runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded —
    reviewer/approval link/justification: not obtained. This change touches onboarding and
    security paths and needs maintainer review before merge.

Verification

  • PR description includes a Signed-off-by: line. The commit is signed with an SSH signing
    key; confirm the Verified badge on GitHub after the branch is pushed.
  • npm run validate:pr passed. Every pre-commit, commit-msg, and pre-push hook reported
    Passed, including Codebase growth guardrails, TypeScript (CLI), and
    TypeScript (plugin).
  • Targeted behavior tests pass for the current change set —
    npx vitest run --project cli src/lib/onboard/dockerfile-patch-corporate-ca.test.ts
    → 1 file passed, 16 tests passed.
  • No secrets, API keys, or credentials committed

Additional evidence:

  • Both new tests fail without the source change. Reverting only
    src/lib/onboard/dockerfile-patch.ts to the parent commit gives 2 failed and 14 passed.
  • npm run typecheck:cli → 0 errors, on this commit and on the parent commit. An unbuilt dist/
    reports 73 resolution errors on both commits with identical text; building dist/ clears all
    73. No error references either changed file in either state.
  • npx oxlint src/lib/onboard/dockerfile-patch.ts src/lib/onboard/dockerfile-patch-corporate-ca.test.ts
    → exit code 0, no findings.
  • npx commitlint --from HEAD~1 --to HEAD → exit code 0.
  • npm test and npm run test:changed were not run.

Signed-off-by: Udaya Tejas udayatejas2004@gmail.com

Summary by CodeRabbit

  • Bug Fixes
    • Added clear warnings when a corporate certificate fallback cannot be applied to a custom Dockerfile.
    • Onboarding and sandbox startup now continue successfully when required Dockerfile settings are unavailable.
    • Warnings identify the certificate source, certificate path, and missing Dockerfile requirement.
    • Certificate settings remain unchanged when they cannot be safely applied.

@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 451eb57a-168f-490a-96c1-7839ca9bbf73

📥 Commits

Reviewing files that changed from the base of the PR and between dd8c426 and ddd4338.

📒 Files selected for processing (1)
  • src/lib/onboard/dockerfile-patch-corporate-ca.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/onboard/dockerfile-patch-corporate-ca.test.ts

Included review availability: Your plan includes up to 12 reviews per rolling hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The onboarding Dockerfile patch now warns when fallback corporate CA baking is skipped. Tests cover missing CA build arguments and uncontrolled runtime-user declarations while confirming that Dockerfile state remains unchanged.

Changes

Corporate CA fallback handling

Layer / File(s) Summary
Fallback warning logic and validation
src/lib/onboard/dockerfile-patch.ts, src/lib/onboard/dockerfile-patch-corporate-ca.test.ts
The patch reports missing Dockerfile requirements through warnCorporateCa. Tests verify the source variable, CA path, required argument, warning output, and unchanged CA build arguments.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to ddd43

This change improves diagnostics when a corporate CA is dropped, but it modifies onboarding and security-sensitive trust handling. The required sensitive-path review is still incomplete, so merge should wait for maintainer review or an approved waiver.

Possibly related PRs

  • NVIDIA/NemoClaw#9244: Modifies related corporate CA fallback and runtime handling in a different code path.
  • NVIDIA/NemoClaw#9254: Restores the corporate CA runtime script in the optimized sandbox build context.

Suggested labels: area: security, security

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds warnings but does not install the corporate CA, create the merged trust bundle, or configure CA environment variables required by issue #8454. Implement the managed CA installation, merged runtime trust bundle, and CA environment variable configuration required by issue #8454.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The warning logic and related tests directly support the PR objective and do not introduce unrelated code changes.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the change to report when a corporate CA import is dropped during onboarding.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@jyaunches jyaunches left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOC Reduction / Codebase Simplicity Review

Why this blocks

The production change correctly reuses the existing warnCorporateCa owner, but the new tests recreate two fallback scenarios that this file already covers:

  • dockerfile-patch-corporate-ca.test.ts:303-314 already exercises the missing runtime-user branch recreated at lines 363-383.
  • dockerfile-patch-corporate-ca.test.ts:337-343 already exercises the missing corporate-CA argument branch recreated at lines 345-361.

Both additions repeat environment setup, a Dockerfile fixture, the patch call, and the final-state assertion solely to inspect console.error. This adds roughly 40 test lines without adding a control-flow branch.

Refactor direction

Add the warning assertions to the two tests that already own these fallback branches. Preserve both the no-bake outcome and warning contract. Introduce a warning-capture helper only if it produces a net reduction across those existing cases.

Expected result

The same two fallback behaviors and diagnostics remain covered, while most of the duplicated test setup disappears and each production branch has one owning scenario.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 1 warning · 0 suggestions
  • Model comparison: normalized findings differ; normalized terminology decisions differ; normalized E2E selections match; Nemotron reported the same number of blockers, 1 more warning, the same number of suggestions.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

1 semantic terminology decision

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — dropped corporate CA at src/lib/onboard/dockerfile-patch-corporate-ca.test.ts:319: Keep the term in the test assertion because it distinguishes a reported skipped import from a successful corporate CA bake.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite for the commit under review.

Recommended E2E: None

Manual-only E2E: onboard-repair, onboard-resume, cloud-onboard
The manual PR workflow does not run these selectors for the commit under review. Run them from reviewed code on main.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

When a conventional CA variable or a host trust-store anchor resolved a corporate CA and the
staged Dockerfile declared neither build argument that root-owned runtime trust needs,
onboarding dropped the validated anchor as a silent no-op. The operator saw no diagnostic, so
the sandbox started without the corporate trust anchor and external TLS through the corporate
proxy failed later with nothing pointing back at onboarding.

The explicit NEMOCLAW_CORPORATE_CA_BUNDLE source already fails closed. That branch now reports
the source variable, the source path, and the reason through the existing corporate-CA warning
helper.

This does not close NVIDIA#8454. The reported run bakes the anchor into the shipped Dockerfile and
never reaches this branch; the placement half of that report needs maintainer direction.

Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
@udsy19
udsy19 force-pushed the fix/8454-corporate-ca-runtime branch from dd8c426 to ddd4338 Compare August 18, 2026 05:31
@udsy19

udsy19 commented Aug 18, 2026

Copy link
Copy Markdown
Author

Thanks — refactored as directed.

The two new tests are gone. The warning assertions now live in the two tests that already own
these branches: does not bake a fallback corporate CA without root startup selection (#8803)
and stays a no-op for a fallback CA when a custom Dockerfile lacks the ARG. Each keeps its
existing no-bake assertion (build argument state, and no-throw on the second) and adds the
diagnostic contract: the WARNING marker, the source env var, the source path, and the build
argument that blocked the bake.

No warning-capture helper — factoring one out was line-neutral here, so it did not earn itself.

Net lines vs main went from +53 to +32; the test file's share dropped from +40 to +19.
vitest, typecheck:cli, oxlint, and validate:pr (growth guardrails included) all pass.

@udsy19
udsy19 requested a review from jyaunches August 18, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ubuntu 24.04][Security] corporate CA accepted during onboard but missing from managed runtime

2 participants