RATS                                                       H. Tschofenig
Internet-Draft                                                  S. Frost
Intended status: Informational                               M. Brossard
Expires: 25 September 2021                                       A. Shaw
                                                              T. Fossati
                                                             Arm Limited
                                                           24 March 2021


      Arm's Platform Security Architecture (PSA) Attestation Token
                   draft-tschofenig-rats-psa-token-08

Abstract

   The Platform Security Architecture (PSA) is a family of hardware and
   firmware security specifications, as well as open-source reference
   implementations, to help device makers and chip manufacturers build
   best-practice security into products.  Devices that are PSA compliant
   are able to produce attestation tokens as described in this memo,
   which are the basis for a number of different protocols, including
   secure provisioning and network access control.  This document
   specifies the PSA attestation token structure and semantics.

   The PSA attestation token is a profiled Entity Attestation Token
   (EAT).

   This specification describes what claims are used in an attestation
   token generated by PSA compliant systems, how these claims get
   serialized to the wire, and how they are cryptographically protected.

Note to Readers

   Source for this draft and an issue tracker can be found at
   https://github.com/thomas-fossati/draft-psa-token
   (https://github.com/thomas-fossati/draft-psa-token).

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.






Tschofenig, et al.      Expires 25 September 2021               [Page 1]


Internet-Draft            PSA Attestation Token               March 2021


   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on 25 September 2021.

Copyright Notice

   Copyright (c) 2021 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Simplified BSD License text
   as described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions and Definitions . . . . . . . . . . . . . . . . .   3
     2.1.  Glossary  . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  PSA Claims  . . . . . . . . . . . . . . . . . . . . . . . . .   4
     3.1.  Caller Claims . . . . . . . . . . . . . . . . . . . . . .   4
       3.1.1.  Nonce . . . . . . . . . . . . . . . . . . . . . . . .   4
       3.1.2.  Client ID . . . . . . . . . . . . . . . . . . . . . .   5
     3.2.  Target Identification Claims  . . . . . . . . . . . . . .   5
       3.2.1.  Instance ID . . . . . . . . . . . . . . . . . . . . .   5
       3.2.2.  Implementation ID . . . . . . . . . . . . . . . . . .   6
       3.2.3.  Certification Reference . . . . . . . . . . . . . . .   6
     3.3.  Target State Claims . . . . . . . . . . . . . . . . . . .   6
       3.3.1.  Security Lifecycle  . . . . . . . . . . . . . . . . .   7
       3.3.2.  Boot Seed . . . . . . . . . . . . . . . . . . . . . .   8
     3.4.  Software Inventory Claims . . . . . . . . . . . . . . . .   8
       3.4.1.  Software Components . . . . . . . . . . . . . . . . .   8
       3.4.2.  No Software Measurements  . . . . . . . . . . . . . .  10
     3.5.  Verification Claims . . . . . . . . . . . . . . . . . . .  11
       3.5.1.  Verification Service Indicator  . . . . . . . . . . .  11
       3.5.2.  Profile Definition  . . . . . . . . . . . . . . . . .  11
   4.  Backwards Compatibility Considerations  . . . . . . . . . . .  12
   5.  Token Encoding and Signing  . . . . . . . . . . . . . . . . .  12
   6.  Freshness Model . . . . . . . . . . . . . . . . . . . . . . .  12
   7.  Collated CDDL . . . . . . . . . . . . . . . . . . . . . . . .  13
   8.  Security and Privacy Considerations . . . . . . . . . . . . .  15



Tschofenig, et al.      Expires 25 September 2021               [Page 2]


Internet-Draft            PSA Attestation Token               March 2021


   9.  Verification  . . . . . . . . . . . . . . . . . . . . . . . .  16
   10. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  16
     10.1.  Media Type Registration  . . . . . . . . . . . . . . . .  16
     10.2.  CoAP Content-Formats Registration  . . . . . . . . . . .  17
       10.2.1.  Registry Contents  . . . . . . . . . . . . . . . . .  17
   11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  18
     11.1.  Normative References . . . . . . . . . . . . . . . . . .  18
     11.2.  Informative References . . . . . . . . . . . . . . . . .  19
   Appendix A.  Reference Implementation . . . . . . . . . . . . . .  20
   Appendix B.  Example  . . . . . . . . . . . . . . . . . . . . . .  20
   Contributors  . . . . . . . . . . . . . . . . . . . . . . . . . .  21
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  22
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  22

1.  Introduction

   Trusted execution environments are now present in many devices, which
   provide a safe environment to place security sensitive code such as
   cryptography, secure boot, secure storage, and other essential
   security functions.  These security functions are typically exposed
   through a narrow and well-defined interface, and can be used by
   operating system libraries and applications.  Various APIs have been
   developed by Arm as part of the Platform Security Architecture [PSA]
   framework.  This document focuses on the output provided by PSA's
   Initial Attestation API.  Since the tokens are also consumed by
   services outside the device, there is an actual need to ensure
   interoperability.  Interoperability needs are addressed here by
   describing the exact syntax and semantics of the attestation claims,
   and defining the way these claims are encoded and cryptographically
   protected.

   Further details on concepts expressed below can be found in the PSA
   Security Model documentation [PSA-SM].

2.  Conventions and Definitions

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

2.1.  Glossary

   RoT  Root of Trust, the minimal set of software, hardware and data
      that has to be implicitly trusted in the platform - there is no
      software or hardware at a deeper level that can verify that the
      Root of Trust is authentic and unmodified.  An example of RoT is



Tschofenig, et al.      Expires 25 September 2021               [Page 3]


Internet-Draft            PSA Attestation Token               March 2021


      an initial bootloader in ROM, which contains cryptographic
      functions and credentials, running on a specific hardware
      platform.

   SPE  Secure Processing Environment, a platform's processing
      environment for software that provides confidentiality and
      integrity for its runtime state, from software and hardware,
      outside of the SPE.  Contains trusted code and trusted hardware.
      (Equivalent to Trusted Execution Environment (TEE), or "secure
      world".)

   NSPE  Non Secure Processing Environment, the security domain outside
      of the SPE, the Application domain, typically containing the
      application firmware, operating systems, and general hardware.
      (Equivalent to Rich Execution Environment (REE), or "normal
      world".)

3.  PSA Claims

   This section describes the claims to be used in a PSA attestation
   token.

   CDDL [RFC8610] along with text descriptions is used to define each
   claim independent of encoding.  The following CDDL type(s) are reused
   by different claims:

   psa-hash-type = bytes .size 32 / bytes .size 48 / bytes .size 64

3.1.  Caller Claims

3.1.1.  Nonce

   The Nonce claim is used to carry the challenge provided by the caller
   to demonstrate freshness of the generated token.

   The EAT [I-D.ietf-rats-eat] "nonce" (claim key 10) is used.  The
   following constraints apply to the "nonce-type":

   *  The length MUST be either 32, 48, or 64 bytes.

   *  Only a single nonce value is conveyed.  Per [I-D.ietf-rats-eat]
      the array notation is not used for encoding the nonce value.

   This claim MUST be present in a PSA attestation token.

   psa-nonce = (
       10 => psa-hash-type
   )



Tschofenig, et al.      Expires 25 September 2021               [Page 4]


Internet-Draft            PSA Attestation Token               March 2021


3.1.2.  Client ID

   The Client ID claim represents the security domain of the caller.

   In PSA, a security domain is represented by a signed integer whereby
   negative values represent callers from the NSPE and where positive
   IDs represent callers from the SPE.  The value 0 is not permitted.

   For an example definition of client IDs, see the PSA Firmware
   Framework [PSA-FF].

   It is essential that this claim is checked in the verification
   process to ensure that a security domain, i.e., an attestation
   endpoint, cannot spoof a report from another security domain.

   This claim MUST be present in a PSA attestation token.

   Note that the CDDL label used to be called arm_psa_partition_id.

   psa-client-id-nspe-type = -2147483648...0
   psa-client-id-spe-type = 1..2147483647

   psa-client-id-type = psa-client-id-nspe-type / psa-client-id-spe-type

   psa-client-id = (
       psa-client-id-key => psa-client-id-type
   )

3.2.  Target Identification Claims

3.2.1.  Instance ID

   The Instance ID claim represents the unique identifier of the Initial
   Attestation Key (IAK).  The full definition is in [PSA-SM].

   The EAT "ueid" (claim key 11) of type RAND is used.  The following
   constraints apply to the "ueid-type":

   *  The length MUST be 33 bytes.

   *  The first byte MUST be 0x01 (RAND) followed by the 32-bytes key
      hash.

   This claim MUST be present in a PSA attestation token.







Tschofenig, et al.      Expires 25 September 2021               [Page 5]


Internet-Draft            PSA Attestation Token               March 2021


   psa-instance-id-type = bytes .size 33

   psa-instance-id = (
       11 => psa-instance-id-type
   )

3.2.2.  Implementation ID

   The Implementation ID claim uniquely identifies the underlying
   immutable PSA RoT.  A verification service can use this claim to
   locate the details of the verification process.  Such details include
   the implementation's origin and associated certification state.  The
   full definition is in [PSA-SM].

   This claim MUST be present in a PSA attestation token.

   psa-implementation-id-type = bytes .size 32

   psa-implementation-id = (
       psa-implementation-id-key => psa-implementation-id-type
   )

3.2.3.  Certification Reference

   The Certification Reference claim is used to link the class of chip
   and PSA RoT of the attesting device to an associated entry in the PSA
   Certification database.  It MUST be represented as a thirteen-digit
   [EAN-13].

   Linking to the PSA Certification entry can still be achieved if this
   claim is not present in the token by making an association at a
   Verifier between the reference value and other token claim values -
   for example, the Implementation ID.

   psa-certification-reference-type = text .regexp "[0-9]{13}"

   psa-certification-reference = (
       ? psa-certification-reference-key =>
           psa-certification-reference-type
   )

3.3.  Target State Claims









Tschofenig, et al.      Expires 25 September 2021               [Page 6]


Internet-Draft            PSA Attestation Token               March 2021


3.3.1.  Security Lifecycle

   The Security Lifecycle claim represents the current lifecycle state
   of the PSA RoT.  The state is represented by an integer that is
   divided to convey a major state and a minor state.  A major state is
   mandatory and defined by [PSA-SM].  A minor state is optional and
   'IMPLEMENTATION DEFINED'.  The PSA security lifecycle state and
   implementation state are encoded as follows:

   *  version[15:8] - PSA security lifecycle state, and

   *  version[7:0] - IMPLEMENTATION DEFINED state.

   The PSA lifecycle states are illustrated in Figure 1.  For PSA, a
   remote verifier can only trust reports from the PSA RoT when it is in
   SECURED or NON_PSA_ROT_DEBUG major states.

   This claim MUST be present in a PSA attestation token.

                           .----------------------.
            .--- Enrol ---+ Provisioning Lockdown |
           |              '-----------+----------'
           |                          |   .------------------.
           |                          |  |                    |
           *                          v  v                    |
    .--------------.             .---------.                  |
   |    Verifier    |  .---------+ Secured +-----------.      |
    '--------------'   |         '-+-------'            |     |
           *           |           |     ^              |     |
           |           |           v     |              v     |
       Blacklist       |    .------------+------.  .----------+----.
           |           |    | Non-PSA RoT Debug |  | Recoverable   |
           |           |    '---------+---------'  | PSA RoT Debug |
         .-+-----------+-.            |            '------+--------'
        |    Terminate   +------------+-------------------'
        '------+--------'
               |              .----------------.
                '------------>| Decommissioned |
                              '----------------'

                       Figure 1: PSA Lifecycle States










Tschofenig, et al.      Expires 25 September 2021               [Page 7]


Internet-Draft            PSA Attestation Token               March 2021


   psa-lifecycle-unknown-type = 0x0000..0x00ff
   psa-lifecycle-assembly-and-test-type = 0x1000..0x10ff
   psa-lifecycle-psa-rot-provisioning-type = 0x2000..0x20ff
   psa-lifecycle-secured-type = 0x3000..0x30ff
   psa-lifecycle-non-psa-rot-debug-type = 0x4000..0x40ff
   psa-lifecycle-recoverable-psa-rot-debug-type = 0x5000..0x50ff
   psa-lifecycle-decommissioned-type = 0x6000..0x60ff

   psa-lifecycle-type =
       psa-lifecycle-unknown-type /
       psa-lifecycle-assembly-and-test-type /
       psa-lifecycle-psa-rot-provisioning-type /
       psa-lifecycle-secured-type /
       psa-lifecycle-non-psa-rot-debug-type /
       psa-lifecycle-recoverable-psa-rot-debug-type /
       psa-lifecycle-decommissioned-type

   psa-lifecycle = (
       psa-lifecycle-key => psa-lifecycle-type
   )

3.3.2.  Boot Seed

   The Boot Seed claim represents a random value created at system boot
   time that will allow differentiation of reports from different boot
   sessions.

   This claim MUST be present in a PSA attestation token.

   psa-boot-seed-type = bytes .size 32

   psa-boot-seed = (
       psa-boot-seed-key => psa-boot-seed-type
   )

3.4.  Software Inventory Claims

3.4.1.  Software Components

   The Software Components claim is a list of software components that
   includes all the software loaded by the PSA RoT.  This claim SHALL be
   included in attestation tokens produced by an implementation
   conformant with [PSA-SM].  If the Software Components claim is
   present, then the No Software Measurement claim (Section 3.4.2) MUST
   NOT be present.






Tschofenig, et al.      Expires 25 September 2021               [Page 8]


Internet-Draft            PSA Attestation Token               March 2021


   Each entry in the Software Components list describes one software
   component using the attributes described in the following
   subsections.  Unless explicitly stated, the presence of an attribute
   is OPTIONAL.

   Note that, as described in [I-D.ietf-rats-architecture], a relying
   party will typically see the result of the verification process from
   the Verifier in form of an attestation result, rather than the
   "naked" PSA token from the attesting endpoint.  Therefore, a relying
   party is not expected to understand the Software Components claim.
   Instead, it is for the Verifier to check this claim against the
   available endorsements and provide an answer in form of an "high
   level" attestation result, which may or may not include the original
   Software Components claim.

   psa-software-component = {
     ? 1 => text,          ; measurement type
       2 => psa-hash-type, ; measurement value
     ? 4 => text,          ; version
       5 => psa-hash-type, ; signer id
     ? 6 => text,          ; measurement description
   }

   psa-software-components = (
       psa-software-components-key => [ + psa-software-component ]
   )

3.4.1.1.  Measurement Type

   The Measurement Type attribute (key=1) is short string representing
   the role of this software component.

   The following measurement types MAY be used:

   *  "BL": a Boot Loader

   *  "PRoT": a component of the PSA Root of Trust

   *  "ARoT": a component of the Application Root of Trust

   *  "App": a component of the NSPE application

   *  "TS": a component of a Trusted Subsystem








Tschofenig, et al.      Expires 25 September 2021               [Page 9]


Internet-Draft            PSA Attestation Token               March 2021


3.4.1.2.  Measurement Value

   The Measurement Value attribute (key=2) represents a hash of the
   invariant software component in memory at startup time.  The value
   MUST be a cryptographic hash of 256 bits or stronger.

   This attribute MUST be present in a PSA software component.

3.4.1.3.  Version

   The Version attribute (key=4) is the issued software version in the
   form of a text string.  The value of this attribute will correspond
   to the entry in the original signed manifest of the component.

3.4.1.4.  Signer ID

   The Signer ID attribute (key=5) is the hash of a signing authority
   public key for the software component.  The value of this attribute
   will correspond to the entry in the original manifest for the
   component.  This can be used by a verifier to ensure the components
   were signed by an expected trusted source.

   This attribute MUST be present in a PSA software component to be
   compliant with [PSA-SM].

3.4.1.5.  Measurement Description

   The Measurement Description attribute (key=6) is the description of
   the way in which the measurement value of the software component is
   computed.  The value will be a text string containing an abbreviated
   description (or name) of the measurement method which can be used to
   lookup the details of the method in a profile document.  This
   attribute will normally be excluded, unless there was an exception to
   the default measurement described in the profile for a specific
   component.

3.4.2.  No Software Measurements

   In the event that the implementation does not contain any software
   measurements then the Software Components claim Section 3.4.1 can be
   omitted but instead the token MUST include this claim to indicate
   this is a deliberate state.  The value SHOULD be 1.  This claim is
   intended for devices that are not compliant with [PSA-SM].








Tschofenig, et al.      Expires 25 September 2021              [Page 10]


Internet-Draft            PSA Attestation Token               March 2021


   psa-no-sw-measurements-type = 1

   psa-no-sw-measurement = (
       psa-no-sw-measurement-key => psa-no-sw-measurements-type
   )

3.5.  Verification Claims

3.5.1.  Verification Service Indicator

   The Verification Service Indicator claim is a hint used by a relying
   party to locate a validation service for the token.  The value is a
   text string that can be used to locate the service or a URL
   specifying the address of the service.  A verifier may choose to
   ignore this claim in favor of other information.

   psa-verification-service-indicator-type = text

   psa-verification-service-indicator = (
       ? psa-verification-service-indicator-key =>
           psa-verification-service-indicator-type
   )

3.5.2.  Profile Definition

   The Profile Definition claim encodes the unique identifier that
   corresponds to the EAT profile described by this document.  This
   allows a receiver to assign the intended semantics to the rest of the
   claims found in the token.

   The EAT "profile" (claim key 18) is used.  The following constraints
   apply to its type:

   *  The URI encoding MUST be used.

   *  The value MUST be "http://arm.com/psa/2.0.0".

   This claim MUST be present in a PSA attestation token.

   See Section 4, for considerations about backwards compatibility with
   previous versions of the PSA attestation token format.

   psa-profile-type = "http://arm.com/psa/2.0.0"

   psa-profile = (
       18 => psa-profile-type
   )




Tschofenig, et al.      Expires 25 September 2021              [Page 11]


Internet-Draft            PSA Attestation Token               March 2021


4.  Backwards Compatibility Considerations

   Previous versions of this specification used different claim key
   values for the following claims:

   *  Nonce (claim key -75008);

   *  Instance ID (claim key -75009);

   *  Profile Description (claim key -75000 and value
      "PSA_IOT_PROFILE_1").

   These claim keys have been retired and their use is deprecated.

   Unless compatibility with existing infrastructure is a concern,
   emitters (e.g., devices that implement the PSA Attestation API)
   SHOULD produce tokens with their standard equivalent instead, as
   described in Section 3.1.1, Section 3.2.1 and Section 3.5.2
   respectively.

   To simplify the transition to the token format described in this
   document it is RECOMMENDED that receivers (e.g., PSA Attestation
   Verifiers) accept tokens encoded according to the old profile
   ("PROFILE_IOT_1") as well as to the new profile ("http://arm.com/
   psa/2.0.0"), at least for the time needed to their clients to
   upgrade.

5.  Token Encoding and Signing

   The PSA attestation token is encoded in CBOR [RFC7049] format.  Only
   definite-length string, arrays, and maps are allowed.

   Cryptographic protection is obtained by wrapping the "psa-token" map
   in a COSE Web Token (CWT) [RFC8392].  For asymmetric key algorithms,
   the signature structure MUST be COSE_Sign1.  For symmetric key
   algorithms, the signature structure MUST be COSE_Mac0.

   The CWT CBOR tag (61) is not used.  An application that needs to
   exchange PSA attestation tokens can use the media type defined in
   Section 10.1 or the CoAP Content-Format defined in Section 10.2.

6.  Freshness Model

   The PSA Token supports the freshness models for attestation Evidence
   based on nonces and epoch handles (Section 10.2 and 10.3 of
   [I-D.ietf-rats-architecture]) using the "nonce" claim to convey the
   nonce or epoch handle supplied by the Verifier.  No further
   assumption on the specific remote attestation protocol is made.



Tschofenig, et al.      Expires 25 September 2021              [Page 12]


Internet-Draft            PSA Attestation Token               March 2021


7.  Collated CDDL

   psa-token = {
       psa-nonce,
       psa-instance-id,
       psa-verification-service-indicator,
       psa-profile,
       psa-implementation-id,
       psa-client-id,
       psa-lifecycle,
       psa-certification-reference,
       psa-boot-seed,
       ( psa-software-components // psa-no-sw-measurement ),
   }

   psa-profile-key = -75000
   psa-client-id-key = -75001
   psa-lifecycle-key = -75002
   psa-implementation-id-key = -75003
   psa-boot-seed-key = -75004
   psa-certification-reference-key = -75005
   psa-software-components-key = -75006
   psa-no-sw-measurement-key = -75007
   psa-nonce-key = -75008
   psa-instance-id-key = -75009
   psa-verification-service-indicator-key = -75010

   psa-hash-type = bytes .size 32 / bytes .size 48 / bytes .size 64

   psa-boot-seed-type = bytes .size 32

   psa-boot-seed = (
       psa-boot-seed-key => psa-boot-seed-type
   )

   psa-client-id-nspe-type = -2147483648...0
   psa-client-id-spe-type = 1..2147483647

   psa-client-id-type = psa-client-id-nspe-type / psa-client-id-spe-type

   psa-client-id = (
       psa-client-id-key => psa-client-id-type
   )

   psa-certification-reference-type = text .regexp "[0-9]{13}"

   psa-certification-reference = (
       ? psa-certification-reference-key =>



Tschofenig, et al.      Expires 25 September 2021              [Page 13]


Internet-Draft            PSA Attestation Token               March 2021


           psa-certification-reference-type
   )

   psa-implementation-id-type = bytes .size 32

   psa-implementation-id = (
       psa-implementation-id-key => psa-implementation-id-type
   )

   psa-instance-id-type = bytes .size 33

   psa-instance-id = (
       11 => psa-instance-id-type
   )

   psa-no-sw-measurements-type = 1

   psa-no-sw-measurement = (
       psa-no-sw-measurement-key => psa-no-sw-measurements-type
   )

   psa-nonce = (
       10 => psa-hash-type
   )

   psa-profile-type = "http://arm.com/psa/2.0.0"

   psa-profile = (
       18 => psa-profile-type
   )

   psa-lifecycle-unknown-type = 0x0000..0x00ff
   psa-lifecycle-assembly-and-test-type = 0x1000..0x10ff
   psa-lifecycle-psa-rot-provisioning-type = 0x2000..0x20ff
   psa-lifecycle-secured-type = 0x3000..0x30ff
   psa-lifecycle-non-psa-rot-debug-type = 0x4000..0x40ff
   psa-lifecycle-recoverable-psa-rot-debug-type = 0x5000..0x50ff
   psa-lifecycle-decommissioned-type = 0x6000..0x60ff

   psa-lifecycle-type =
       psa-lifecycle-unknown-type /
       psa-lifecycle-assembly-and-test-type /
       psa-lifecycle-psa-rot-provisioning-type /
       psa-lifecycle-secured-type /
       psa-lifecycle-non-psa-rot-debug-type /
       psa-lifecycle-recoverable-psa-rot-debug-type /
       psa-lifecycle-decommissioned-type




Tschofenig, et al.      Expires 25 September 2021              [Page 14]


Internet-Draft            PSA Attestation Token               March 2021


   psa-lifecycle = (
       psa-lifecycle-key => psa-lifecycle-type
   )

   psa-software-component = {
     ? 1 => text,          ; measurement type
       2 => psa-hash-type, ; measurement value
     ? 4 => text,          ; version
       5 => psa-hash-type, ; signer id
     ? 6 => text,          ; measurement description
   }

   psa-software-components = (
       psa-software-components-key => [ + psa-software-component ]
   )

   psa-verification-service-indicator-type = text

   psa-verification-service-indicator = (
       ? psa-verification-service-indicator-key =>
           psa-verification-service-indicator-type
   )

8.  Security and Privacy Considerations

   This specification re-uses the CWT and the EAT specification.  Hence,
   the security and privacy considerations of those specifications apply
   here as well.

   Since CWTs offer different ways to protect the token, this
   specification profiles those options and allows signatures based on
   use of public key cryptography as well as MAC authentication.  The
   token MUST be signed following the structure of the COSE
   specification [RFC8152].  The COSE type MUST be COSE_Sign1 for public
   key signatures or COSE_Mac0 for MAC authentication.  Note however
   that use of MAC authentication is NOT RECOMMENDED due to the
   associated infrastructure costs for key management and protocol
   complexities.  It may also restrict the ability to interoperate with
   third parties.

   Attestation tokens contain information that may be unique to a device
   and therefore they may allow to single out an individual device for
   tracking purposes.  Implementations that have privacy requirements
   must take appropriate measures to ensure that the token is only used
   to provision anonymous/pseudonym keys.






Tschofenig, et al.      Expires 25 September 2021              [Page 15]


Internet-Draft            PSA Attestation Token               March 2021


9.  Verification

   To verify the token, the primary need is to check correct formation
   and signing as for any CWT token.  In addition though, the verifier
   can operate a policy where values of some of the claims in this
   profile can be compared to reference values, registered with the
   verifier for a given deployment, in order to confirm that the device
   is endorsed by the manufacturer supply chain.  The policy may require
   that the relevant claims must have a match to a registered reference
   value.  All claims may be worthy of additional appraisal.  It is
   likely that most deployments would include a policy with appraisal
   for the following claims:

   *  Instance ID - the value of the Instance ID can be used (together
      with the kid in the token COSE header, if present) to assist in
      locating the public key used to verify the token signature.

   *  Implementation ID - the value of the Implementation ID can be used
      to identify the verification requirements of the deployment.

   *  Software Component, Measurement Value - this value can uniquely
      identify a firmware release from the supply chain.  In some cases,
      a verifier may maintain a record for a series of firmware
      releases, being patches to an original baseline release.  A
      verification policy may then allow this value to match any point
      on that release sequence or expect some minimum level of maturity
      related to the sequence.

   *  Software Component, Signer ID - where present in a deployment,
      this could allow a verifier to operate a more general policy than
      that for Measurement Value as above, by allowing a token to
      contain any firmware entries signed by a known Signer ID, without
      checking for a uniquely registered version.

10.  IANA Considerations

10.1.  Media Type Registration

   IANA is requested to register the "application/psa-attestation-token"
   media type [RFC2046] in the "Media Types" registry [IANA-MediaTypes]
   in the manner described in RFC 6838 [RFC6838], which can be used to
   indicate that the content is a PSA Attestation Token.

   *  Type name: application

   *  Subtype name: psa-attestation-token

   *  Required parameters: n/a



Tschofenig, et al.      Expires 25 September 2021              [Page 16]


Internet-Draft            PSA Attestation Token               March 2021


   *  Optional parameters: n/a

   *  Encoding considerations: binary

   *  Security considerations: See the Security Considerations section
      of [[this RFC]]

   *  Interoperability considerations: n/a

   *  Published specification: [[this RFC]]

   *  Applications that use this media type: Attesters and Relying
      Parties sending PSA attestation tokens over HTTP(S), CoAP(S), and
      other transports.

   *  Fragment identifier considerations: n/a

   *  Additional information:

      -  Magic number(s): n/a

      -  File extension(s): n/a

      -  Macintosh file type code(s): n/a

   *  Person & email address to contact for further information: Hannes
      Tschofenig, Hannes.Tschofenig@arm.com

   *  Intended usage: COMMON

   *  Restrictions on usage: none

   *  Author: Hannes Tschofenig, Hannes.Tschofenig@arm.com

   *  Change controller: IESG

   *  Provisional registration?  No

10.2.  CoAP Content-Formats Registration

   IANA is requested to register the CoAP Content-Format ID for the
   "application/psa-attestation-token" media type in the "CoAP Content-
   Formats" registry [IANA-CoAP-Content-Formats].

10.2.1.  Registry Contents

   *  Media Type: application/psa-attestation-token




Tschofenig, et al.      Expires 25 September 2021              [Page 17]


Internet-Draft            PSA Attestation Token               March 2021


   *  Encoding: -

   *  Id: [[To-be-assigned by IANA]]

   *  Reference: [[this RFC]]

11.  References

11.1.  Normative References

   [EAN-13]   GS1, "International Article Number - EAN/UPC barcodes",
              2019, <https://www.gs1.org/standards/barcodes/ean-upc>.

   [I-D.ietf-rats-eat]
              Mandyam, G., Lundblade, L., Ballesteros, M., and J.
              O'Donoghue, "The Entity Attestation Token (EAT)", Work in
              Progress, Internet-Draft, draft-ietf-rats-eat-06, 2
              December 2020, <http://www.ietf.org/internet-drafts/draft-
              ietf-rats-eat-06.txt>.

   [PSA-FF]   Arm, "Platform Security Architecture Firmware Framework
              1.0 (PSA-FF)", February 2019, <https://developer.arm.com/-
              /media/Files/pdf/PlatformSecurityArchitecture/Architect/
              DEN0063-PSA_Firmware_Framework-1.0.0-2.pdf>.

   [PSA-SM]   Arm, "Platform Security Architecture Security Model 1.0
              (PSA-SM)", February 2019, <https://developer.arm.com/-
              /media/Files/pdf/PlatformSecurityArchitecture/Architect/
              DEN0079_PSA_SM_ALPHA-03_RC01.pdf>.

   [RFC2046]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
              Extensions (MIME) Part Two: Media Types", RFC 2046,
              DOI 10.17487/RFC2046, November 1996,
              <https://www.rfc-editor.org/info/rfc2046>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC6838]  Freed, N., Klensin, J., and T. Hansen, "Media Type
              Specifications and Registration Procedures", BCP 13,
              RFC 6838, DOI 10.17487/RFC6838, January 2013,
              <https://www.rfc-editor.org/info/rfc6838>.

   [RFC7049]  Bormann, C. and P. Hoffman, "Concise Binary Object
              Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
              October 2013, <https://www.rfc-editor.org/info/rfc7049>.



Tschofenig, et al.      Expires 25 September 2021              [Page 18]


Internet-Draft            PSA Attestation Token               March 2021


   [RFC8152]  Schaad, J., "CBOR Object Signing and Encryption (COSE)",
              RFC 8152, DOI 10.17487/RFC8152, July 2017,
              <https://www.rfc-editor.org/info/rfc8152>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8392]  Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,
              "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392,
              May 2018, <https://www.rfc-editor.org/info/rfc8392>.

   [RFC8610]  Birkholz, H., Vigano, C., and C. Bormann, "Concise Data
              Definition Language (CDDL): A Notational Convention to
              Express Concise Binary Object Representation (CBOR) and
              JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610,
              June 2019, <https://www.rfc-editor.org/info/rfc8610>.

11.2.  Informative References

   [I-D.ietf-rats-architecture]
              Birkholz, H., Thaler, D., Richardson, M., Smith, N., and
              W. Pan, "Remote Attestation Procedures Architecture", Work
              in Progress, Internet-Draft, draft-ietf-rats-architecture-
              08, 8 December 2020, <http://www.ietf.org/internet-drafts/
              draft-ietf-rats-architecture-08.txt>.

   [IANA-CoAP-Content-Formats]
              IANA, "CoAP Content-Formats", 2021,
              <https://www.iana.org/assignments/core-parameters>.

   [IANA-CWT] IANA, "CBOR Web Token (CWT) Claims", 2021,
              <https://www.iana.org/assignments/cwt/cwt.xhtml>.

   [IANA-MediaTypes]
              IANA, "Media Types", 2021,
              <http://www.iana.org/assignments/media-types>.

   [PSA]      Arm, "Platform Security Architecture Resources", 2021,
              <https://developer.arm.com/architectures/security-
              architectures/platform-security-architecture/
              documentation>.

   [TF-M]     Linaro, "Trusted Firmware-M", 2021,
              <https://www.trustedfirmware.org/projects/tf-m/>.






Tschofenig, et al.      Expires 25 September 2021              [Page 19]


Internet-Draft            PSA Attestation Token               March 2021


Appendix A.  Reference Implementation

   A reference implementation is provided by the Trusted Firmware
   project [TF-M].

Appendix B.  Example

   The following example shows a PSA attestation token for an
   hypothetical system comprising two measured software components (a
   boot loader and a trusted RTOS).  The attesting device is in a
   lifecycle state Section 3.3.1 of SECURED.  The attestation has been
   requested from a client residing in the SPE:

   {
     / profile /              18: "http://arm.com/psa/2.0.0",
     / psa-client-id /               -75001: 1,
     / psa-lifecycle /               -75002: 12288,
     / psa-implementation-id /       -75003: h'50515253545556575051
   52535455565750515253545556575051525354555657',
     / psa-boot-seed /               -75004: h'DEADBEEFDEADBEEFDEAD
   BEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF',
     / psa-certification-reference / -75005: "1234567890123",
     / psa-software-components /     -75006: [
       {
         / measurement type /  1: "BL",
         / measurement value / 2: h'0001020400010204000102040001020
   400010204000102040001020400010204',
         / signer ID /         5: h'519200FF519200FF519200FF519200F
   F519200FF519200FF519200FF519200FF'
       },
       {
         / measurement type /  1: "PRoT",
         / measurement value / 2: h'0506070805060708050607080506070
   805060708050607080506070805060708',
         / signer ID /         5: h'519200FF519200FF519200FF519200F
   F519200FF519200FF519200FF519200FF'
       }
     ],
     / nonce /               10: h'00010203000102030001020300010203
   00010203000102030001020300010203',
     / ueid /                11: h'01A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2
   A3A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2A3',
     / psa-verification-service-indicator / -75010: "https://psa-ve
   rifier.org"
   }

   The JWK representation of the IAK used for creating the COSE Sign1
   signature over the PSA token is:



Tschofenig, et al.      Expires 25 September 2021              [Page 20]


Internet-Draft            PSA Attestation Token               March 2021


   {
     "kty": "EC",
     "crv": "P-256",
     "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
     "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
     "d": "870MB6gfuTJ4HtUnUvYMyJpr5eUZNP4Bk43bVdj3eAE",
     "use": "enc",
     "kid": "1"
   }

   The resulting COSE object is:

   18(
     [
       / protected /   h'A10126',
       / unprotected / {},
       / payload /     h'AD127818687474703A2F2F61726D2E636F6D2F7073
   612F322E302E303A000124F8013A000124F91930003A000124FA582050515253
   545556575051525354555657505152535455565750515253545556573A000124
   FB5820DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDE
   ADBEEF3A000124FC6D313233343536373839303132333A000124FD82A3016242
   4C02582000010204000102040001020400010204000102040001020400010204
   00010204055820519200FF519200FF519200FF519200FF519200FF519200FF51
   9200FF519200FFA3016450526F54025820050607080506070805060708050607
   0805060708050607080506070805060708055820519200FF519200FF519200FF
   519200FF519200FF519200FF519200FF519200FF0A5820000102030001020300
   01020300010203000102030001020300010203000102030B582101A0A1A2A3A0
   A1A2A3A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2A3A0A1A2A33A00012501
   781868747470733A2F2F7073612D76657269666965722E6F72673A00012500F6
   3A000124F7F63A000124FFF6',
       / signature /   h'8C92FDC99CFDB0016F27008744B3730266342D2881
   861DC9A3F89E02394DE7F906EE2D1A3C164A59D580CDD7DFA077290CBFB55069
   C55A5D9A2AE17FA31D2108'
     ]
   )

Contributors

   We would like to thank the following colleagues for their
   contributions:

   * Laurence Lundblade
     Security Theory LLC
     lgl@securitytheory.com

   * Tamas Ban
     Arm Limited
     Tamas.Ban@arm.com



Tschofenig, et al.      Expires 25 September 2021              [Page 21]


Internet-Draft            PSA Attestation Token               March 2021


   * Sergei Trofimov
     Arm Limited
     Sergei.Trofimov@arm.com

Acknowledgments

   Thanks to Carsten Bormann for help with the CDDL and Nicholas Wood
   for ideas and comments.

Authors' Addresses

   Hannes Tschofenig
   Arm Limited

   Email: Hannes.Tschofenig@arm.com


   Simon Frost
   Arm Limited

   Email: Simon.Frost@arm.com


   Mathias Brossard
   Arm Limited

   Email: Mathias.Brossard@arm.com


   Adrian Shaw
   Arm Limited

   Email: Adrian.Shaw@arm.com


   Thomas Fossati
   Arm Limited

   Email: Thomas.Fossati@arm.com












Tschofenig, et al.      Expires 25 September 2021              [Page 22]