You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Attestation provider server uses unix sockets and simple binary protocol rather than HTTP - #112
For context: We are concerned about having the attested TLS proxy require root privileges in order to generate quotes. Before switching to do quote generation in a separate process, we want to make some improvements to the inter-process communication.
This improves security of the attestation provider server by using unix sockets rather than the loopback interface, giving stronger guarantees that it runs on the same host as the caller.
It also switches the protocol used from HTTP to a very simple binary protocol.
The client who wants an attestation sends the 64 byte quote input, and the service responds with a SCALE encoded Result<AttestationExchangeMessage, ProviderError>.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
An attacker can replace a parent directory under a writable ancestor and redirect the privileged socket chmod through a symlink to an attacker-selected file.
Replaces the HTTP attestation provider with a Unix socket service, strengthening same-host guarantees while keeping privileged attestation generation separate from applications.
Changes:
Adds a length-prefixed SCALE protocol with request validation, response limits, and client deadlines.
Migrates generator configuration and the CLI to socket paths, with socket permissions and lifecycle cleanup.
Updates dependencies and documentation, and adds protocol and socket lifecycle tests.
File
Description
readme.md
Describes the provider as Unix socket-based.
crates/attestation/src/provider.rs
Adds the synchronous socket client and wire response types.
crates/attestation/src/lib.rs
Replaces provider URLs with socket paths.
crates/attestation/README.md
Documents socket configuration and Unix platform support.
crates/attestation/Cargo.toml
Adds the socket client dependency.
crates/attestation-provider-server/src/main.rs
Migrates CLI configuration and adds shutdown handling.
crates/attestation-provider-server/src/lib.rs
Implements socket serving, permissions, cleanup, and tests.
crates/attestation-provider-server/README.md
Documents directory and socket permissions.
crates/attestation-provider-server/Cargo.toml
Replaces HTTP dependencies with socket-related dependencies.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A recoverable accept error such as file-descriptor exhaustion shuts down the provider and removes its socket instead of retrying, turning temporary resource exhaustion into a permanent service outage.
A recoverable accept error now shuts down the entire provider. For example, reaching the process file-descriptor limit makes accept() return EMFILE; this ? exits the server and causes the CLI to remove the socket, even though the same listener could resume accepting once descriptors are freed. Log and retry accept failures with a backoff so temporary resource exhaustion does not permanently stop attestation service.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Timed socket reads abort on ErrorKind::Interrupted instead of retrying within the existing deadline, potentially rejecting a valid response before the one-second timeout.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Retry interrupted socket reads until the deadline
crates/attestation/src/provider.rs:99
Retry ErrorKind::Interrupted rather than aborting the request when a handled signal interrupts a timed socket read. Otherwise, a valid response can be rejected before the one-second deadline, including during this final EOF check; the frame-reading loop at line 76 has the same issue. Retry both reads while recomputing the remaining timeout from the existing deadline.
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
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.
For context: We are concerned about having the attested TLS proxy require root privileges in order to generate quotes. Before switching to do quote generation in a separate process, we want to make some improvements to the inter-process communication.
This improves security of the attestation provider server by using unix sockets rather than the loopback interface, giving stronger guarantees that it runs on the same host as the caller.
It also switches the protocol used from HTTP to a very simple binary protocol.
The client who wants an attestation sends the 64 byte quote input, and the service responds with a SCALE encoded
Result<AttestationExchangeMessage, ProviderError>.