add core client cert validation#273
Merged
wojcik91 merged 27 commits intorelease/2.0from Apr 21, 2026
Merged
Conversation
moubctez
reviewed
Apr 16, 2026
There was a problem hiding this comment.
Pull request overview
Adds mTLS hardening for the Core↔Proxy gRPC channel by introducing Core client certificate chain validation and serial pinning, and updates setup to accept/store the CA + Core client cert alongside the component cert.
Changes:
- Replace the old gRPC TLS
ConfigurationwithTlsConfig(server cert/key + CA cert + pinned Core client cert DER). - Validate the certificate bundle received during setup and configure gRPC server with CA-validated mTLS + serial-pin interceptor.
- Add integration-style mTLS tests covering valid client, missing client cert, wrong serial, and rogue CA scenarios.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/setup.rs | Accepts CertBundle, validates CA-signed component + Core client certs, and passes TlsConfig via oneshot. |
| src/grpc.rs | Configures gRPC server TLS using CA + serial pinning; purge removes additional cert files. |
| src/http.rs | Writes/reads additional TLS artifacts (CA cert + Core client cert) during setup and restart. |
| src/main.rs | Loads full TlsConfig (including CA + Core client cert) from disk at startup. |
| src/lib.rs | Registers new test module and removes unused CommsChannel type. |
| src/tests/mtls.rs | Adds mTLS/serial-pinning integration tests for the gRPC server. |
| src/tests/mod.rs | Wires the mTLS test module. |
| Cargo.toml | Adds defguard_grpc_tls, rustls-webpki, rustls-pki-types, and a tokio dev-dependency. |
| Cargo.lock | Locks dependency updates required by the new TLS validation stack. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
moubctez
reviewed
Apr 21, 2026
t-aleksander
approved these changes
Apr 21, 2026
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.
Validate core cert when establishing gRPC connection.
Related DefGuard/defguard#2695
Needs: