Skip to content

Improve trusted CA support#100

Merged
blind-oracle merged 4 commits into
blind-oracle:mainfrom
EmilyShepherd:better-ca-support
May 21, 2026
Merged

Improve trusted CA support#100
blind-oracle merged 4 commits into
blind-oracle:mainfrom
EmilyShepherd:better-ca-support

Conversation

@EmilyShepherd
Copy link
Copy Markdown
Contributor

@EmilyShepherd EmilyShepherd commented May 20, 2026

This PR:

  • Adds a new configuration option to explicitly set the trusted CA (CT_CA_BUNDLE_FILE / auth.egress.tls_config.ca_bundle_file)
  • Adds support for setting this configuration option via the Helm chart via a new chart value. config.ca_bundle_file.
  • Amends the existing Helm functionality (configured via the customCA value) to use the configuration option rather than mounting the CA as a system trust root for the container.

This approach is preferable to the previous (customCA) behaviour because now when setting a CA it, and only it, will be trusted. Previously the new CA would be trusted but so would all the default trust roots bundled with the container. Explicitly limiting the desired trusted CA bundle is preferable for some security setups.

Additionally, the helm chart continues to support both the customCA method and more explicit configuration via config.ca_bundle_file to support cases where the application wants to use a non-secret based certificate (such as a trust bundle injected in via the runtime, kubelet, serviceaccount CA, etc...)

By adding the tls_config configuration block, I hope to submit feature PRs adding support for client TLS certs to upstream, and TLS support for the server itself.

As a side effect, this PR changes the return signature of the private newProcessor() method from (*processor) to (*processor, error). The tests have been updated to match. As TLS functionality is implemented in fasthttp - this PR simply turns it on - no specific test for TLS support has been added.

@EmilyShepherd
Copy link
Copy Markdown
Contributor Author

Tests are failing because modules are out of date. PR to fix: #101

Comment thread processor.go Outdated
@blind-oracle
Copy link
Copy Markdown
Owner

Thanks! Can you please merge in the main to let the test run fine.

For this commit, this always returns nil, but adding this signature to
the function allows us to return errors when more complex functionality
is added in follow on commits.

Signed-off-by: Emily Shepherd <emily@redcoat.dev>
This allows the config to specify an explict CA Bundle to use when
trusting the upstream target. No other certificates, other than those
signed by one of the CAs in this bundle, will be trusted.

Signed-off-by: Emily Shepherd <emily@redcoat.dev>
Signed-off-by: Emily Shepherd <emily@redcoat.dev>
The helm chart had a field called customCA which, when specified, would
cause a secret to be mounted in the containers /etc/ssl/certs directory,
implictly causing go to pick the CA bundle up and trust it for outbound
TLS connections.

With the added support to explictly define a CA to trust in the
application, this commit updates the helm field's logic to instead use
that. This has the advantage that _only_ this CA will be trusted, not it
in addition to all other standard CAs bundled with the container image.

Signed-off-by: Emily Shepherd <emily@redcoat.dev>
@EmilyShepherd
Copy link
Copy Markdown
Contributor Author

Thanks! Can you please merge in the main to let the test run fine.

Rebased on main and actioned your review comment

@EmilyShepherd
Copy link
Copy Markdown
Contributor Author

I will add a test to cover the CA loading logic and check that it is configured corrected in fasthttp

@blind-oracle blind-oracle merged commit 07117c5 into blind-oracle:main May 21, 2026
1 of 2 checks passed
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