You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for the getPolicy, setPolicy, and resetPolicy APIs (Azure#15432)
* Added getPolicy and AttestationAdministrationClient APIs; code cleanup to use correct shared attestation provider; other fixes
* Documentation cleanup - added in documentation in more places
* Addressed API review feedback; started adding in attestation token validation logic
* Prepared for release
Copy file name to clipboardExpand all lines: sdk/attestation/attestation/CHANGELOG.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,15 @@
1
1
# Release History
2
2
3
-
## 1.0.0-beta.3 (Unreleased)
3
+
## 1.0.0-beta.3 (2021-06-08)
4
4
5
5
### Features Added
6
6
7
7
### Breaking Changes
8
8
9
9
- Essentially completely rewritten. All existing functionality has been replaced.
10
+
- Removed `policy` property on `AttestationClient` object, because it has been replaced.
11
+
- Removed `policy.reset` and `policy.set`, replaced with the `resetPolicy` and `setPolicy` methods on the `AttestationAdministrationClient`.
12
+
- Removed `policy.get`, replaced with the `getPolicy` method of the new `AttestationAdministrationClient` client object.
10
13
- Removed `attestation.attestSgxEnclave`, `attestation.attestOpenEnclave`, `attestation.attestTpm`, and `attestation` property from attestationClient, replaced with `attestSgxEnclave`, `attestOpenEnclave` and `attestTpm`.
11
14
- Removed `metadataConfiguration` and `signingCertificates` properties from attestationClient.
12
15
- Removed `metadataConfiguration.get()` method, replaced with `client.getOpenIdMetadata()`.
// The text policy document is available in the `policyResult.value`
187
+
// property.
188
+
189
+
// The actual attestation token returned by the MAA service is available
190
+
// in `policyResult.token`.
185
191
```
186
192
187
193
### Set an attestation policy for a specified attestation type
188
194
189
195
If the attestation service instance is running in Isolated mode, the set_policy API needs to provide a signing certificate (and private key) which can be used to validate that the caller is authorized to modify policy on the attestation instance. If the service instance is running in AAD mode, then the signing certificate and key are optional.
190
196
191
-
Under the covers, the SetPolicy APIs create a [JSON Web Token][json_web_token] based on the policy document and signing information which is sent to the attestation service.
197
+
Under the covers, the setPolicy APIs create a [JSON Web Token][json_web_token] based on the policy document and signing information which is sent to the attestation service.
192
198
193
199
```js
194
200
<FILLTHISIN>
195
201
```
196
202
197
-
If the service instance is running in AAD mode, the call to set_policy can be
203
+
If the service instance is running in AAD mode, the call to setPolicy can be
198
204
simplified:
199
205
200
206
```js
@@ -205,13 +211,26 @@ Clients need to be able to verify that the attestation policy document was not m
205
211
206
212
There are two properties provided in the [PolicyResult][attestation_policy_result] that can be used to verify that the service received the policy document:
207
213
208
-
-[`policy_signer`][attestation_policy_result_parameters] - if the `set_policy` call included a signing certificate, this will be the certificate provided at the time of the `set_policy` call. If no policy signer was set, this will be null.
209
-
-[`policy_token_hash`][attestation_policy_result_parameters] - this is the hash of the [JSON Web Token][json_web_token] sent to the service.
214
+
-[`policy_signer`][attestation_policy_result_parameters] - if the `setPolicy` call included a signing certificate, this will be the certificate provided at the time of the `setPolicy` call. If no policy signer was set, this will be null.
215
+
-[`policy_token_hash`][attestation_policy_result_parameters] - this is the hash of the [JSON Web Signature][json_web_token] sent to the service for the setPolicy API.
210
216
211
217
To verify the hash, clients can generate an attestation token and verify the hash generated from that token:
// The hash returned in expectedHash will match the value in
233
+
// `setResult.value.policy_token_hash.
215
234
```
216
235
217
236
### Attest SGX Enclave
@@ -232,12 +251,20 @@ The client can then send that Attestation Token (which contains the serialized k
232
251
233
252
This example shows one common pattern of calling into the attestation service to retrieve an attestation token associated with a request.
234
253
235
-
This example assumes that you have an existing `AttestationClient` object which is configured with the base URI for your endpoint. It also assumes that you have an SGX Quote (`quote`) generated from within the SGX enclave you are attesting, and "Runtime Data" (`runtime_data`) which is referenced in the SGX Quote.
254
+
This example assumes that you have an existing `AttestationClient` object which is configured with the base URI for your endpoint. It also assumes that you have an SGX Quote (`quote`) generated from within the SGX enclave you are attesting, and "Runtime Data" (`binaryRuntimeData`) which is referenced in the SGX Quote.
If the `isJson` parameter to the `AttestationData` constructor is not provided,
265
+
the code will attempt to determine if binaryRuntimeData is JSON or not by attempting
266
+
to parse the data.
267
+
241
268
Additional information on how to perform attestation token validation can be found in the [MAA Service Attestation Sample](https://github.com/Azure-Samples/microsoft-azure-attestation).
0 commit comments