add mTLS for gateway & proxy communication#2726
Open
wojcik91 wants to merge 25 commits intorelease/2.0from
Open
add mTLS for gateway & proxy communication#2726wojcik91 wants to merge 25 commits intorelease/2.0from
wojcik91 wants to merge 25 commits intorelease/2.0from
Conversation
This was referenced Apr 16, 2026
moubctez
reviewed
Apr 16, 2026
| Ok(cert) | ||
| } | ||
|
|
||
| /// Issue a Core gRPC client certificate for a specific gateway or proxy. |
Contributor
There was a problem hiding this comment.
Suggested change
| /// Issue a Core gRPC client certificate for a specific gateway or proxy. | |
| /// Issue a Core gRPC client certificate for a specific Gateway or Edge. |
moubctez
reviewed
Apr 16, 2026
| } | ||
| } | ||
|
|
||
| /// A Core gRPC client certificate issued for a specific gateway or proxy component. |
Contributor
There was a problem hiding this comment.
Suggested change
| /// A Core gRPC client certificate issued for a specific gateway or proxy component. | |
| /// A Core gRPC client certificate issued for a specific Gateway or Edge component. |
moubctez
reviewed
Apr 16, 2026
| { | ||
| sqlx::query( | ||
| pub async fn mark_all_disconnected<'e, E: PgExecutor<'e>>(executor: E) -> sqlx::Result<()> { | ||
| query( |
Contributor
There was a problem hiding this comment.
Suggested change
| query( | |
| query!( |
moubctez
reviewed
Apr 16, 2026
| let created_modified_at = created_alias_row.modified_at; | ||
|
|
||
| tokio::time::sleep(std::time::Duration::from_millis(2)).await; | ||
| sleep(std::time::Duration::from_millis(2)).await; |
moubctez
reviewed
Apr 16, 2026
| let updated_modified_at = updated_alias_row.modified_at; | ||
|
|
||
| tokio::time::sleep(std::time::Duration::from_millis(2)).await; | ||
| sleep(std::time::Duration::from_millis(2)).await; |
moubctez
reviewed
Apr 16, 2026
| let created_modified_at = created_destination_row.modified_at; | ||
|
|
||
| tokio::time::sleep(std::time::Duration::from_millis(2)).await; | ||
| sleep(std::time::Duration::from_millis(2)).await; |
moubctez
reviewed
Apr 16, 2026
| let updated_modified_at = updated_destination_row.modified_at; | ||
|
|
||
| tokio::time::sleep(std::time::Duration::from_millis(2)).await; | ||
| sleep(std::time::Duration::from_millis(2)).await; |
moubctez
reviewed
Apr 16, 2026
| let created_modified_at = created_rule_row.modified_at; | ||
|
|
||
| tokio::time::sleep(std::time::Duration::from_millis(2)).await; | ||
| sleep(std::time::Duration::from_millis(2)).await; |
moubctez
reviewed
Apr 16, 2026
| let updated_modified_at = updated_rule_row.modified_at; | ||
|
|
||
| tokio::time::sleep(std::time::Duration::from_millis(2)).await; | ||
| sleep(std::time::Duration::from_millis(2)).await; |
moubctez
reviewed
Apr 16, 2026
| let mut results = Vec::new(); | ||
| // Give the handler a brief moment to enqueue the message. | ||
| tokio::time::sleep(std::time::Duration::from_millis(50)).await; | ||
| sleep(Duration::from_millis(50)).await; |
moubctez
reviewed
Apr 16, 2026
| async fn drain_clear_https_certs(&mut self) -> usize { | ||
| let mut results = 0; | ||
| tokio::time::sleep(std::time::Duration::from_millis(50)).await; | ||
| sleep(Duration::from_millis(50)).await; |
moubctez
reviewed
Apr 16, 2026
| timeout(TEST_TIMEOUT, async { | ||
| while self.events_tx().receiver_count() <= initial_event_receivers { | ||
| tokio::time::sleep(Duration::from_millis(20)).await; | ||
| sleep(Duration::from_millis(20)).await; |
moubctez
reviewed
Apr 16, 2026
| } | ||
|
|
||
| tokio::time::sleep(Duration::from_millis(20)).await; | ||
| sleep(Duration::from_millis(20)).await; |
moubctez
reviewed
Apr 16, 2026
| } | ||
|
|
||
| /// Create a rustls client config that enforces the pinned component certificate serial. | ||
| /// Build a tonic [`ServerTlsConfig`] for a gateway or proxy gRPC server that enforces |
Contributor
There was a problem hiding this comment.
Suggested change
| /// Build a tonic [`ServerTlsConfig`] for a gateway or proxy gRPC server that enforces | |
| /// Build a tonic [`ServerTlsConfig`] for a Gateway or Edge gRPC server that enforces |
moubctez
reviewed
Apr 16, 2026
| @@ -0,0 +1,58 @@ | |||
| //! Server-side mTLS utilities for gateway and proxy gRPC servers. | |||
Contributor
There was a problem hiding this comment.
Suggested change
| //! Server-side mTLS utilities for gateway and proxy gRPC servers. | |
| //! Server-side mTLS utilities for Gateway and Edge gRPC servers. |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| // Delay, so send_and_forget() can process the message. | ||
| tokio::time::sleep(Duration::from_secs(2)).await; | ||
| sleep(Duration::from_secs(2)).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| let shutdown_signal = | ||
| tokio::time::timeout(std::time::Duration::from_secs(1), shutdown_rx).await; | ||
| let shutdown_signal = timeout(Duration::from_secs(1), shutdown_rx).await; |
moubctez
reviewed
Apr 16, 2026
| assert_eq!(wizard.active_wizard, ActiveWizard::None); | ||
|
|
||
| let shutdown = tokio::time::timeout(std::time::Duration::from_secs(1), shutdown_rx).await; | ||
| let shutdown = timeout(Duration::from_secs(1), shutdown_rx).await; |
moubctez
reviewed
Apr 16, 2026
|
|
||
| let shutdown_signal = | ||
| tokio::time::timeout(std::time::Duration::from_secs(1), shutdown_rx).await; | ||
| let shutdown_signal = timeout(std::time::Duration::from_secs(1), shutdown_rx).await; |
Contributor
There was a problem hiding this comment.
Magic value and just use Duration trimming std::time.
moubctez
reviewed
Apr 16, 2026
moubctez
reviewed
Apr 16, 2026
j-chmielewski
requested changes
Apr 17, 2026
| /// | ||
| /// ```rust,ignore | ||
| /// ServiceBuilder::new() | ||
| /// .layer(tonic::service::interceptor(certificate_serial_interceptor(Some(serial)))) |
Contributor
There was a problem hiding this comment.
Suggested change
| /// .layer(tonic::service::interceptor(certificate_serial_interceptor(Some(serial)))) | |
| /// .layer(tonic::service::interceptor(certificate_serial_interceptor(serial))) |
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.
Generate and store core client certificates during component setup.
Those certs are then sent to the gateway/proxy along with CA cert so they can validate client identity.
Related #2695
Needs DefGuard/proto#74