Skip to content

add core client cert validation#309

Merged
wojcik91 merged 27 commits intorelease/2.0from
mtls
Apr 21, 2026
Merged

add core client cert validation#309
wojcik91 merged 27 commits intorelease/2.0from
mtls

Conversation

@wojcik91
Copy link
Copy Markdown
Contributor

@wojcik91 wojcik91 self-assigned this Apr 16, 2026
Comment thread src/tests/mtls.rs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds stricter mTLS enforcement for the Gateway gRPC server by validating Core’s client certificate chain against a configured CA and pinning the expected client certificate serial, including setup-time bundle validation and new mTLS-focused tests.

Changes:

  • Require a complete TLS/mTLS configuration (server cert+key, CA cert, and Core client cert) before starting the gRPC server; add Core-client serial pinning interceptor.
  • Extend setup flow to accept/validate a certificate bundle (CA + component cert + Core client cert), persist CA + Core client cert to disk, and load them on restart.
  • Add end-to-end mTLS tests covering valid client, missing client cert, wrong-serial client cert, and rogue-CA client cert.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/gateway.rs Enforces mTLS-only startup, configures server TLS with CA verification, and adds Core-client serial pinning; purge removes new cert artifacts too.
src/setup.rs Validates CA-signed cert bundle from Core and persists CA + Core client cert for restart-time mTLS config.
src/main.rs Loads the expanded TLS config set (cert/key/CA/core-client-cert) from disk and falls back to setup when absent.
src/lib.rs Adds constants for new cert filenames and wires in the new test module.
src/tests/mtls.rs New mTLS integration tests for acceptance/rejection scenarios.
src/tests/mock_wgapi.rs Adds a minimal WireGuard API stub to support the new tests.
src/tests/mod.rs Registers the new test modules.
Cargo.toml / Cargo.lock Adds dependencies for TLS config + webpki validation and updates defguard git deps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tests/mtls.rs Outdated
Comment thread src/tests/mtls.rs Outdated
Comment thread src/tests/mtls.rs Outdated
Comment thread src/setup.rs
Comment thread src/tests/mtls.rs Outdated
Comment thread src/tests/mtls.rs Outdated
@wojcik91 wojcik91 merged commit 9a90a12 into release/2.0 Apr 21, 2026
2 checks passed
@wojcik91 wojcik91 deleted the mtls branch April 21, 2026 10:43
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.

4 participants