-
Notifications
You must be signed in to change notification settings - Fork 9
UID2-4808 Add AKS protocol for AzureCCCoreAttestationService
#374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
27d93d5
25ef824
78aa455
4e0d4c4
faef366
68bc1e7
7352bea
0c3957d
14572f8
3372d69
69a7fc0
623118f
b068084
40c518e
9f806e6
a34056a
b9c1cc7
35851d1
ed3c07d
929dd0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,5 +10,5 @@ public interface IMaaTokenSignatureValidator { | |
| * @return Parsed token payload. | ||
| * @throws AttestationException | ||
| */ | ||
| MaaTokenPayload validate(String tokenString) throws AttestationException; | ||
| MaaTokenPayload validate(String tokenString, String protocol) throws AttestationException; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we introduce an enum for the protocols instead of using a |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,7 @@ private MaaTokenPayload generateBasicPayload() { | |
| .vmDebuggable(false) | ||
| .runtimeData(generateBasicRuntimeData()) | ||
| .ccePolicyDigest(CCE_POLICY_DIGEST) | ||
| .azureProtocol("azure-cc") | ||
|
||
| .build(); | ||
| } | ||
|
|
||
|
|
@@ -125,4 +126,41 @@ public void testValidationFailure_DifferentAttestationUrl() { | |
| assertEquals(AttestationFailure.UNKNOWN_ATTESTATION_URL, ((AttestationClientException)t).getAttestationFailure()); | ||
|
|
||
| } | ||
|
|
||
| @Test | ||
| public void testValidationFailure_AzureCcWithOtherUvm() { | ||
| var validator = new PolicyValidator(ATTESTATION_URL); | ||
| var aksPayload = generateBasicPayload() | ||
| .toBuilder() | ||
| .complianceStatus("fake-compliance") | ||
| .build(); | ||
| Throwable t = assertThrows(AttestationException.class, ()-> validator.validate(aksPayload, PUBLIC_KEY)); | ||
| assertEquals("Not run in Azure Compliance Utility VM", t.getMessage()); | ||
| assertEquals(AttestationFailure.BAD_FORMAT, ((AttestationClientException)t).getAttestationFailure()); | ||
| } | ||
|
|
||
| @Test | ||
| public void testValidationSuccess_AksWithAzureSignedKataccUvm() throws AttestationClientException { | ||
| var validator = new PolicyValidator(ATTESTATION_URL); | ||
| var aksPayload = generateBasicPayload() | ||
| .toBuilder() | ||
| .complianceStatus("azure-signed-katacc-uvm") | ||
| .azureProtocol("azure-cc-aks") | ||
| .build(); | ||
| var enclaveId = validator.validate(aksPayload, PUBLIC_KEY); | ||
| assertEquals(CCE_POLICY_DIGEST, enclaveId); | ||
| } | ||
|
|
||
| @Test | ||
| public void testValidationFailure_AksWithOtherUvm() { | ||
| var validator = new PolicyValidator(ATTESTATION_URL); | ||
| var aksPayload = generateBasicPayload() | ||
| .toBuilder() | ||
| .complianceStatus("fake-compliance") | ||
| .azureProtocol("azure-cc-aks") | ||
mcollins-ttd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| .build(); | ||
| Throwable t = assertThrows(AttestationException.class, ()-> validator.validate(aksPayload, PUBLIC_KEY)); | ||
| assertEquals("Not run in Azure Compliance Utility VM", t.getMessage()); | ||
| assertEquals(AttestationFailure.BAD_FORMAT, ((AttestationClientException)t).getAttestationFailure()); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
cYKatherine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "exp": 1695313895, | ||
| "iat": 1695285095, | ||
| "iss": "https://sharedeus.eus.attest.azure.net", | ||
| "jti": "3b16f2ab4492417aae4cc9a5e6506ca2519659c0d8fdc2bf442fe01aa9b8e46c", | ||
| "nbf": 1695285095, | ||
| "nonce": "7394904505194784658", | ||
| "x-ms-attestation-type": "sevsnpvm", | ||
| "x-ms-compliance-status": "azure-signed-katacc-uvm", | ||
| "x-ms-policy-hash": "9NY0VnTQ-IiBriBplVUpFbczcDaEBUwsiFYAzHu_gco", | ||
| "x-ms-runtime": { | ||
| "location": "East US", | ||
| "publicKey": "abc" | ||
| }, | ||
| "x-ms-sevsnpvm-authorkeydigest": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
| "x-ms-sevsnpvm-bootloader-svn": 3, | ||
| "x-ms-sevsnpvm-familyId": "01000000000000000000000000000000", | ||
| "x-ms-sevsnpvm-guestsvn": 2, | ||
| "x-ms-sevsnpvm-hostdata": "fef932e0103f6132437e8a1223f32efc4bea63342f893b5124645224ef29ba73", | ||
| "x-ms-sevsnpvm-idkeydigest": "ebeeeabce075eeaba3d9ea24d8495137a2877c0d20ac6ea73fc6d2f8aeb50de132150e0a0752664919bcebbf2e8c5807", | ||
| "x-ms-sevsnpvm-imageId": "02000000000000000000000000000000", | ||
| "x-ms-sevsnpvm-is-debuggable": false, | ||
| "x-ms-sevsnpvm-launchmeasurement": "03fea02823189b25d0623a5c81f97c8ba4d2fbc48c914a55ce525f90454ddcec303743dac2fc013f0846912d1412f6df", | ||
| "x-ms-sevsnpvm-microcode-svn": 115, | ||
| "x-ms-sevsnpvm-migration-allowed": false, | ||
| "x-ms-sevsnpvm-reportdata": "4e7d4a413745ddea79f05d20d9ac7add3659ac783ef24684127bbbb3e50fc63c0000000000000000000000000000000000000000000000000000000000000000", | ||
| "x-ms-sevsnpvm-reportid": "d137a83c2d42d81dd42d39ad95ef9023de63216ddaaf2c368a8c41a636ddb2a9", | ||
| "x-ms-sevsnpvm-smt-allowed": true, | ||
| "x-ms-sevsnpvm-snpfw-svn": 8, | ||
| "x-ms-sevsnpvm-tee-svn": 0, | ||
| "x-ms-sevsnpvm-uvm-endorsement": { | ||
| "x-ms-sevsnpvm-guestsvn": "100", | ||
| "x-ms-sevsnpvm-launchmeasurement": "03fea02823189b25d0623a5c81f97c8ba4d2fbc48c914a55ce525f90454ddcec303743dac2fc013f0846912d1412f6df" | ||
| }, | ||
| "x-ms-sevsnpvm-uvm-endorsement-headers": { | ||
| "feed": "ContainerPlat-AMD-UVM", | ||
| "iss": "did:x509:0:sha256:I__iuL25oXEVFdTP_aBLx_eT1RPHbCQ_ECBQfYZpt9s::eku:1.3.6.1.4.1.311.76.59.1.2" | ||
| }, | ||
| "x-ms-sevsnpvm-vmpl": 0, | ||
| "x-ms-ver": "1.0" | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.