Skip to content

Commit

Permalink
Merge pull request #71 from IABTechLab/ysh-support_azure_cc_attestation
Browse files Browse the repository at this point in the history
support azure-cc attestation provider in core
  • Loading branch information
yishi-ttd authored Oct 12, 2023
2 parents 2c54d4f + 26d4a4f commit 50d5966
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<vertx.verticle>com.uid2.core.vertx.CoreVerticle</vertx.verticle>
<launcher.class>io.vertx.core.Launcher</launcher.class>

<uid2-shared.version>5.9.6-62621be878</uid2-shared.version>
<uid2-shared.version>5.13.0-a714a3ef26</uid2-shared.version>
<image.version>${project.version}</image.version>
</properties>

Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/uid2/core/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ public static void main(String[] args) {
EnclaveIdentifierProvider enclaveIdProvider = new EnclaveIdentifierProvider(cloudStorage, enclaveMetadataPath);
enclaveRotatingVerticle = new RotatingStoreVerticle("enclaves", 60000, enclaveIdProvider);


var maaServerBaseUrl = ConfigStore.Global.getOrDefault(com.uid2.core.Const.Config.MaaServerBaseUrlProp, "https://sharedeus.eus.attest.azure.net");
AttestationService attestationService = new AttestationService()
.with("trusted", new TrustedAttestationProvider())
.with("azure-sgx", new AzureAttestationProvider(
ConfigStore.Global.getOrDefault("maa_server_base_url", "https://sharedeus.eus.attest.azure.net"),
WebClient.create(vertx)))
.with("azure-sgx", new AzureAttestationProvider(maaServerBaseUrl, WebClient.create(vertx)))
.with("aws-nitro", new NitroAttestationProvider(new InMemoryAWSCertificateStore()));

// try read GoogleCredentials
Expand All @@ -137,6 +137,8 @@ public static void main(String[] args) {
.with("gcp-vmid", new GcpVmidAttestationProvider(googleCredentials, enclaveParams));
}

attestationService.with("azure-cc", new AzureCCAttestationProvider(maaServerBaseUrl));

attestationService.with("gcp-oidc", new GcpOidcAttestationProvider());

OperatorJWTTokenProvider operatorJWTTokenProvider = new OperatorJWTTokenProvider(config);
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/com.uid2.core/test/enclaves/enclaves.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@
"protocol": "gcp-oidc",
"identifier": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"created": 1620693995
},
{
"name": "debug-azure-cc",
"protocol": "azure-cc",
"identifier": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"created": 1620693995
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
"key_hash": "nF2JfhBwEd1J9W2aiO2XWBnVGWaTHKzmq5WadU9GFC+gHjkFhkT4sG0boNG76fZQpBjQWYcCEhWFNPCBje52iA==",
"key_salt": "WSwyr8znzT0Yj/QiSRGZlsPz2lUIfRuO5FSpl89biiI="
},
{
"key": "test-azure-key",
"name": "[email protected]",
"contact": "[email protected]",
"created": 1617149276,
"protocol": "azure-cc",
"key_hash": "9hmTDqMPlR7Y6mnCDKWFOWGCK8uepsg/s6pCHPCqL16ziQ8OvUSpTlqOERJJkcyvZLRShgNVbafPO66TH91Vkw==",
"key_salt": "VhOxETeT1+hvq8y2YRCpdcPg0JrHkBfZXI58twuohGY="
},
{
"key": "trusted-partner-key",
"name": "[email protected]",
Expand Down

0 comments on commit 50d5966

Please sign in to comment.