Commit 864a988
committed
key-provider-build: pin transitive deps for reproducible mr_enclave
The upstream Dockerfile pins gramine (by digest), git, build-essential,
Rust major-minor, and the upstream key-provider source commit. It does
not pin transitive apt deps, the Rust patch version, or the rustup-init
installer script. Each is a drift channel that silently changes the
bytes hashed into the Gramine manifest's trusted_files list, which
changes mr_enclave — breaking any attestation flow that pins to a
specific expected value.
In practice, builds done weeks apart on the same Dockerfile already
diverge today: a rebuild produced 98f735d1… instead of the expected
6b5ed02e… because Ubuntu shipped a libcurl3-gnutls security update
between the two build dates (7.81.0-1ubuntu1.23 → 1ubuntu1.24).
This change parameterizes and pins all three drift channels:
1. APT_SNAPSHOT build-arg routes apt at https://snapshot.ubuntu.com/
so all transitive deps resolve to whatever Ubuntu had on the named
date. Default = 20260423T000000Z. Each consumer overrides to match
their expected mr_enclave:
docker build --build-arg APT_SNAPSHOT=YYYYMMDDT000000Z ...
2. RUST_TOOLCHAIN build-arg with default 1.85.1 (was --default-toolchain
1.85, which resolves to whatever 1.85.x is current at install time).
3. RUSTUP_VERSION + RUSTUP_INIT_SHA256 build-args replace the live
`curl https://sh.rustup.rs | sh` invocation with a pinned download
from static.rust-lang.org's archive, verified against a sha256.
Verified: with APT_SNAPSHOT=20260423T000000Z, the build reproduces the
canonical mr_enclave 6b5ed02e549a1c30aaa8e3171a045f1f449b0017353ef595e78e39c348c98d01
that consumers (e.g. NEAR's MPC TDX nodes) currently expect.1 parent 2e915bb commit 864a988
2 files changed
Lines changed: 47 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
10 | 28 | | |
11 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
12 | 45 | | |
13 | 46 | | |
14 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| |||
0 commit comments