forked from confidential-containers/trustee
-
Notifications
You must be signed in to change notification settings - Fork 1
/
attestation.proto
94 lines (80 loc) · 3.54 KB
/
attestation.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
syntax = "proto3";
package attestation;
message AttestationRequest {
// TEE enum. Specify the evidence type
string tee = 1;
// Base64 encoded evidence. The alphabet is URL_SAFE_NO_PAD.
// defined in https://datatracker.ietf.org/doc/html/rfc4648#section-5
string evidence = 2;
// Runtime Data used to check the binding relationship with report data in
// Evidence
oneof runtime_data {
// Base64 encoded runtime data slice. The whole string will be base64
// decoded. The result one will then be accumulated into a digest which
// is used as the expected runtime data to check against the one inside
// evidence.
//
// The alphabet is URL_SAFE_NO_PAD.
// defined in https://datatracker.ietf.org/doc/html/rfc4648#section-5
string raw_runtime_data = 3;
// Runtime data in a JSON map. CoCoAS will rearrange each layer of the
// data JSON object in dictionary order by key, then serialize and output
// it into a compact string, and perform hash calculation on the whole
// to check against the one inside evidence.
//
// After the verification, the structured runtime data field will be included
// inside the token claims.
string structured_runtime_data = 4;
}
// Init Data used to check the binding relationship with init data in
// Evidence
oneof init_data {
// Base64 encoded init data slice. The whole string will be base64
// decoded. The result one will then be accumulated into a digest which
// is used as the expected init data to check against the one inside
// evidence.
//
// The alphabet is URL_SAFE_NO_PAD.
// defined in https://datatracker.ietf.org/doc/html/rfc4648#section-5
string raw_init_data = 5;
// Init data in a JSON map. CoCoAS will rearrange each layer of the
// data JSON object in dictionary order by key, then serialize and output
// it into a compact string, and perform hash calculation on the whole
// to check against the one inside evidence.
//
// After the verification, the structured init data field will be included
// inside the token claims.
string structured_init_data = 6;
}
// Hash algorithm used to calculate runtime data. Currently can be "sha256",
// "sha384" or "sha512". If not specified, "sha384" will be selected.
string runtime_data_hash_algorithm = 7;
// Hash algorithm used to calculate init data. Currently can be "sha256",
// "sha384" or "sha512". If not specified, "sha384" will be selected.
string init_data_hash_algorithm = 8;
// List of IDs of the policy used to check evidence. If not provided,
// a "default" one will be used.
repeated string policy_ids = 9;
}
message AttestationResponse {
string attestation_token = 1;
}
message SetPolicyRequest {
string policy_id = 1;
string policy = 2;
}
message SetPolicyResponse {}
message ChallengeRequest {
// ChallengeRequest uses HashMap to pass variables like:
// tee, tee_params etc
map<string, string> inner = 1;
}
message ChallengeResponse {
string attestation_challenge = 1;
}
service AttestationService {
rpc AttestationEvaluate(AttestationRequest) returns (AttestationResponse) {};
rpc SetAttestationPolicy(SetPolicyRequest) returns (SetPolicyResponse) {};
rpc GetAttestationChallenge(ChallengeRequest) returns (ChallengeResponse) {};
// Get the GetPolicyRequest.user and GetPolicyRequest.tee specified Policy(.rego)
}