-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yogesh Deshpande <[email protected]>
- Loading branch information
1 parent
6af253a
commit 5f20684
Showing
9 changed files
with
181 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright 2024 Contributors to the Veraison project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package cca | ||
|
||
import ( | ||
"github.com/veraison/ear" | ||
"github.com/veraison/psatoken" | ||
"github.com/veraison/services/handler" | ||
"github.com/veraison/services/log" | ||
"github.com/veraison/services/scheme/common" | ||
"github.com/veraison/services/scheme/common/arm" | ||
) | ||
|
||
type Cca_platform_attester struct { | ||
} | ||
|
||
func (Cca_platform_attester) PerformAppraisal( | ||
appraisal *ear.Appraisal, | ||
evidence map[string]interface{}, | ||
endorsements []handler.Endorsement, | ||
) error { | ||
claims, err := common.MapToClaims(evidence["platform"].(map[string]interface{})) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// once the signature on the token is verified, we can claim the HW is | ||
// authentic | ||
appraisal.TrustVector.Hardware = ear.GenuineHardwareClaim | ||
|
||
rawLifeCycle, err := claims.GetSecurityLifeCycle() | ||
if err != nil { | ||
return handler.BadEvidence(err) | ||
} | ||
|
||
lifeCycle := psatoken.CcaLifeCycleToState(rawLifeCycle) | ||
if lifeCycle == psatoken.CcaStateSecured || | ||
lifeCycle == psatoken.CcaStateNonCcaPlatformDebug { | ||
appraisal.TrustVector.InstanceIdentity = ear.TrustworthyInstanceClaim | ||
appraisal.TrustVector.RuntimeOpaque = ear.ApprovedRuntimeClaim | ||
appraisal.TrustVector.StorageOpaque = ear.HwKeysEncryptedSecretsClaim | ||
} else { | ||
appraisal.TrustVector.InstanceIdentity = ear.UntrustworthyInstanceClaim | ||
appraisal.TrustVector.RuntimeOpaque = ear.VisibleMemoryRuntimeClaim | ||
appraisal.TrustVector.StorageOpaque = ear.UnencryptedSecretsClaim | ||
} | ||
|
||
swComps := arm.FilterRefVal(endorsements, "CCA.sw-component") | ||
match := arm.MatchSoftware(SchemeName, claims, swComps) | ||
if match { | ||
appraisal.TrustVector.Executables = ear.ApprovedRuntimeClaim | ||
log.Debug("matchSoftware Success") | ||
|
||
} else { | ||
appraisal.TrustVector.Executables = ear.UnrecognizedRuntimeClaim | ||
log.Debug("matchSoftware Failed") | ||
} | ||
|
||
platformConfig := arm.FilterRefVal(endorsements, "CCA.platform-config") | ||
match = arm.MatchPlatformConfig(SchemeName, claims, platformConfig) | ||
|
||
if match { | ||
appraisal.TrustVector.Configuration = ear.ApprovedConfigClaim | ||
log.Debug("matchPlatformConfig Success") | ||
|
||
} else { | ||
appraisal.TrustVector.Configuration = ear.UnsafeConfigClaim | ||
log.Debug("matchPlatformConfig Failed") | ||
} | ||
appraisal.UpdateStatusFromTrustVector() | ||
|
||
appraisal.VeraisonAnnotatedEvidence = &evidence | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2024 Contributors to the Veraison project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package cca | ||
|
||
import ( | ||
"github.com/veraison/ear" | ||
"github.com/veraison/services/handler" | ||
) | ||
|
||
type Cca_realm_attester struct { | ||
} | ||
|
||
func (Cca_realm_attester) PerformAppraisal( | ||
appraisal *ear.Appraisal, | ||
ev map[string]interface{}, | ||
endorsements []handler.Endorsement) error { | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2024 Contributors to the Veraison project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package cca | ||
|
||
import ( | ||
"github.com/veraison/ear" | ||
"github.com/veraison/services/handler" | ||
) | ||
|
||
type ISubAttester interface { | ||
PerformAppraisal(*ear.Appraisal, map[string]interface{}, []handler.Endorsement) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[ | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"BL\",\"CCA.measurement-value\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"3.4.2\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M1\",\"CCA.measurement-value\":\"CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.0\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M2\",\"CCA.measurement-value\":\"DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.3\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M3\",\"CCA.measurement-value\":\"EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.0.0\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.platform-config\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.platform-config-label\": \"platform-config-label\",\"CCA.platform-config-id\": \"AQID\"}}" | ||
"{\"scheme\":\"CCA\", \"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"BL\",\"CCA.measurement-value\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"3.4.2\"}}", | ||
"{\"scheme\":\"CCA\",\"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M1\",\"CCA.measurement-value\":\"CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.0\"}}", | ||
"{\"scheme\":\"CCA\",\"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M2\",\"CCA.measurement-value\":\"DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.3\"}}", | ||
"{\"scheme\":\"CCA\",\"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M3\",\"CCA.measurement-value\":\"EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.0.0\"}}", | ||
"{\"scheme\":\"CCA\",\"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.platform-config\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.platform-config-label\": \"platform-config-label\",\"CCA.platform-config-id\": \"AQID\"}}" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[ | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"BL\",\"CCA.measurement-value\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"3.4.2\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M1\",\"CCA.measurement-value\":\"CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.0\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M2\",\"CCA.measurement-value\":\"DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.3\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M3\",\"CCA.measurement-value\":\"EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.0.0\"}}", | ||
"{\"scheme\":\"CCA\",\"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.platform-config\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.platform-config-label\": \"platform-config-label\",\"CCA.platform-config-id\": \"ACID\"}}" | ||
"{\"scheme\":\"CCA\", \"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"BL\",\"CCA.measurement-value\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"3.4.2\"}}", | ||
"{\"scheme\":\"CCA\", \"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M1\",\"CCA.measurement-value\":\"CwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.0\"}}", | ||
"{\"scheme\":\"CCA\", \"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M2\",\"CCA.measurement-value\":\"DwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.2.3\"}}", | ||
"{\"scheme\":\"CCA\", \"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.sw-component\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.measurement-desc\":\"sha-256\",\"CCA.measurement-type\":\"M3\",\"CCA.measurement-value\":\"EwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.signer-id\":\"BwYFBAMCAQAPDg0MCwoJCBcWFRQTEhEQHx4dHBsaGRg=\",\"CCA.version\":\"1.0.0\"}}", | ||
"{\"scheme\":\"CCA\", \"subscheme\": \"CCA_SSD_PLATFORM\", \"type\":\"REFERENCE_VALUE\",\"subType\": \"CCA.platform-config\",\"attributes\":{\"CCA.hw-model\":\"RoadRunner\",\"CCA.hw-vendor\":\"ACME\",\"CCA.impl-id\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"CCA.platform-config-label\": \"platform-config-label\",\"CCA.platform-config-id\": \"ACID\"}}" | ||
] |
Oops, something went wrong.