-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
206f974
e61cd60
e42b319
08e530e
f1b8839
d3ddbf1
aab1f15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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; | ||
} | ||
|
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 |
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": { | ||
"psa.hw-model": "RoadRunner", | ||
"psa.hw-vendor": "ACME", | ||
"psa.impl-id": "IllXTnRaUzFwYlhCc1pXMWxiblJoZEdsdmJpMXBaQzB3TURBd01EQXdNREU9Ig==", | ||
"psa.measurement-desc": 1, | ||
"psa.measurement-type": "BL", | ||
"psa.measurement-value": "h0KPxSKAPTEGXnvOPPA/5HUJZjHl4Hu9eg/eYMTPJcc=", | ||
"psa.signer-id": "rLsRx+TaIXIFUjzkzhokWuGiOa48a/2eeHH35di66Gs=", | ||
"psa.version": "2.1.0" | ||
} | ||
} | ||
``` | ||
|
||
## Trust Anchor | ||
|
||
```json | ||
{ | ||
"scheme": "AWS_NITRO", | ||
"type": "VERIFICATION_KEY", | ||
"attributes": { | ||
"psa.hw-model": "RoadRunner", | ||
"psa.hw-vendor": "ACME", | ||
"psa.iak-pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6Vwqe7hy3O8Ypa+BUETLUjBNU3rEXVUyt9XHR7HJWLG7XTKQd9i1kVRXeBPDLFnfYru1/euxRnJM7H9UoFDLdA==", | ||
"psa.impl-id": "IllXTnRaUzFwYlhCc1pXMWxiblJoZEdsdmJpMXBaQzB3TURBd01EQXdNREU9Ig==", | ||
"psa.inst-id": "AUyj5PUL8kjDl4cCDWj/0FyIdndRvyZFypI/V6mL7NKW" | ||
} | ||
} | ||
``` | ||
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. there is no need to for an explicit trust-anchor endorsement, I think. The |
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 | ||
Comment on lines
+13
to
+14
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. is this information available in the attestation document? 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. 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 commentThe 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 commentThe 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. 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 commentThe 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? |
||
} | ||
|
||
// 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 | ||
} |
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 | ||
} |
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 isn't what you want. (looks like a leftover?)
what you really want is to define a way to use CoMID to transport the expected PCR values and some kind of enclave identifier.
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.
Definitely a leftover.
I am currently not transporting any expected PCR values. That's not how Veracruz attestation works (they are embedded in the generated certificate and the client authenticates them). I've thought a bit how it might be done for other systems, but yes, we need to figure out how to do that for more general use-cases.
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.
👍 definitely an important item for discussion.
To support both use cases we need to create a non-ambiguous signal that the verifier plugin can use to distinguish between "don't bother checking PCRs for this workload" and "no matching PCRs for this workload"