-
Notifications
You must be signed in to change notification settings - Fork 9
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
UID2-4808 Add AKS protocol for AzureCCCoreAttestationService
#374
Conversation
71335dc
to
79b38c1
Compare
79b38c1
to
25ef824
Compare
|
||
@Test | ||
public void testHappyPath() throws AttestationException { | ||
var provider = new AzureCCAksCoreAttestationService(alwaysPassTokenValidator, alwaysPassPolicyValidator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is exactly the same as src/test/java/com/uid2/shared/secure/AzureCCCoreAttestationServiceTest.java
, except testing on AzureCCAksCoreAttestationService
@@ -97,6 +97,7 @@ private MaaTokenPayload generateBasicPayload() { | |||
.vmDebuggable(false) | |||
.runtimeData(generateBasicRuntimeData()) | |||
.ccePolicyDigest(CCE_POLICY_DIGEST) | |||
.azureProtocol("azure-cc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default set it to be azure-cc
. Test AKS in the tests below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use MaaTokenPayload.AZURE_CC_ACI_PROTOCOL
here?
|
||
// CC stands for Confidential Container | ||
@Slf4j | ||
public class AzureCCAksCoreAttestationService extends AzureCCCoreAttestationServiceBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need child classes for these? Could they just be one class that takes in the AZURE_CC_PROTOCOL?
AzureCCCoreAttestationService
AzureCCCoreAttestationService
src/test/java/com/uid2/shared/secure/azurecc/MaaTokenSignatureValidatorTest.java
Show resolved
Hide resolved
src/main/java/com/uid2/shared/secure/azurecc/MaaTokenPayload.java
Outdated
Show resolved
Hide resolved
src/test/resources/com.uid2.shared/test/secure/azurecc/jwt_payload_aks.json
Show resolved
Hide resolved
src/main/java/com/uid2/shared/secure/AzureCCCoreAttestationService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/uid2/shared/secure/azurecc/MaaTokenPayload.java
Outdated
Show resolved
Hide resolved
src/test/java/com/uid2/shared/secure/AzureCCCoreAttestationServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/uid2/shared/secure/azurecc/MaaTokenSignatureValidatorTest.java
Outdated
Show resolved
Hide resolved
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we introduce an enum for the protocols instead of using a String
?
src/main/java/com/uid2/shared/secure/AzureCCCoreAttestationService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/uid2/shared/secure/AzureCCCoreAttestationService.java
Outdated
Show resolved
Hide resolved
src/test/java/com/uid2/shared/secure/azurecc/MaaTokenSignatureValidatorTest.java
Outdated
Show resolved
Hide resolved
c0056d8
to
8b3af91
Compare
8b3af91
to
a34056a
Compare
src/test/java/com/uid2/shared/secure/AzureCCCoreAttestationServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/uid2/shared/secure/azurecc/MaaTokenSignatureValidatorTest.java
Outdated
Show resolved
Hide resolved
@@ -97,6 +97,7 @@ private MaaTokenPayload generateBasicPayload() { | |||
.vmDebuggable(false) | |||
.runtimeData(generateBasicRuntimeData()) | |||
.ccePolicyDigest(CCE_POLICY_DIGEST) | |||
.azureProtocol("azure-cc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use MaaTokenPayload.AZURE_CC_ACI_PROTOCOL
here?
src/test/java/com/uid2/shared/secure/azurecc/PolicyValidatorTest.java
Outdated
Show resolved
Hide resolved
ffeb876
to
ed3c07d
Compare
AzureCCCoreAttestationService
#374azure-cc-aks
to allowed protocols uid2-admin#368