Skip to content
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

RVPS limitations #238

Open
thomas-fossati opened this issue Nov 23, 2023 · 6 comments
Open

RVPS limitations #238

thomas-fossati opened this issue Nov 23, 2023 · 6 comments

Comments

@thomas-fossati
Copy link
Contributor

Today I started reviewing the RVPS implementation and have a few observations that I wanted to share.

Semantic squashing

Whilst I get the ethos behind the choice of a uniform format for the ref-value type, I also think the assumption that ref-values are simple, stand-alone (id, hash) pairs hurts the usability of the service.

As a concrete example, Arm CCA workloads have ref-values with the following shape:

{
  "initial-measurement": "48b2245b81dc07b9de288872ee8b68d3cde1a0d1a4ac47540d03a5ae3bcaaf4f",
  "extensible-measurements": [
    "2459b963cbba21426c35d2d14696e1276937a43904c20f879ea843219cfa91fe",
    "de9dd6746a35d665e0ba9c4764c05fb732d6da82982fd1cb6e037884044c484d",
    "a8b7369d7e326138a2ef3f830196d43d43c3db922a5fc94da8aaeb93559e1a80",
    "6ae61d7f4603304adf786dca761990c70599848e27bc2b548f10abb23189e736"
  ],
  "personalization-value": "00fa9623e7d40d168e652e0f8b9d651112697adec1e7b227c738c22137611f0f58b5d5de4a6e624076b083395df9a41b7993abb4a9026f1174b56183e5a94650"
}

where:

  • initial-measurement measures the boot bits
  • extensible-measurements is for the run-time
  • personalisation-value contains user data supplied at launch

I wouldn't know how to fit that compound structure into the current RVPS data model unless I either make drastically simplifying (and lossy) assumptions on what information I decide to cut off (with the consequent deterioration of the quality/fidelity of the verification process), or I cram the whole JSON above into the hash value ;-).
Both outcomes are highly undesirable.

An alternative approach is to maintain the simple key-value interface for the verifier, skip normalizing in the RVPS, and let the scheme-specific code in the verifier interpret the fetched ref-values.

Sharding of the store

From an initial (and admittedly superficial) code inspection, it is unclear if/how the sharding of the potentially multi-tenant and multi-scheme store is being addressed.
The keys are not explicitly namespaced and it looks like the extractors will just use what they've been supplied. Assuming that the keys will be globally unique is obviously unsafe.

Besides, I was unable to find any authn/authz associated with the supply-chain actor or at least a placeholder for that. What is the assumed threat model? One fundamental attribute of the ref-value provider is its trustworthiness, which needs to be somehow demonstrated to the verifier before the latter can act on its inputs.

Known bad values

It'd be nice to be able to provide negative ref-values alongside positive ones (i.e., deny- vs allow-lists). In general, this improves the quality of attestation results (e.g., see AR4SI).

@Xynnn007
Copy link
Member

Xynnn007 commented Nov 24, 2023

Hi @thomas-fossati Thanks for the issue.

Whilst I get the ethos behind the choice of a uniform format for the ref-value type, I also think the assumption that ref-values are simple, stand-alone (id, hash) pairs hurts the usability of the service.

I wouldn't know how to fit that compound structure into the current RVPS data model unless I either make drastically simplifying (and lossy) assumptions on what information I decide to cut off (with the consequent deterioration of the quality/fidelity of the verification process), or I cram the whole JSON above into the hash value ;-).
Both outcomes are highly undesirable.

Same problems exist in other architecture like TDX. Currently we will flatten the evidence claim. See https://github.com/confidential-containers/kbs/blob/main/attestation-service/attestation-service/src/utils.rs#L84-L141 for an example of unit test. In this way we can use simple key-value pairs in RVPS. This is surely not the best solution, but currently it can help to reduce the complexity of the compound structure.

From an initial (and admittedly superficial) code inspection, it is unclear if/how the sharding of the potentially multi-tenant and multi-scheme store is being addressed. The keys are not explicitly namespaced and it looks like the extractors will just use what they've been supplied. Assuming that the keys will be globally unique is obviously unsafe.

This may be reasonable. Currently RVPS is used in conjunction with AS, and we are still completing the overall functionality of the remote attestation architecture. RVPS multi-tenancy would be a later consideration and TBO I did not think much about the design of multi-tenant. In addition, in some existing scenarios, we will run a separate CoCo-AS+RVPS service for each tenant in a single-tenant model. Although this may not be the best method, it can temporarily solve some problems.

Besides, I was unable to find any authn/authz associated with the supply-chain actor or at least a placeholder for that. What is the assumed threat model? One fundamental attribute of the ref-value provider is its trustworthiness, which needs to be somehow demonstrated to the verifier before the latter can act on its inputs.

Yes. Currently this part is still in baby state. There is a component named PreProcessor https://github.com/confidential-containers/kbs/blob/main/attestation-service/rvps/src/pre_processor/mod.rs that will help to do some extra checks before extract the reference values inside, like check the signature against configured pub keys. Though they are not implemented now, but I think it can somehow deal with the problems you've mentioned.

It'd be nice to be able to provide negative ref-values alongside positive ones (i.e., deny- vs allow-lists). In general, this improves the quality of attestation results (e.g., see AR4SI).

This is a interesting idea. Current AS will query RVPS only for allow list. We will think more about this.

@thomas-fossati
Copy link
Contributor Author

thomas-fossati commented Nov 24, 2023

Hi @Xynnn007

Same problems exist in other architecture like TDX. Currently we will flatten the evidence claim. See https://github.com/confidential-containers/kbs/blob/main/attestation-service/attestation-service/src/utils.rs#L84-L141 for an example of unit test. In this way we can use simple key-value pairs in RVPS. This is surely not the best solution, but currently it can help to reduce the complexity of the compound structure.

I am not sure I fully understand. What I think I am hearing is that for TDX you are actually using:

An alternative approach is to maintain the simple key-value interface for the verifier, skip normalizing in the RVPS, and let the scheme-specific code in the verifier interpret the fetched ref-values.

If this is how the store is meant to be used - i.e., the value in the key-value pair is just an opaque string (it doesn’t matter if it’s some JSON, flattened or raw, or a base64-encoded “anything”, as long as the consuming verifier knows what to expect and how to interpret it), then I suggest to rename the hash_value to something that makes the intention clear.

From an initial (and admittedly superficial) code inspection, it is unclear if/how the sharding of the potentially multi-tenant and multi-scheme store is being addressed. The keys are not explicitly namespaced and it looks like the extractors will just use what they've been supplied. Assuming that the keys will be globally unique is obviously unsafe.

This may be reasonable. Currently RVPS is used in conjunction with AS, and we are still completing the overall functionality of the remote attestation architecture. RVPS multi-tenancy would be a later consideration and TBO I did not think much about the design of multi-tenant. In addition, in some existing scenarios, we will run a separate CoCo-AS+RVPS service for each tenant in a single-tenant model. Although this may not be the best method, it can temporarily solve some problems.

Sure, allocating one RVP+Verifier to a specific tenant is one way to work around this. But there’s another dimension to multi-tenancy, i.e., the fact that even a single tenant will, in general, consume multiple evidence formats. And I am not sure (please correct me if I’m wrong) that the lookup key is currently namespaced based on the attestation scheme, i.e., that the store is clearly partitioned.

Besides, I was unable to find any authn/authz associated with the supply-chain actor or at least a placeholder for that. What is the assumed threat model? One fundamental attribute of the ref-value provider is its trustworthiness, which needs to be somehow demonstrated to the verifier before the latter can act on its inputs.

Yes. Currently this part is still in baby state. There is a component named PreProcessor https://github.com/confidential-containers/kbs/blob/main/attestation-service/rvps/src/pre_processor/mod.rs that will help to do some extra checks before extract the reference values inside, like check the signature against configured pub keys. Though they are not implemented now, but I think it can somehow deal with the problems you've mentioned.

The pre-processor looks like a pretty sensible place to put the AAA function. However, my point was that once the supply chain actor is authenticated, the authorisation info (role, ACL, …) needs to be propagated through the processing pipeline down into the store layer, and there are no placeholders for that, currently.

It'd be nice to be able to provide negative ref-values alongside positive ones (i.e., deny- vs allow-lists). In general, this improves the quality of attestation results (e.g., see AR4SI).

This is a interesting idea. Current AS will query RVPS only for allow list. We will think more about this.

Cool! And thank you!

@thomas-fossati
Copy link
Contributor Author

thomas-fossati commented Nov 24, 2023

Same problems exist in other architecture like TDX. Currently we will flatten the evidence claim. See https://github.com/confidential-containers/kbs/blob/main/attestation-service/attestation-service/src/utils.rs#L84-L141 for an example of unit test. In this way we can use simple key-value pairs in RVPS. This is surely not the best solution, but currently it can help to reduce the complexity of the compound structure.

OK, I think I understand what you meant.

However, I don't see how this really solves the problem of bundling a bunch of separate measurements into a single, compound reference value.

For example, suppose I have only two possible acceptable states for my CCA realm:

  • acceptable state 1:
{
  "initial-measurement": "a1",
  "extensible-measurements": [
    "b101", "b102", "b103", "b104"
  ],
  "personalization-value": "c1"
}
  • acceptable state 2:
{
  "initial-measurement": "a2",
  "extensible-measurements": [
    "b201", "b202", "b203", "b204"
  ],
  "personalization-value": "c2"
}

If I use the same "flattening" strategy as in the TDX example you linked above, the reference values I'd end up supplying to the RVPS would be:

{
  "cca.initial-measurement": [ "a1", "a2" ],
  "cca.extensible-measurements.0": [ "b101", "b201" ],
  "cca.extensible-measurements.1": [ "b102", "b202" ],
  "cca.extensible-measurements.2": [ "b103", "b203" ],
  "cca.extensible-measurements.3": [ "b104", "b204" ],
  "cca.personalization-value": [ "c1", "c2" ]
}

correct?

Now suppose that some mix-and-match evidence like the following comes in:

{
  "initial-measurement": "a1",
  "extensible-measurements": [
    "b201", "b102", "b203", "b104"
  ],
  "personalization-value": "c2"
}

It would be a match because all the reference values, taken independently, are known and good. But, in this combination, they do not describe an acceptable state for the attester.

@Xynnn007
Copy link
Member

@thomas-fossati Currently we can edit any rego policy inside OPA of attestation service, which will help the user to handle such combination reference values by manually configure that. However it is not elegant enough and requires the policy composer have more knowledge.

Could you provide a more concrete scenario that a compound reference value makes sense while the individual ingredients does not?

Maybe we should take this into consideration? This requires some logic changes of the interface between CoCo-AS and RVPS. cc @jialez0

@thomas-fossati
Copy link
Contributor Author

thomas-fossati commented Nov 27, 2023

@thomas-fossati Currently we can edit any rego policy inside OPA of attestation service, which will help the user to handle such combination reference values by manually configure that. However it is not elegant enough and requires the policy composer have more knowledge.

Yes; as you say, mixing reference value with appraisal policy is not ideal. Primarily because it blurs the distinction between the verifier owner and the reference value providers which, in general, are separate roles operated by separate entities. Therefore, only a minimal amount of coordination among them should be required - ideally, no coupling at all.

Could you provide a more concrete scenario that a compound reference value makes sense while the individual ingredients does not?

Individual ingredients always make sense :-) But for "expected state" recipes that require more than a single ingredient, you want to be able to specify the recipe too.

So, except for the simplest of attesters that are identified by a singleton measurement, a compound reference value seems to be always needed. And once you have that, the singleton becomes just a special case of such (more powerful) primitive.

Maybe we should take this into consideration? This requires some logic changes of the interface between CoCo-AS and RVPS. cc @jialez0

I don't know (yet) the interface between CoCo-AS and RVPS, but I appreciate that rethinking this will have non-trivial downstream consequences. However, for longer-term sustainability, it's better to get the building blocks right even though this might be somewhat painful :-)

@chendave
Copy link
Member

/cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants