Repository navigation
feat(kernel): support mTLS client certificates - #456
Merged
Merged
Conversation
Expose a fail-closed kernel client-certificate option and forward the paired identity through the merged kernel C ABI, with hermetic handshake coverage. Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
WithKernelClientCertificate(certPEM, keyPEM)configurationMotivation
The default Thrift backend can use mTLS through a caller-supplied
WithTransport, but the kernel backend owns a separate Rust HTTP stack and rejects custom Go transports. The Rust kernel already supports client identities through its core, PyO3, and N-API surfaces; kernel PR #289 added the paired C-ABI setter required by Go.API and behavior
ErrInvalidKernelConfigErrRequiresKernelBackendrather than silently ignoring itThe kernel builds one shared TLS-configured HTTP client, so the identity is available to kernel-owned SEA requests, OAuth discovery/token exchange, and CloudFetch. A certificate is presented only when the remote TLS server requests one.
Kernel dependency
KERNEL_REVnow pins merged kernel commite8d60c93b7459947d2e3e4113f62e6bda37fde8e, which exports:kernel_session_config_set_tls_client_certificate(...)The kernel PR provides native-TLS and rustls handshake coverage for valid, missing, and wrong-CA client identities.
Testing
Configuration and validation
Focused untagged tests cover:
ErrInvalidKernelConfigResults:
internal/configdeep-copy tests — 5 passedReal C-ABI invocation
The tagged backend test constructs real kernel session configs and calls the linked setter through cgo for:
Result: 6 passed.
Hermetic transport E2E
kernel_mtls_test.gogenerates a private CA plus server/client identities at runtime and starts a local HTTPS probe. It drives:Go option → Go config → cgo → kernel C ABI → Rust reqwest/rustls → TLS serverIt verifies:
WithKernelTrustedCertsThe test uses one synchronous connector attempt, requires no warehouse credentials, and runs in regular kernel-tagged PR CI through
make test-kernel.Results against the final merged kernel pin:
go vet— passedgit diff --check— passedNo live warehouse mTLS claim is made because the available Databricks test warehouse does not require client certificates; the hermetic server is the client-certificate enforcement endpoint.