Skip to content

add mtls for controller and server communication - #589

Merged
thesujai merged 4 commits into
mainfrom
feat/mtls-controller-server
Sep 4, 2026
Merged

thesujai merged 4 commits into
mainfrom
feat/mtls-controller-server

Conversation

@thesujai

@thesujai thesujai commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

add mtls for controller and server communication
Closes AGE-2096

Changes

add mtls for controller and server communication

How was this tested?

By creating a local CA, then making a request to server with the tls certificate

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Enabling mTLS changes transport and access control for the API and controller traffic; misconfigured certs or proxies without client certs can break schedules and health checks outside /healthz.

Overview
Adds optional mutual TLS (off by default) for distributed deployments: the server can listen on HTTPS with client-certificate enforcement on all routes except /healthz, and the schedule controller dials the server over HTTPS with a client cert when TRUEFORGE_MTLS_ENABLED is set. Configuration is TRUEFORGE_MTLS_ENABLED / TRUEFORGE_MTLS_CERTS_DIR (tls.crt, tls.key, ca.crt), separate from ServiceFoundry TRUEFOUNDRY_MTLS_*.

Implementation introduces shared http/tls.ts (HTTPS serve options, cert middleware, undici outbound dispatcher) and refactors ServiceFoundry internalTls.ts to use it. The Helm chart gains mtls.* values: mount the TLS secret on server and controller, inject env, and switch HTTP probes to scheme: HTTPS when enabled.

Reviewed by Cursor Bugbot for commit 31b05a2. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 31b05a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c0d8baa. Configure here.

Comment thread packages/trueforge/src/config.ts Resolved
Comment thread packages/trueforge/src/http/tls.ts Resolved
Comment thread packages/trueforge/src/config.ts Resolved
Comment thread packages/trueforge/src/http/tls.ts Resolved
Comment thread packages/trueforge/src/http/tls.ts Resolved
Comment thread packages/trueforge/src/app.ts Resolved
Comment thread packages/trueforge/src/app.ts Resolved
Comment thread packages/trueforge/src/http/tls.ts Resolved
Comment thread packages/trueforge/src/controller.ts Resolved

@chiragjn chiragjn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keeping it approved

@thesujai
thesujai enabled auto-merge (squash) September 4, 2026 09:53
@thesujai
thesujai disabled auto-merge September 4, 2026 10:01
@thesujai
thesujai merged commit 49164e7 into main Sep 4, 2026
9 checks passed
@thesujai
thesujai deleted the feat/mtls-controller-server branch September 4, 2026 10:01
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.

2 participants