-
Notifications
You must be signed in to change notification settings - Fork 48
feat(auth-proxy): add custom CA and mTLS support #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Saad Farooq (saad-supports-langchain)
wants to merge
2
commits into
main
Choose a base branch
from
saad/feat-auth-proxy-custom-ca-mtls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # langsmith-auth-proxy | ||
|
|
||
|    | ||
|    | ||
|
|
||
| Helm chart to deploy the langsmith auth-proxy application. | ||
|
|
||
|
|
@@ -65,6 +65,81 @@ Control which phases are sent to the transformer via `processingMode`: | |
|
|
||
| `BUFFERED` mode buffers the entire body before sending — simplest for transformations but uses more memory for large payloads. `STREAMED` sends chunks incrementally (complex to implement). Use `NONE` to skip body processing entirely. | ||
|
|
||
| ## Custom CA support | ||
|
|
||
| Use `customCa.secretName` and `customCa.secretKey` to mount a CA bundle that Envoy should trust for outbound HTTPS connections. | ||
|
|
||
| This bundle is applied to every HTTPS peer Envoy validates in this chart: | ||
| - The main upstream cluster defined by `authProxy.upstream` | ||
| - The remote JWKS cluster when `authProxy.jwksUri` uses `https://` | ||
|
|
||
| ### Secret example | ||
|
|
||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: corporate-ca-bundle | ||
| type: Opaque | ||
| stringData: | ||
| ca.crt: | | ||
| -----BEGIN CERTIFICATE----- | ||
| ... | ||
| -----END CERTIFICATE----- | ||
| ``` | ||
|
|
||
| ```yaml | ||
| customCa: | ||
| secretName: corporate-ca-bundle | ||
| secretKey: ca.crt | ||
| ``` | ||
|
|
||
| ### Important notes | ||
|
|
||
| - Provide the full CA bundle Envoy should trust, not just a single private root. If your upstream or JWKS endpoint chains to public roots as well, include those certificates in the bundle. | ||
| - `customCa.secretName` and `customCa.secretKey` must either both be set or both be left empty. | ||
| - Envoy reads the CA bundle from a mounted Secret volume. To make trust changes deterministic, roll the pod when the bundle changes. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't pod rolling automatic?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I think this was probably overdone, removed the rolloutToken field and checksums to simplify |
||
| - Required when using `mtls` — see [mTLS support](#mtls-support) below. | ||
|
|
||
| ### Rotation workflow | ||
|
|
||
| - Preferred: publish a new Secret name such as `corporate-ca-bundle-v2` and update `customCa.secretName`. | ||
| - Alternate: keep the same Secret name and bump `customCa.rolloutToken` to force Helm to update the pod template and restart Envoy. | ||
|
|
||
| ## mTLS support | ||
|
|
||
| Use `mtls.secretName`, `mtls.certKey`, and `mtls.keyKey` to present a client certificate when connecting to the upstream. This is required when the upstream enforces mutual TLS. | ||
|
|
||
| `customCa` **must** also be configured — without a trusted CA bundle Envoy sends client certificates but does not verify the upstream server's identity, which is not mutual authentication. The chart will fail validation if `mtls` is set without `customCa`. | ||
|
|
||
| ### Secret example | ||
|
|
||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: upstream-client-cert | ||
| type: kubernetes.io/tls | ||
| data: | ||
| tls.crt: <base64-encoded-client-certificate> | ||
| tls.key: <base64-encoded-client-private-key> | ||
| ``` | ||
|
|
||
| ```yaml | ||
| customCa: | ||
| secretName: corporate-ca-bundle | ||
| secretKey: ca.crt | ||
| mtls: | ||
| secretName: upstream-client-cert | ||
| certKey: tls.crt | ||
| keyKey: tls.key | ||
| ``` | ||
|
|
||
| ### Rotation workflow | ||
|
|
||
| - Preferred: publish a new Secret name such as `upstream-client-cert-v2` and update `mtls.secretName`. | ||
| - Alternate: keep the same Secret name and bump `mtls.rolloutToken` to force a pod restart. | ||
|
|
||
| ## Values | ||
|
|
||
| | Key | Type | Default | Description | | ||
|
|
@@ -173,6 +248,10 @@ Control which phases are sent to the transformer via `processingMode`: | |
| | commonLabels | object | `{}` | Labels that will be applied to all resources created by the chart | | ||
| | commonPodAnnotations | object | `{}` | Annotations that will be applied to all pods created by the chart | | ||
| | commonPodSecurityContext | object | `{}` | Common pod security context applied to all pods. Component-specific podSecurityContext values will be merged on top of this (component values take precedence). | | ||
| | customCa | object | `{"rolloutToken":"","secretKey":"","secretName":""}` | Custom CA certificate for upstream TLS verification. Envoy uses BoringSSL and does NOT trust the system CA store. Provide a Kubernetes Secret with your CA bundle to verify upstream HTTPS connections signed by private/internal CAs. | | ||
| | customCa.rolloutToken | string | `""` | Optional manual rollout trigger. Bump this when the Secret contents change without changing secretName, so Helm updates the pod template and restarts Envoy. | | ||
| | customCa.secretKey | string | `""` | Key within the Secret that holds the CA certificate PEM data | | ||
| | customCa.secretName | string | `""` | Name of the Kubernetes Secret containing the CA certificate | | ||
| | fullnameOverride | string | `""` | String to fully override `"langsmith.fullname"` | | ||
| | gateway | object | `{"annotations":{},"enabled":false,"hostnames":[],"labels":{},"name":"","namespace":"","sectionName":""}` | Gateway API HTTPRoute configuration | | ||
| | gateway.hostnames | list | `[]` | Hostnames to match on | | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is upstream always https?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated readme to say it's only needed if upstream is using a private/internal CA