Skip to content
Open
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
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Run a standalone check against any configured provider:
teep verify venice --model e2ee-qwen3-5-122b-a10b
```

Teep checks up to 50 factors across hardware, encryption, and supply chain, then prints which pass, fail, or skip. Factors that skip are typically optional policy checks not configured for your setup. Factors that fail are known current limitations — see [attestation gaps](docs/attestation_gaps/) for details.
Teep checks up to 53 factors across hardware, encryption, and supply chain, then prints which pass, fail, or skip. Factors that skip are typically optional policy checks not configured for your setup. Factors that fail are known current limitations — see [attestation gaps](docs/attestation_gaps/) for details.

Exits with code 1 if any enforced factor fails. For the full factor list, see [Verification Factors](#verification-factors).

Expand Down Expand Up @@ -193,7 +193,7 @@ Is the encryption bound to the hardware? These checks verify the encryption key
Is the software what it claims to be? These checks verify container provenance, deployment manifests, TLS binding, and runtime integrity.

<details>
<summary>10 factors</summary>
<summary>13 factors</summary>

| # | Factor | Description |
|---|--------|-------------|
Expand All @@ -207,6 +207,9 @@ Is the software what it claims to be? These checks verify container provenance,
| 34 | `sigstore_verification` | Container image digests found in Sigstore transparency log, proving verifiable CI/CD provenance |
| 35 | `sigstore_code_verified` | Sigstore DSSE bundle code measurements match live enclave (Tinfoil-specific) |
| 36 | `event_log_integrity` | Event log replayed against TDX RTMRs — proves log is authentic and complete |
| 37 | `compose_manager_quote` | NEAR: the compose-manager quote is genuine, from the same TD as the instance quote, and its REPORTDATA binds sha256(action log) and the client nonce |
| 38 | `compose_manager_tcb` | NEAR: the compose-manager quote TCB is UpToDate per Intel PCS |
| 39 | `compose_manager_actions` | NEAR: every compose file the action log stages or brings up, and every compose-manager image it starts, is in `compose_manager_compose_allow` / `compose_manager_image_allow` |

</details>

Expand All @@ -225,21 +228,21 @@ serving inference exposes none, and the core tee_* factors state that. See

| # | Factor | Description |
|---|--------|-------------|
| 37 | `gateway_nonce_match` | Gateway request nonce matches the client nonce; a gateway-variant ACI/1 response echoes no nonce, so it fails, and freshness rests on `gateway_tee_reportdata_binding` |
| 38 | `gateway_tee_quote_present` | Gateway quote or report is present |
| 39 | `gateway_tee_quote_structure` | Gateway quote parses as valid QuoteV4 or SEV-SNP report |
| 40 | `gateway_tee_cert_chain` | Gateway cert chain verifies against Intel or AMD root CA |
| 41 | `gateway_tee_quote_signature` | Gateway quote signature valid |
| 42 | `gateway_tee_debug_disabled` | Gateway debug bit is 0 (production enclave) |
| 43 | `gateway_tee_measurement` | Gateway measurements match the gateway policy allowlists |
| 44 | `gateway_tee_hardware_config` | Gateway RTMR[0] matches hardware config allowlist |
| 45 | `gateway_tee_boot_config` | Gateway RTMR[1] and RTMR[2] match boot config allowlists; not applicable to an SEV-SNP gateway, whose launch measurement (`gateway_tee_measurement`) covers the boot |
| 46 | `gateway_tee_reportdata_binding` | Gateway REPORTDATA binding verified |
| 47 | `gateway_compose_binding` | Gateway sha256(app_compose) matches TDX MRConfigID |
| 48 | `gateway_cpu_id_registry` | Gateway CPU PPID verified in Proof of Cloud registry |
| 49 | `gateway_event_log_integrity` | Gateway event log replayed; all 4 RTMRs match quote |
| 50 | `gateway_tee_tcb_current` | Gateway TCB SVN meets minimum threshold (SEV-SNP) |
| 51 | `gateway_tee_tcb_not_revoked` | Gateway TCB SVN is not revoked (SEV-SNP) |
| 40 | `gateway_nonce_match` | Gateway request nonce matches the client nonce; a gateway-variant ACI/1 response echoes no nonce, so it fails, and freshness rests on `gateway_tee_reportdata_binding` |
| 41 | `gateway_tee_quote_present` | Gateway quote or report is present |
| 42 | `gateway_tee_quote_structure` | Gateway quote parses as valid QuoteV4 or SEV-SNP report |
| 43 | `gateway_tee_cert_chain` | Gateway cert chain verifies against Intel or AMD root CA |
| 44 | `gateway_tee_quote_signature` | Gateway quote signature valid |
| 45 | `gateway_tee_debug_disabled` | Gateway debug bit is 0 (production enclave) |
| 46 | `gateway_tee_measurement` | Gateway measurements match the gateway policy allowlists |
| 47 | `gateway_tee_hardware_config` | Gateway RTMR[0] matches hardware config allowlist |
| 48 | `gateway_tee_boot_config` | Gateway RTMR[1] and RTMR[2] match boot config allowlists; not applicable to an SEV-SNP gateway, whose launch measurement (`gateway_tee_measurement`) covers the boot |
| 49 | `gateway_tee_reportdata_binding` | Gateway REPORTDATA binding verified |
| 50 | `gateway_compose_binding` | Gateway sha256(app_compose) matches TDX MRConfigID |
| 51 | `gateway_cpu_id_registry` | Gateway CPU PPID verified in Proof of Cloud registry |
| 52 | `gateway_event_log_integrity` | Gateway event log replayed; all 4 RTMRs match quote |
| 53 | `gateway_tee_tcb_current` | Gateway TCB SVN meets minimum threshold (SEV-SNP) |
| 54 | `gateway_tee_tcb_not_revoked` | Gateway TCB SVN is not revoked (SEV-SNP) |

</details>

Expand Down
33 changes: 18 additions & 15 deletions README_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ Each factor produces PASS, FAIL, or SKIP. Factors marked `[ENFORCED]` cause the
| 33 | `sigstore_verification` | Checks whether compose-listed image digests occur in the transparency log, with policy exceptions. Presence alone does not verify a publisher signature. teep's NEAR policy allows this factor to fail for the two DeepSeek models; the exception also covers other models and gateway images. See [affected models and prior GLM evidence](docs/attestation_gaps/near_image_provenance.md#scope-and-evidence). The default policy for Venice dstack models allows the same failure, for the same launcher image. |
| 34 | `sigstore_code_verified` | Tinfoil-specific: Sigstore DSSE bundle code measurements match live enclave's SEV-SNP MEASUREMENT or TDX RTMRs. Skipped for non-Tinfoil providers. |
| 35 | `event_log_integrity` | TDX event log replayed: `RTMR_new = SHA384(RTMR_old ‖ digest)` starting from 48 zero bytes. All 4 replayed RTMRs match quote. Proves the log is authentic and complete. |
| 36 | `compose_manager_quote` | NEAR-specific. The model CVM compose runs compose-manager, which starts the inference proxy and model server after boot, so they are in neither RTMR3 nor MRConfigID. `compose_manager_attestation` is a second TDX quote from compose-manager: its chain, signature and debug bit are checked, MRTD, MRSEAM, MRCONFIGID, MROWNER, MROWNERCONFIG and RTMR0-3 must equal the instance quote, and REPORTDATA must be `sha256(canonical action log) ‖ client nonce`. |
| 37 | `compose_manager_tcb` | NEAR-specific. Intel PCS collateral of the compose-manager quote; TCB must be UpToDate. |
| 38 | `compose_manager_actions` | NEAR-specific. Every `file_sha256` of a `compose_up` or `compose_stage` in the bound action log must be in `compose_manager_compose_allow`, and every `compose_manager_started` image in `compose_manager_image_allow`. Unknown actions and empty allowlists fail. The log is compose-manager's own record, so it is as good as the allowed compose-manager images. |

### Tier 4: Gateway Attestation

Expand All @@ -208,21 +211,21 @@ exposes none, and the core `tee_*` factors state that.

| # | Factor | Description |
|---|--------|-------------|
| 36 | `gateway_nonce_match` | Gateway nonce matches the client nonce. Prevents replay attacks against the gateway. |
| 37 | `gateway_tee_quote_present` | Gateway quote or report is present in the attestation response. |
| 38 | `gateway_tee_quote_structure` | Gateway quote parses as valid QuoteV4 or SEV-SNP report. |
| 39 | `gateway_tee_cert_chain` | Gateway certificate chain verifies against the Intel or AMD root CA. |
| 40 | `gateway_tee_quote_signature` | Signature over the gateway quote body is valid. |
| 41 | `gateway_tee_debug_disabled` | Gateway debug bit is 0 (production enclave). |
| 42 | `gateway_tee_measurement` | Gateway measurements match the gateway policy allowlists. Allowed to fail by default for NEAR Cloud and for the ACI/1 routes of Venice, Phala Cloud and NanoGPT: the allowlist changes only with a teep release, so a gateway release fails this factor, and teep reports the failure. |
| 43 | `gateway_tee_hardware_config` | Gateway RTMR[0] matches the hardware config allowlist. |
| 44 | `gateway_tee_boot_config` | Gateway RTMR[1] and RTMR[2] match the boot config allowlists. Not applicable to an SEV-SNP gateway, whose launch measurement (`gateway_tee_measurement`) covers the boot. |
| 45 | `gateway_tee_reportdata_binding` | Gateway REPORTDATA binding verified: nearcloud binds `sha256(signing_address ‖ tls_fingerprint)`; Venice ACI/1 binds `keccak256(signing key)` + nonce; Tinfoil binds the HPKE key and endorsed section hashes. |
| 46 | `gateway_compose_binding` | Gateway `sha256(app_compose)` matches TDX MRConfigID, with the `app_compose` rules of `compose_binding`. Enforced for Venice ACI/1 — the gateway publishes its manifest with digest-pinned images. |
| 47 | `gateway_cpu_id_registry` | Gateway CPU PPID verified against the Proof of Cloud registry. |
| 48 | `gateway_event_log_integrity` | Gateway event log replayed; all 4 RTMRs match the gateway TDX quote. |
| 49 | `gateway_tee_tcb_current` | Gateway TCB SVN meets minimum threshold (SEV-SNP; TDX defers to Intel PCS collateral). |
| 50 | `gateway_tee_tcb_not_revoked` | Gateway TCB SVN is not revoked (SEV-SNP; TDX defers to Intel PCS collateral). |
| 39 | `gateway_nonce_match` | Gateway nonce matches the client nonce. Prevents replay attacks against the gateway. |
| 40 | `gateway_tee_quote_present` | Gateway quote or report is present in the attestation response. |
| 41 | `gateway_tee_quote_structure` | Gateway quote parses as valid QuoteV4 or SEV-SNP report. |
| 42 | `gateway_tee_cert_chain` | Gateway certificate chain verifies against the Intel or AMD root CA. |
| 43 | `gateway_tee_quote_signature` | Signature over the gateway quote body is valid. |
| 44 | `gateway_tee_debug_disabled` | Gateway debug bit is 0 (production enclave). |
| 45 | `gateway_tee_measurement` | Gateway measurements match the gateway policy allowlists. Allowed to fail by default for NEAR Cloud and for the ACI/1 routes of Venice, Phala Cloud and NanoGPT: the allowlist changes only with a teep release, so a gateway release fails this factor, and teep reports the failure. |
| 46 | `gateway_tee_hardware_config` | Gateway RTMR[0] matches the hardware config allowlist. |
| 47 | `gateway_tee_boot_config` | Gateway RTMR[1] and RTMR[2] match the boot config allowlists. Not applicable to an SEV-SNP gateway, whose launch measurement (`gateway_tee_measurement`) covers the boot. |
| 48 | `gateway_tee_reportdata_binding` | Gateway REPORTDATA binding verified: nearcloud binds `sha256(signing_address ‖ tls_fingerprint)`; Venice ACI/1 binds `keccak256(signing key)` + nonce; Tinfoil binds the HPKE key and endorsed section hashes. |
| 49 | `gateway_compose_binding` | Gateway `sha256(app_compose)` matches TDX MRConfigID, with the `app_compose` rules of `compose_binding`. Enforced for Venice ACI/1 — the gateway publishes its manifest with digest-pinned images. |
| 50 | `gateway_cpu_id_registry` | Gateway CPU PPID verified against the Proof of Cloud registry. |
| 51 | `gateway_event_log_integrity` | Gateway event log replayed; all 4 RTMRs match the gateway TDX quote. |
| 52 | `gateway_tee_tcb_current` | Gateway TCB SVN meets minimum threshold (SEV-SNP; TDX defers to Intel PCS collateral). |
| 53 | `gateway_tee_tcb_not_revoked` | Gateway TCB SVN is not revoked (SEV-SNP; TDX defers to Intel PCS collateral). |

## TOML Configuration

Expand Down
35 changes: 35 additions & 0 deletions cmd/teep/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,41 @@ var factorRegistry = []factorInfo{
"complete — no entries were added, removed, or modified. Skipped " +
"when no event log entries are present in the attestation response.",
},
{
Name: attestation.FactorCMQuote,
Tier: 3,
Summary: "compose-manager quote binds its action log",
Description: "NEAR-specific. The model CVM compose runs compose-manager, " +
"which starts the inference proxy and the model server after boot, " +
"so neither is in RTMR3 or MRConfigID. compose_manager_attestation " +
"is a second TDX quote from compose-manager. This factor verifies " +
"its Intel certificate chain and signature and the debug bit, " +
"requires MRTD, MRSEAM, MRCONFIGID, MROWNER, MROWNERCONFIG and " +
"RTMR0-3 to equal the instance quote, and requires REPORTDATA to be " +
"sha256(canonical action log) followed by the client nonce. Not " +
"applicable to other providers.",
},
{
Name: attestation.FactorCMTCB,
Tier: 3,
Summary: "compose-manager quote TCB is UpToDate",
Description: "NEAR-specific. Fetches Intel PCS collateral for the " +
"compose-manager quote and requires TCB status UpToDate.",
},
{
Name: attestation.FactorCMActions,
Tier: 3,
Summary: "compose-manager deployments are allowed",
Description: "NEAR-specific. Reads the action log that " +
"compose_manager_quote binds. Every compose file that the log " +
"stages or brings up (compose_stage, compose_up) must have its " +
"file_sha256 in compose_manager_compose_allow, and every " +
"compose-manager image it records starting " +
"(compose_manager_started) must be in compose_manager_image_allow. " +
"An action other than these, compose_down, docker_restart, " +
"docker_clean and docker_evict fails, and an empty allowlist fails. The log is compose-manager's " +
"own record: it is as good as the compose-manager images allowed.",
},
// Tier 4: Gateway Attestation (nearcloud only)
{
Name: attestation.FactorGWNonceMatch,
Expand Down
13 changes: 13 additions & 0 deletions docs/measurement_allowlists.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ values the gateway may run (32 bytes of hex, not 48). When it is set,
`gateway_compose_binding` fails unless the compose binds to MRConfigID and its
hash is in the list. When it is absent, the compose is not pinned.

`compose_manager_compose_allow` and `compose_manager_image_allow` pin what a
NEAR model CVM's compose-manager deploys after boot (`compose_manager_actions`,
see [NEAR attestation](providers/near/near_attestation.md#compose-manager-attestation)).
The first lists the sha256 of compose files (32 bytes of hex); the second lists
compose-manager images as `repo@sha256:<64 lowercase hex>`. Neither has a
default, and the factor fails while either is empty.

```toml
[providers.nearcloud.policy]
compose_manager_compose_allow = ["0faf0a037c662094be342a5c128fc531bc0145c869e27dc55bab7b1192d605e6"]
compose_manager_image_allow = ["nearaidev/compose-manager@sha256:ae4332fdb0bfccf6410bc153a58d0b72a596a989cbb98fd5b6461fe32e079814"]
```

### Merge order

Each allowlist field is resolved independently using:
Expand Down
44 changes: 42 additions & 2 deletions docs/providers/near/near_attestation.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ remains required.

The gateway has its own signing-address scheme and TLS identity. Its evidence
is validated separately, not compared with a repeated model report. Auxiliary
OHTTP and compose-manager objects have their own typed schemas; their presence
does not authorize inference or replace the model and gateway checks.
OHTTP objects have their own typed schemas; their presence does not authorize
inference or replace the model and gateway checks. The compose-manager object
is verified by its own factors, described next.

Exact-name and null-field handling use the shared
[strict object decoder](../../../internal/jsonstrict/object.go). It re-encodes
Expand All @@ -123,6 +124,45 @@ files, `TestNearSignedModelKeySubstitution`, and the provider signed-evidence
fixture suites. Transport requirements remain in the
[shared transport reference](../../transport/README.md).

## Compose-manager attestation

The compose that the model CVM's MRConfigID binds runs compose-manager, its
launcher, certbot and an OpenTelemetry collector. compose-manager then starts
the inference proxy (which holds the model key and decrypts E2EE) and the
model server from files of `nearai/cvm-compose-files`, after boot, so neither
is in RTMR3 or MRConfigID. Their only record is the
`compose_manager_attestation` member of each model entry: compose-manager's
action log and a second TDX quote from the same TD, whose REPORTDATA is
`sha256(canonical actions) ‖ client nonce` (`canonicalize_actions` and
`attestation_binding` in nearai/compose-manager `src/main.rs`).

- `compose_manager_quote` verifies that quote (Intel chain, signature, debug
off), requires MRTD, MRSEAM, MRCONFIGID, MROWNER, MROWNERCONFIG and RTMR0-3
to equal the instance quote, and recomputes REPORTDATA from the served
action list (JSON, keys sorted, no whitespace) and teep's nonce. RTMR3
carries the instance-id event, so the quote of another instance of the
same model fails.
- `compose_manager_tcb` checks its Intel PCS collateral; TCB must be UpToDate.
- `compose_manager_actions` reads the bound log. Every `file_sha256` of a
`compose_up` or `compose_stage` must be in `compose_manager_compose_allow`
and every `compose_manager_started` image in `compose_manager_image_allow`.
`compose_down`, `docker_restart`, `docker_clean` and `docker_evict` start
nothing; any other action fails, and so does an empty allowlist.

All three are enforced and have no default allowlist: an operator pins the
values that the failure detail lists. The check covers every deployment the
log reports, not only the one running, because anything compose-manager
started in the TD had its Docker socket access. Limits:

- The log is compose-manager's own claim. It is as good as the allowed
compose-manager images, which have `docker.sock`, `dstack.sock` and
`pid: host`.
- compose-manager prunes entries older than seven days unless they anchor a
deployed record, so a log does not show everything the TD ever ran.
- teep does not fetch the allowed compose files or check the images they pin.
- The launcher's `latest` channel can replace compose-manager with another
signed image; the log records it, and the image allowlist must accept it.

## Supply chain: image index and platform manifest

The lookup mismatch was reported on 2026-11-11 for NEAR's
Expand Down
5 changes: 5 additions & 0 deletions internal/attestation/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ type RawAttestation struct {
GatewaySigningAddress string `json:"-"`
GatewayTLSFingerprint string `json:"-"`

// ComposeManagerAttestation is the compose_manager_attestation member
// of a NEAR model entry as served, empty when absent. VerifyComposeManager
// decodes and verifies it.
ComposeManagerAttestation []byte `json:"-"`

// UnknownFields lists unexpected JSON keys found in the attestation
// response. Populated by provider parse functions via jsonstrict.UnmarshalWarn.
UnknownFields []string `json:"-"`
Expand Down
Loading