Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions crates/attestation-provider-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "attestation-provider-server"
description = "An HTTP server which provides attestations"
description = "A Unix socket server which provides attestations"
version = "0.1.0"
edition = "2024"
license = "MIT"
Expand All @@ -12,15 +12,16 @@ workspace = true

[dependencies]
attestation = { workspace = true }
tokio = { workspace = true }
tokio = { workspace = true, features = ["net", "io-util", "signal", "macros", "rt-multi-thread"] }
rustls = { workspace = true, default-features = false, features = ["aws_lc_rs"] }

axum = "0.8.6"
clap = { version = "4.5.51", features = ["derive", "env"] }
anyhow = "1.0.100"
hex = "0.4.3"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["env-filter", "json"] }
parity-scale-codec = "3.7.5"
reqwest = { workspace = true }
thiserror = "2.0.17"

nix = { version = "0.31.2", default-features = false, features = ["user", "fs"] }
socket2 = "0.6.3"

[dev-dependencies]
tempfile = "3.23.0"
27 changes: 27 additions & 0 deletions crates/attestation-provider-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Attestation provider service

Generates quotes and collects platform metadata in a privileged process so
applications can request attestations through a Unix socket without those
privileges.

Use `--socket-path` and provision its parent directory with the application's
access group and mode `2750`.

Use an absolute socket path without symlink directories or `..` components.
Every directory in the path must be owned by root or the service user and must
not be group/other writable. Sticky ancestors such as `/tmp` are allowed, but
the socket's immediate parent must never be group/other writable. For example,
use `/run/attestation-provider/attestation.sock` with a protected parent directory.

The service creates the socket with mode `0660`.

On normal shutdown (SIGINT or SIGTERM), the service removes its socket. After
an abrupt exit such as SIGKILL, the next startup removes a stale socket owned
by the service user if a connection probe returns connection refused. Active
sockets, symlinks, and other existing files are preserved.

The service holds an exclusive lock on `<socket-path>.lock` from before socket
cleanup until shutdown, preventing competing instances from removing each other's
sockets during startup. The lock file must be a regular file owned by the service
user and is created with mode `0600`. It remains on disk across restarts; do not
delete it while the service is running. SIGKILL releases the lock automatically.
Loading
Loading