Skip to content

fix local gateway CA trust#177

Open
zsblevins wants to merge 2 commits into
mainfrom
zb/local-cert
Open

fix local gateway CA trust#177
zsblevins wants to merge 2 commits into
mainfrom
zb/local-cert

Conversation

@zsblevins

@zsblevins zsblevins commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Fixes local gateway CA trust

Validation

  • Standard CI passes.
  • Kind integration passes, or this PR explains why it was not run.

The kind integration test is manual due to taking ~30 min to complete. When the PR is ready for
review, approve the current commit and start the suite with these PR comments:

/ok to test <sha>
/kind test

As a fallback, run Actions -> Kind Integration -> Run workflow against the copy-pr-bot generated
pull-request/<PR_NUMBER> branch. Use the default test_path for the full suite, or narrow it
only while debugging.

The completed workflow updates this PR description with its conclusion and exact run URL.

Passing Kind Integration run, if not automatically reported:

Kind integration completed with success for 75b72fe in this workflow run.

Checklist

  • I am familiar with the contributing guidelines in CONTRIBUTING.md.
  • Commits are signed off for DCO compliance.
  • New or existing tests cover these changes, or the PR explains why tests are not needed.
  • Documentation is updated for user-facing behavior changes.
  • Generated artifacts are updated when applicable, such as OpenAPI specs,
    docs screenshots, or Helm/rendered outputs.

Summary by CodeRabbit

  • New Features

    • Local deployments now use a dedicated development Certificate Authority for gateway TLS.
    • Added certificate installation for system, Chrome/Chromium, and Node.js trust stores.
    • Local TLS certificates are automatically configured for local environments.
  • Documentation

    • Updated setup, MCP, Temporal CLI, and troubleshooting guidance for certificate installation and secure Node.js connections.
    • Clarified that insecure TLS options are intended only for diagnostics or separately managed certificates.
  • Tests

    • Added coverage validating local and non-local gateway certificate configurations.

Signed-off-by: Zoe Blevins <zblevins@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 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 Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Local deployments now provision a dedicated gateway CA, install it into system and browser trust stores, expose a PEM path for Node.js, and update local client documentation. CI retrieves the CA secret for HTTPS verification, while non-local deployments retain existing certificate behavior.

Changes

Local CA provisioning and Helm wiring

Layer / File(s) Summary
Local CA configuration and certificate resources
deploy/helm/values.yaml, deploy/helm/values-ci.yaml, installer/src/.../helm_values.py, deploy/helm/templates/certificate.yaml, installer/tests/test_helm_values.py
Local environments enable gateway.certificates.localCA; Helm renders a CA Certificate and Issuer, uses that issuer for the gateway certificate, and tests local versus non-local values.
CA extraction and trust-store installation
Makefile, .github/workflows/kind-integration.yml
make install-cert validates and installs the derived gateway CA secret, and Kind integration retrieves the CA certificate for HTTPS verification.
Local client trust guidance
README.md, docs/getting-started/local-development-quick-start.mdx, docs/install/troubleshooting.mdx, docs/overview/mcp.mdx, docs/temporal/temporal-cli.mdx
Local setup and client instructions use make install-cert and NODE_EXTRA_CA_CERTS, while limiting insecure TLS options to diagnostics or separately managed deployments.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: jojung1, polarweasel, dmathur0

Sequence Diagram(s)

sequenceDiagram
  participant Installer
  participant Helm
  participant CertManager
  participant MakeInstallCert
  participant TrustStores
  Installer->>Helm: enable localCA for local TLS
  Helm->>CertManager: create local CA and issuer
  CertManager-->>Helm: issue gateway certificate
  MakeInstallCert->>CertManager: read gateway CA secret
  CertManager-->>MakeInstallCert: return CA certificate
  MakeInstallCert->>TrustStores: install CA and save PEM copy
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: fixing local gateway CA trust handling.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch zb/local-cert

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

@zsblevins

Copy link
Copy Markdown
Collaborator Author

/ok to test 75b72fe

@zsblevins

Copy link
Copy Markdown
Collaborator Author

/kind test

@github-actions

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
Makefile (2)

1000-1011: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

macOS trust install never removes a previously-trusted local CA, unlike the NSS branch.

The Linux NSS path explicitly deletes any existing "NVCM Local Gateway CA" entry (certutil -D ... || true) before re-adding, but the Darwin security add-trusted-cert call has no equivalent cleanup. Docs (docs/install/troubleshooting.mdx) explicitly tell users to re-run install-cert after recreating the Kind cluster, and each recreation generates a fresh CA keypair with the same CN — so on macOS this accumulates orphaned trusted root CAs in the System keychain indefinitely.

🔒 Proposed fix to remove stale trust entries before installing
 	if [ "$$NVCM_OS" = "Darwin" ]; then \
+		sudo security delete-certificate -c "$$NVCM_CERT_SUBJECT" /Library/Keychains/System.keychain >/dev/null 2>&1 || true; \
 		sudo security add-trusted-cert -d -r trustRoot \
 			-k /Library/Keychains/System.keychain "$$CERT_TMP"; \
🤖 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 `@Makefile` around lines 1000 - 1011, Update the Darwin branch of the
certificate installation flow to remove any existing “NVCM Local Gateway CA”
trust entry from the System keychain before invoking security add-trusted-cert.
Preserve the current certificate installation command and Linux behavior, and
make stale-entry removal tolerant when no matching certificate exists.

937-1022: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Target body length flagged by checkmake.

checkmake reports the install-cert recipe (85 lines) far exceeds the recommended body length. Consider extracting the logic into a ./scripts/install-cert script (as most other multi-step targets in this Makefile already do), keeping the target itself as a thin wrapper.

🤖 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 `@Makefile` around lines 937 - 1022, The install-cert recipe is too long for
Makefile maintainability and checkmake limits. Extract its shell logic into a
dedicated scripts/install-cert executable, preserving all validations,
certificate handling, trust-store installation, and user-facing messages; reduce
the Makefile install-cert target to a thin wrapper that invokes the script with
the required Makefile configuration values.

Source: Linters/SAST tools

🤖 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.

Nitpick comments:
In `@Makefile`:
- Around line 1000-1011: Update the Darwin branch of the certificate
installation flow to remove any existing “NVCM Local Gateway CA” trust entry
from the System keychain before invoking security add-trusted-cert. Preserve the
current certificate installation command and Linux behavior, and make
stale-entry removal tolerant when no matching certificate exists.
- Around line 937-1022: The install-cert recipe is too long for Makefile
maintainability and checkmake limits. Extract its shell logic into a dedicated
scripts/install-cert executable, preserving all validations, certificate
handling, trust-store installation, and user-facing messages; reduce the
Makefile install-cert target to a thin wrapper that invokes the script with the
required Makefile configuration values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0c516325-ca14-416d-b4bb-966050995723

📥 Commits

Reviewing files that changed from the base of the PR and between a674e33 and 75b72fe.

📒 Files selected for processing (12)
  • .github/workflows/kind-integration.yml
  • Makefile
  • README.md
  • deploy/helm/templates/certificate.yaml
  • deploy/helm/values-ci.yaml
  • deploy/helm/values.yaml
  • docs/getting-started/local-development-quick-start.mdx
  • docs/install/troubleshooting.mdx
  • docs/overview/mcp.mdx
  • docs/temporal/temporal-cli.mdx
  • installer/src/nv_config_manager_installer/helm_values.py
  • installer/tests/test_helm_values.py

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.

1 participant