TEE attestation allows the TEE node to prove its identity and integrity to external verifiers. It produces a signed attestation response containing the TEE's public key, policy state, and a Google Cloud Confidential Space attestation token.
F_REG / TEE_ATTESTATION (instruction)
The attestation request contains a challenge (arbitrary bytes) that is included in the attestation response to prevent replay attacks. The TEE ID in the request must match the node's actual TEE ID.
- Validate request: TEE ID match, non-empty challenge
- Construct
TeeInfo:- TEE public key
- Challenge from request
- Initial owner address
- Extension ID
- Initial and active signing policy IDs and hashes
- Node state
- Current timestamp
- Hash
TeeInfo - Request Google Cloud attestation token for the hash
- Extract claims from attestation token:
- Code hash: derived from container image digest (
sha256:...) - Platform: derived from hardware model string
- Code hash: derived from container image digest (
- Construct
MachineData:- Extension ID, initial owner
- Code hash, platform
- TEE public key
- Sign
MachineDatahash with TEE private key - Return
TeeInfoResponsecontaining TeeInfo, MachineData, MachineData signature, and attestation token
Returns nil (acknowledgment only).
The TEE communicates with the Google Cloud attestation service via a Unix socket at /run/container_launcher/teeserver.sock. It sends a POST request to /v1/token with:
audience: hex-encoded hash of the TeeInfotoken_type:PKIorOIDCnonces: array containing the hex-encoded audience
The returned JWT token contains claims about the hardware model and container image, which are used to derive the code hash and platform.
Returns "magic_pass" as the attestation token. Code hash and platform are set to test defaults:
- Platform:
Hash("TEST_PLATFORM") - Code hash:
0x194844cf417dde867073e5ab7199fa4d21fd82b5dbe2bdea8b3d7fc18d10fdc2
The JWT token from Google Cloud contains:
{
"hwmodel": "<hardware model string>",
"submods": {
"container": {
"image_digest": "sha256:<hex digest>"
}
}
}hwmodelis hashed to produce the platform identifierimage_digestprefixsha256:is stripped, remainder decoded as the code hash
For attestation to be meaningful, the Docker image must be reproducibly built so that independent parties can verify the code hash. See Deployment for build instructions.