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

Use PSA Attestation Token as the format for initial attestation reports #131

Merged
merged 5 commits into from
Dec 20, 2023

Conversation

athoelke
Copy link
Contributor

@athoelke athoelke commented Dec 11, 2023

Update the API to use the PSA attestation token, defined in https://datatracker.ietf.org/doc/draft-tschofenig-rats-psa-token.

The token and report format, CDDL definition, and example token are no longer required in this specification - these are all provided by the PSA Attestation Token specification.

Fixes #7

@athoelke athoelke added enhancement New feature or request Attestation API Issue or PR related to the Attestation API labels Dec 11, 2023
@athoelke
Copy link
Contributor Author

I would welcome feedback from @thomas-fossati @mathias-arm @SimonFrost-Arm @adrianlshaw @hannestschofenig

@athoelke athoelke added this to the Attestation API 2.0.0 milestone Dec 11, 2023
@thomas-fossati
Copy link
Contributor

thomas-fossati commented Dec 13, 2023

I would welcome feedback from @thomas-fossati @mathias-arm @SimonFrost-Arm @adrianlshaw @hannestschofenig

@athoelke, thanks for the heads up!

  • Is a reference to the external token/report format sufficient?

Yes, I think so. Especially when the draft becomes an RFC (which should be "soon"), the referenced document will have very strong guarantees in terms of stability. RFCs are not live documents and cannot move one bit (except for Errata) once they are given a number in the series.

  • Are there specific claim-construction guidelines that should be included in this document, where not provided in the PSA Token specification itself (PSM is too vague to be of any value)?

From the point of view of the API user, the only claim they can control is eat_nonce. Apart from §4.1.1 and §5.1.2, the recommendations for eat_nonce are the same as §4.1 of EAT. In particular, "An EAT nonce MUST have at least 64 bits of entropy.".
Note that the draft makes no recommendations about using nonce in chained constructions (as mentioned in the PSM). This may be an area worth elaborating on in the API doc.

  • How much direction should we provide to the legacy format (in the v1.0 specification)?

Backwards compatibility is described in §4.6. The gist is:

  • attesters should move to the new profile
  • verifiers will take care of absorbing legacy
  • Is it worth describing the differences between the legacy and new formats? - or is §4.6 Backwards Compatibility Considerations in the PSA Token spec adequate?

A pointer to that section should be enough.

Copy link

@SimonFrost-Arm SimonFrost-Arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Thomas' replies to the general queries. I've made a couple of responses to the inline Issues.

doc/attestation/overview/report.rst Outdated Show resolved Hide resolved
doc/attestation/overview/report.rst Outdated Show resolved Hide resolved
@athoelke
Copy link
Contributor Author

  • Are there specific claim-construction guidelines that should be included in this document, where not provided in the PSA Token specification itself (PSM is too vague to be of any value)?

From the point of view of the API user, the only claim they can control is eat_nonce. Apart from §4.1.1 and §5.1.2, the recommendations for eat_nonce are the same as §4.1 of EAT. In particular, "An EAT nonce MUST have at least 64 bits of entropy.". Note that the draft makes no recommendations about using nonce in chained constructions (as mentioned in the PSM). This may be an area worth elaborating on in the API doc.

Note that the API specification is important for implementers as well as users of the API.

The v1.0 spec stated that the Instance ID claim must be constructed as H(IAK) for asymmetric IAK, and H(H(IAK)) for symmetric IAK (using a justification that is not immediately obvious from the citation). This is information is not repeated in the PSA Attestation Token spec, which only describes the H(IAK) construction, and PSM has nothing of value to add.

My question regarding claim construction guidance, is partly triggered by this specific description of the Instance ID claim. Is the additional info in v1.0 (choose one):

  • Still correct: to be documented in PSA Attestation Token spec?
  • Still correct: to be documented in PSA Attestation API (this spec)?
  • No longer valid: drop from this spec?
  • Not important: does not justify providing different/additional information about the attestation token content/format in this spec?

@thomas-fossati
Copy link
Contributor

  • Are there specific claim-construction guidelines that should be included in this document, where not provided in the PSA Token specification itself (PSM is too vague to be of any value)?

From the point of view of the API user, the only claim they can control is eat_nonce. Apart from §4.1.1 and §5.1.2, the recommendations for eat_nonce are the same as §4.1 of EAT. In particular, "An EAT nonce MUST have at least 64 bits of entropy.". Note that the draft makes no recommendations about using nonce in chained constructions (as mentioned in the PSM). This may be an area worth elaborating on in the API doc.

Note that the API specification is important for implementers as well as users of the API.

Ah, thanks for the clarification. I thought this was only for the user side.

My question regarding claim construction guidance, is partly triggered by this specific description of the Instance ID claim. Is the additional info in v1.0 (choose one):

  • Still correct: to be documented in PSA Attestation Token spec?
  • Still correct: to be documented in PSA Attestation API (this spec)?
  • No longer valid: drop from this spec?
  • Not important: does not justify providing different/additional information about the attestation token content/format in this spec?

The double-hash construction of the ImplID for symmetric keys is still valid and should be documented here.

@athoelke
Copy link
Contributor Author

The double-hash construction of the ImplID for symmetric keys is still valid and should be documented here.

Thank you. The follow-up to this specific query, is the generalised question that I originally posed (but with insufficient context to make clear):

  • Are there [other] specific claim-construction guidelines that should be included in this document, where not provided in the PSA Token specification itself? - perhaps only relevant to the use of the token within this API?

@thomas-fossati
Copy link
Contributor

thomas-fossati commented Dec 14, 2023

The double-hash construction of the ImplID for symmetric keys is still valid and should be documented here.

Thank you. The follow-up to this specific query, is the generalised question that I originally posed (but with insufficient context to make clear):

  • Are there [other] specific claim-construction guidelines that should be included in this document, where not provided in the PSA Token specification itself? - perhaps only relevant to the use of the token within this API?

It seems that a major concern for API users is how to securely use the challenge/nonce in the IAT to create chained attestation schemes. To help those who need to build the "Attestation End-Point (AEP)", it would be helpful to convert Section 7.3 of the PSM into actionable information.

@thomas-fossati
Copy link
Contributor

One thing that I forgot to mention previously is that users may be interested in checking the security & privacy considerations of the PSA token document. In particular: making sure they trust the challenger, and knowing what potentially privacy-sensitive info they are exposing by using the IAT.

@athoelke
Copy link
Contributor Author

One thing that I forgot to mention previously is that users may be interested in checking the security & privacy considerations of the PSA token document. In particular: making sure they trust the challenger, and knowing what potentially privacy-sensitive info they are exposing by using the IAT.

I think that this information could be part of the SRA? (see #132)

@athoelke
Copy link
Contributor Author

athoelke commented Dec 15, 2023

It seems that a major concern for API users is how to securely use the challenge/nonce in the IAT to create chained attestation schemes. To help those who need to build the "Attestation End-Point (AEP)", it would be helpful to convert Section 7.3 of the PSM into actionable information.

The use cases section currently describes more of the high level ideas around attestation. Not sure if it would be better if this is more aligned with the discussion of the context in the PSA Attestation Token spec (or just defer to that description?)?

I can see that providing more guidance on how the initial attestation API can be used as part of an attestation protocol, including chained schemes, could be beneficial here.

I've tried capture the need to review that material in #133.

@athoelke
Copy link
Contributor Author

The double-hash construction of the ImplID for symmetric keys is still valid and should be documented here.

Can anyone shed light on exactly what the second+third sentence actually means in:

When using a symmetric key for the IAK, it is recommended that the Instance ID is a double hash of the key - InstanceID = H(H(IAK)). This eliminates risks when exposing the key to different HMAC block size. For further information, read RFC 2104.

RFC 2104 is the definition of HMAC. But this construction of Instance ID is not using HMAC.

@thomas-fossati
Copy link
Contributor

Can anyone shed light on exactly what the second+third sentence actually means in:

When using a symmetric key for the IAK, it is recommended that the Instance ID is a double hash of the key - InstanceID = H(H(IAK)). This eliminates risks when exposing the key to different HMAC block size. For further information, read RFC 2104.

RFC 2104 is the definition of HMAC. But this construction of Instance ID is not using HMAC.

The thinking behind the double hashing was captured here.

Copy link
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

athoelke and others added 4 commits December 20, 2023 00:10
The report is now formatted as specified in the IETF draft PSA Attestation Token
Provide rationale for differential construction for symmetric IAK
Co-authored-by: Thomas Fossati <[email protected]>
Signed-off-by: Andrew Thoelke <[email protected]>
@athoelke
Copy link
Contributor Author

Oops. Broken rebase was force-pushed... but recovered now.

@athoelke athoelke marked this pull request as ready for review December 20, 2023 00:16
@athoelke athoelke merged commit 7261bd0 into ARM-software:main Dec 20, 2023
@athoelke athoelke deleted the attestation-2.0 branch December 20, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attestation API Issue or PR related to the Attestation API enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Use the PSA attestation token format in the Attestation API
4 participants