-
Notifications
You must be signed in to change notification settings - Fork 13
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
WIP: Added vts and provisioning plugins for AWS Nitro enclave attestation … #58
Open
dreemkiller
wants to merge
7
commits into
veraison:main
Choose a base branch
from
dreemkiller:add_aws_nitro
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
206f974
Added vts and provisioning plugins for AWS Nitro enclave attestation …
dreemkiller e61cd60
Code cleanup and improved test coverage for the AWS Nitro plugins
dreemkiller e42b319
Added more test cases for the VTS Nitro plugin
dreemkiller 08e530e
Removed some possibly unneeded code from the AWS Nitro plugins
dreemkiller f1b8839
Added document generation to the AWS Nitro tests
dreemkiller d3ddbf1
Removed some no-longer-needed test files
dreemkiller aab1f15
Renamed some fields. Added check for null SoftwareId
dreemkiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -18,5 +18,8 @@ enum AttestationFormat { | |
|
||
// TPM EnactTrust | ||
TPM_ENACTTRUST = 3; | ||
|
||
// AWS Nitro Enclaves | ||
AWS_NITRO = 4; | ||
} | ||
|
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,15 @@ | ||
# Copyright 2022 Contributors to the Veraison project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
PLUGIN := ../bin/veraison-provisining-decoder-corim-nitro | ||
GOPKG := github.com/veraison/services/provisioning/plugins/corim-nitro-decoder | ||
SRCS := $(wildcard *.go) | ||
|
||
all-hook-pre all-test-pre all-lint-pre: | ||
$(MAKE) -C ../../../proto protogen | ||
$(MAKE) -C ../../decoder protogen | ||
|
||
include ../../../mk/common.mk | ||
include ../../../mk/plugin.mk | ||
include ../../../mk/lint.mk | ||
include ../../../mk/test.mk |
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,36 @@ | ||
# Endorsement Store Interface | ||
|
||
## Reference Value | ||
|
||
```json | ||
{ | ||
"scheme": "AWS_NITRO", | ||
"type": "REFERENCE_VALUE", | ||
"attributes": { | ||
"nitro.hw-model": "RoadRunner", | ||
"nitro.hw-vendor": "ACME", | ||
"nitro.impl-id": "IllXTnRaUzFwYlhCc1pXMWxiblJoZEdsdmJpMXBaQzB3TURBd01EQXdNREU9Ig==", | ||
"nitro.measurement-desc": 1, | ||
"nitro.measurement-type": "BL", | ||
"nitro.measurement-value": "h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=", | ||
"nitro.signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=", | ||
"nitro.version": "2.1.0" | ||
} | ||
} | ||
``` | ||
|
||
## Trust Anchor | ||
|
||
```json | ||
{ | ||
"scheme": "AWS_NITRO", | ||
"type": "VERIFICATION_KEY", | ||
"attributes": { | ||
"nitro.hw-model": "RoadRunner", | ||
"nitro.hw-vendor": "ACME", | ||
"nitro.cert": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6Vwqe7hy3O8Ypa+BUETLUjBNU3rEXVUyt9XHR7HJWLG7XTKQd9i1kVRXeBPDLFnfYru1/euxRnJM7H9UoFDLdA==", | ||
"nitro.impl-id": "IllXTnRaUzFwYlhCc1pXMWxiblJoZEdsdmJpMXBaQzB3TURBd01EQXdNREU9Ig==", | ||
"nitro.inst-id": "AUyj5PUL8kjDl4cCDWj/0FyIdndRvyZFypI/V6mL7NKW" | ||
} | ||
} | ||
``` |
40 changes: 40 additions & 0 deletions
40
provisioning/plugins/corim-nitro-decoder/classattributes.go
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,40 @@ | ||
// Copyright 2022 Contributors to the Veraison project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/veraison/corim/comid" | ||
) | ||
|
||
type NitroClassAttributes struct { | ||
//ImplID []byte | ||
Vendor string | ||
Model string | ||
} | ||
|
||
// extract mandatory ImplID and optional vendor & model | ||
func (o *NitroClassAttributes) FromEnvironment(e comid.Environment) error { | ||
class := e.Class | ||
|
||
if class == nil { | ||
return fmt.Errorf("expecting class in environment") | ||
} | ||
|
||
classID := class.ClassID | ||
|
||
if classID == nil { | ||
return fmt.Errorf("expecting class-id in class") | ||
} | ||
|
||
if class.Vendor != nil { | ||
o.Vendor = *class.Vendor | ||
} | ||
|
||
if class.Model != nil { | ||
o.Model = *class.Model | ||
} | ||
|
||
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,38 @@ | ||
// Copyright 2022 Contributors to the Veraison project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package main | ||
|
||
import ( | ||
"github.com/veraison/services/provisioning/decoder" | ||
plugin_common "github.com/veraison/services/provisioning/plugins/common" | ||
) | ||
|
||
const ( | ||
SupportedMediaType = "application/corim-unsigned+cbor; profile=http://aws.com/nitro" | ||
PluginName = "unsigned-corim (AWS Nitro profile)" | ||
) | ||
|
||
type Decoder struct{} | ||
|
||
func (o Decoder) Init(params decoder.Params) error { | ||
return nil // no-op | ||
} | ||
|
||
func (o Decoder) Close() error { | ||
return nil // no-op | ||
} | ||
|
||
func (o Decoder) GetName() string { | ||
return PluginName | ||
} | ||
|
||
func (o Decoder) GetSupportedMediaTypes() []string { | ||
return []string{ | ||
SupportedMediaType, | ||
} | ||
} | ||
|
||
func (o Decoder) Decode(data []byte) (*decoder.EndorsementDecoderResponse, error) { | ||
result,err := plugin_common.UnsignedCorimDecoder(data, Extractor{}) | ||
return result, err | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is this information available in the attestation document?
here you need something that can uniquely correlate the incoming evidence (i.e., the attestation document) with the expected reference values. would
module_id
work for this purpose?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.
Having thought a bit more about precise enclave identification, it seems like PCR0 would do the job?
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.
if so, we'd need a new instance-id type in comid since we don't currently have a place for a sha-384 string.
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.
PCRs 0-2 are a function of the input image (not the platform). They certainly could be included as part of a COSWID, but I'm not sure of the use-case.
Putting PCR8 in a COSWID would effectively tie the attestation to a specific AWS Customer, which may be valuable.
PCR3 ties you to a specific IAM role. Perhaps interesting.
PCR4 ties you to a specific AWS EC2 instance, which I have no idea why you would want to do this.
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.
sure, but what we need is a unique identifier for the workload itself. The assurance that it's run on genuine Nitro is derived from the cryptographic verification, isn't it?