Skip to content

Commit 6de1666

Browse files
committed
docs: Update attestation protocol documentation
Document the attestation protocol between SVSM and the proxy to illustrate the purpose of each step in the process. Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
1 parent 33be873 commit 6de1666

1 file changed

Lines changed: 101 additions & 4 deletions

File tree

Documentation/docs/developer/ATTESTATION.md

Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,111 @@ is fresh and legitimate. The negotiation phase returns the parameters that SVSM
3636
should include in its attestation evidence based on the underlying attestation
3737
server and protocol.
3838

39+
In the negotiation phase, a `NegotiationRequest` is sent from SVSM to the proxy.
40+
An example `NegotiationRequest` is shown below.
41+
```
42+
NegotiationRequest {
43+
version: "0.1.0",
44+
tee: Tee::Snp, // AMD SEV-SNP architecture.
45+
}
46+
```
47+
48+
- `version`: The SVSM attestation protocol version to use. In place to ensure
49+
backwards compatibility with updated protocol versions should modifications
50+
occur.
51+
- `tee`: The TEE hardware architecture that SVSM is running on.
52+
53+
The proxy will then complete the negotiation phase with the remote attestation
54+
server and reply with a list of negotiation parameters that must be included in
55+
the attestation evidence.
56+
57+
A `NegotiationResponse` is sent from the proxy to SVSM.
58+
An example `NegotiationResponse` is shown below.
59+
```
60+
NegotiationResponse {
61+
challenge: [0, 1, 2, 3],
62+
params: [
63+
NegotiationParam::EcPublicKeyBytes,
64+
NegotiationParam::Bytes([4, 5, 6, 7]),
65+
NegotiationParam::Challenge,
66+
],
67+
}
68+
```
69+
- `challenge`: The challenge nonce returned by the remote attestation server
70+
that will likely need to be hashed into the attestation evidence to ensure
71+
freshness.
72+
- `params`: The negotiation parameters. Each `NegotiationParam` represents some
73+
form of data that must be hashed into the attestation evidence. This hash will
74+
be reconstructed by the remote attestation server when the evidence is presented
75+
from SVSM.
76+
77+
SVSM can then collect the attestation evidence (with the negotiation parameters
78+
embedded within the report data) and continue to the attestation phase.
79+
3980
### Attestation Phase
4081

41-
With all relevant data embedded in TEE evidence, SVSM sends its evidence to the
42-
remote server for evaluation. Upon successful attestation, the proxy will obtain
43-
an encrypted secret (only decryptable by SVSM's TEE private key) for SVSM to
44-
use. For example, SVSM could use this secret to unlock encrypted persistent
82+
With all relevant data embedded in the TEE evidence, SVSM sends the evidence to
83+
the remote server for evaluation. Upon successful attestation, the proxy will
84+
obtain an encrypted secret (only decryptable by SVSM's attestation private key)
85+
for SVSM to use. For example, SVSM could use this secret to unlock encrypted
4586
storage.
4687

88+
In the attestation phase, an `AttestationRequest` is sent from SVSM to the proxy.
89+
An example `AttestationRequest` is shown below.
90+
```
91+
AttestationRequest {
92+
evidence: AttestationEvidence::Snp {
93+
report: [0, 1, 2, 3],
94+
certs_buf: None
95+
},
96+
challenge: [4, 5, 6, 7],
97+
key: EcP256PublicKey {
98+
x: [8, 9, 10, 11],
99+
y: [12, 13, 14, 15]
100+
},
101+
}
102+
```
103+
104+
- `evidence`: The attestation evidence (i.e. report) from the TEE processor.
105+
Based on the underlying TEE architecture (SEV-SNP being represented in the
106+
example).
107+
- `challenge`: The original challenge nonce given in the `NegotiationResponse`.
108+
- `key`: The EC public key that will be used to encrypt secret payloads received
109+
from the remote server upon a successful attestation.
110+
111+
The proxy will forward the evidence and metadata to the remote attestation
112+
server for evaluation. Upon successful attestation, the proxy should be able to
113+
retrieve some secret payload from the remote server. The proxy will retrieve
114+
this secret and reply to SVSM with an `AttestationResponse`.
115+
An example `AttestationResponse` is shown below.
116+
```
117+
AttestationResponse {
118+
pub success: true,
119+
pub secret: Some([0, 1, 2, 3]), // `None` if attestation failed.
120+
pub decryption: Some(AesGcmData { // `None` if attestation failed.
121+
epk: EcP256PublicKey {
122+
x: [4, 5, 6, 7],
123+
y: [8, 9, 10, 11]
124+
},
125+
wrapped_cek: [12, 13, 14, 15],
126+
aad: [16, 17, 18, 19],
127+
iv: [20, 21, 22, 23],
128+
tag: [24, 25, 26, 27]
129+
}),
130+
token: None,
131+
}
132+
```
133+
- `success`: Indicates if attestation was ultimately successful.
134+
- `secret`: The encrypted secret payload.
135+
- `decryption`: ECDH-ES-A256KW data needed to perform the handshake and derive
136+
the AES key for the encrypted payload.
137+
- `token`: Token returned from server that contains the claims validated in the
138+
attestation. Could be serialized in JSON or CBOR.
139+
140+
With a successful attestation, SVSM can now use the secret payload for some
141+
purpose (for example, to unlock some persistent state required for booting the
142+
OS) and continue with execution.
143+
47144
## Attestation Host Proxy
48145

49146
As there exists multiple protocols for TEE attestation, the host proxy is built

0 commit comments

Comments
 (0)