<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-halen-fed-tls-auth-12" submissionType="independent" category="info" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude">

<front>
<title abbrev="FedTLS">Federated TLS Authentication</title><seriesInfo value="draft-halen-fed-tls-auth-12" stream="independent" status="informational" name="Internet-Draft"></seriesInfo>
<author initials="J." surname="Schlyter" fullname="Jakob Schlyter"><organization>Kirei AB</organization><address><postal><street></street>
</postal><email>jakob@kirei.se</email>
</address></author>
<author initials="S." surname="Halén" fullname="Stefan Halén"><organization>The Swedish Internet Foundation</organization><address><postal><street></street>
</postal><email>stefan.halen@internetstiftelsen.se</email>
</address></author>
<date year="2024" month="June" day="13"></date>
<area>Internet</area>
<workgroup></workgroup>

<abstract>
<t>This document describes the Federated TLS Authentication (FedTLS) protocol, enabling secure machine-to-machine communication within a federation. Both clients and servers perform mutual TLS authentication, establishing trust based on a centrally managed trust anchor published by the federation. Additionally, FedTLS ensures unambiguous identification of entities, as only authorized members within the federation can publish metadata, further mitigating risks associated with unauthorized entities impersonating legitimate participants. This framework promotes seamless and secure interoperability across different trust domains adhering to common policies and standards within the federation.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>This document describes the Federated TLS Authentication (FedTLS) protocol, enabling secure machine-to-machine communication within a federation. Both the client and server undergo mutual TLS authentication (as defined in <xref target="RFC8446"></xref>), establishing a robust foundation of trust. This trust relies on a central trust anchor held and published by the federation, acting as a trusted third party connecting distinct trust domains under a common set of policies and standards.</t>
<t>A crucial aspect of FedTLS is the necessity for federation members to fully trust the federation operator. This trust is fundamental to the framework's design, as the federation operator is responsible for managing the central trust anchor, vetting members, and ensuring the integrity of the metadata used within the federation.</t>
<t>The FedTLS framework leverages a centralized repository of federation metadata to ensure secure communication between servers and clients within the federation. This repository includes information about public keys, certificate issuers, and additional entity details, such as organizational information and service descriptions. This centralized approach simplifies certificate management, promotes interoperability, and establishes trust within the federation. By directly accessing the federation metadata, efficient connections are established, eliminating manual configuration even for new interactions.</t>
<t>Without a FedTLS federation, implementing mutual TLS authentication often requires organizations to establish their own PKI infrastructure (or rely on third-party CAs) to issue and validate client certificates, leading to complexity and administrative burden. FedTLS allows the use of self-signed certificates, potentially reducing costs and administrative overhead. While self-signed certificates inherently lack the trust level of certificates issued by trusted CAs, the strong trust within the FedTLS framework is established through several mechanisms, including public key pinning <xref target="RFC7469"></xref> and member vetting procedures. This ensures the validity and authenticity of self-signed certificates within the federation, fostering secure communication without compromising trust.</t>
<t>The Swedish education sector illustrates the value of FedTLS by securing user lifecycle management endpoints through this framework. This successful collaboration between school authorities and service providers highlights FedTLS's ability to enable trust, simplify operations, and strengthen security within federated environments.</t>

<section anchor="reserved-words"><name>Reserved Words</name>
<t>This document is an Informational RFC, which means it offers information and guidance but does not specify mandatory standards. Therefore, the keywords used throughout this document are for informational purposes only and do not imply any specific requirements.</t>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in <xref target="RFC2119"></xref>.</t>
</section>

<section anchor="terminology"><name>Terminology</name>

<ul>
<li><strong>Federation</strong>: A trusted network of entities that adhere to common security policies and standards,using FedTLS for secure communication.</li>
<li><strong>Federation Member</strong>: An entity that has been approved to join the federation and can leverage FedTLS for secure communication with other members.</li>
<li><strong>Federation Operator</strong>: The entity responsible for the overall operation and management of the federation, including managing the federation metadata, enforcing security policies, and onboarding new members.</li>
<li><strong>Federation Metadata</strong>: A cryptographically signed document containing critical information about all entities within the federation.</li>
<li><strong>Metadata Repository</strong>: A centralized repository storing information about all entities within the federation.</li>
<li><strong>Member Metadata</strong>: Information about entities associated with a specific member within the federation.</li>
<li><strong>Member Vetting</strong>: The process of verifying and approving applicants to join the federation, ensuring they meet security and trustworthiness requirements.</li>
<li><strong>Trust Anchor</strong>: The federation's root of trust is established by the federation metadata signing key, which verifies the federation metadata and allows participants to confidently rely on the information it contains.</li>
</ul>
</section>
</section>

<section anchor="trust-model"><name>Trust Model</name>
<t>The FedTLS framework operates on a trust model that is central to its design and functionality. This section outlines the key components of this trust model and its implications for federation members and the federation operator.</t>

<section anchor="role-of-the-federation-operator"><name>Role of the Federation Operator</name>
<t>The federation operator plays a critical role in the FedTLS framework. This entity is responsible for:</t>

<ul>
<li>Managing the central trust anchor, which is used to establish trust across different domains within the federation.</li>
<li>Vetting federation members to ensure they meet the required standards and policies.</li>
<li>Maintaining and securing the federation metadata, which includes public key pins <xref target="RFC7469"></xref>, issuer certificates, and other essential information.</li>
</ul>
<t>Therefore, federation members must place full trust in the federation operator's integrity. The security and reliability of the entire federation depend on the integrity and competence of this central authority.</t>
</section>

<section anchor="federation-members-responsibilities"><name>Federation Members' Responsibilities</name>
<t>Federation members share the responsibility of maintaining trust and security within the federation. Their responsibilities include:</t>

<ul>
<li>Adhering to the federation's security policies and procedures.</li>
<li>Ensuring the accuracy and timeliness of their metadata submissions.</li>
<li>Cooperating with the federation operator's vetting and security measures.</li>
</ul>
<t>By fulfilling these responsibilities, federation members help sustain the overall trust framework that enables secure and reliable communication within the federation. Federation members submit member metadata to the federation. Both the authenticity of the submitted member metadata and the submitting member need to be ensured by the federation.</t>
</section>

<section anchor="trust-framework"><name>Trust Framework</name>
<t>Each federation operates within a trust framework that encompasses its own security policies and procedures. This framework is designed to ensure the integrity, authenticity, and confidentiality of communications within the federation. Key components of this framework include:</t>

<ul>
<li>Public key pinning <xref target="RFC7469"></xref> and preloading to thwart man-in-the-middle attacks by ensuring validated certificates.</li>
<li>Regular updates and verification of federation metadata to prevent the use of outdated or compromised information.</li>
</ul>
<t>The federation operator aggregates, signs, and publishes the federation metadata, which combines all members' member metadata along with additional federation-specific information. By placing trust in the federation and its associated signing key, federation members trust the information contained within the federation metadata.</t>
<t>The trust anchor for the federation is established through the federation's signing key, a critical component requiring secure distribution and verification. To achieve this, the federation's signing key is distributed using a JSON Web Key Set (JWKS) <xref target="RFC7517"></xref>, providing a flexible framework for exposing multiple keys, including the signing key and keys for rollover. This structured approach ensures members can readily access the necessary keys for verification purposes.</t>
<t>An additional layer of security is introduced through thumbprint verification <xref target="RFC7638"></xref>, where federation members can independently verify the key's authenticity. This involves comparing the calculated cryptographic thumbprint of the key with a trusted value, ensuring its integrity. Importantly, this verification process can be conducted through channels separate from the JWKS itself, enhancing security by eliminating reliance on a single distribution mechanism.</t>
<t>This trust framework is essential for enabling seamless and secure interoperability across different trust domains within the federation.</t>
</section>
</section>

<section anchor="metadata-repository"><name>Metadata Repository</name>
<t>The FedTLS metadata repository serves as the cornerstone of trust within a federation. It acts as a central vault, securely storing all information about all participating federation members and their respective entities. This information, known as federation metadata, is presented as a JWS <xref target="RFC7515"></xref>to ensure its authenticity and integrity.</t>
<t>The metadata repository is subject to stringent security measures to safeguard the integrity and confidentiality of the stored information. This MAY involve:</t>

<ul>
<li>Member Management: The federation operator can centrally enforce security policies and vet new members before they are added to the repository.</li>
<li>Access Controls: Only authorized members within the federation should have access to the repository.</li>
<li>Regular Backups: Robust backup procedures ensure data recovery in case of unforeseen circumstances.</li>
</ul>
<t>Before member metadata is added to the federation's repository, it is recommended that the submitted metadata undergo a validation process. This process aims to verify the accuracy, completeness, and validity of the information provided by a member. The validation process MAY include the following steps:</t>

<ul>
<li>Format Validation: The system checks if the submitted metadata adheres to the defined schema and format specifications.</li>
<li>Unique Entity ID: Checks are performed to ensure that the entity_id in the submitted metadata is not already registered by another member. Each entity within the federation must have a unique identifier.</li>
<li>Unique Public Key Pins: Public key pins <xref target="RFC7469"></xref> are utilized to locate the corresponding entity within the metadata upon establishing a connection. Through the validation process, these pins are ensured to be unique within the repository. This prevents ambiguity during connection establishment.</li>
<li>Certificate Verification: The issuer certificates listed in the metadata are validated to ensure that the algorithms used in the certificates are well-known and secure, and that the certificates are currently valid and have not expired</li>
<li>Organization: Verification is conducted to ensure the correctness of the organization name in the submitted metadata. Additionally, any other provided organizational information is verified to adhere to the federation policy.</li>
<li>Tag Validation: Ensures that tags in the metadata adhere to the defined tag structure, verifying both mandatory and optional tags. This process is crucial for maintaining consistency and preventing unauthorized tags within a federation.</li>
</ul>
<t>The FedTLS metadata repository serves as the vital foundation for establishing trust and enabling secure communication within a FedTLS environment. By providing a central, secure, and controlled repository for critical information, the metadata repository empowers members to confidently discover other trusted entities, and establish secure connections for seamless interaction.</t>
</section>

<section anchor="metadata-submission"><name>Metadata Submission</name>
<t>It is up to the federation to determine which channels should be provided to members for submitting their metadata to the metadata repository. Members typically have the option to either upload the metadata directly to the repository, provided such functionality exists, or to send it to the federation operator through a designated secure channel. If an insecure channel is used, additional measures MUST be taken to verify the authenticity and integrity of the metadata. Such measures may include verifying the checksum of the metadata through another channel. The choice of submission channel may depend on factors such as the federation's guidelines and the preferences of the member.</t>
</section>

<section anchor="maintaining-up-to-date-metadata"><name>Maintaining Up-to-Date Metadata</name>
<t>In a FedTLS federation, accurate and current metadata is essential for ensuring secure and reliable communication between members. This necessitates maintaining up-to-date metadata accessible by all members.</t>

<ul>
<li>Federation Metadata: The federation operator publishes a JWS containing an aggregate of all entity metadata. This JWS serves as the source of truth for information about all members within the federation. Outdated information in the JWS can lead to issues like failed connections, discovery challenges, and potential security risks.</li>
<li>Local Metadata: Each member maintains a local metadata store containing information about other members within the federation. This information is retrieved from the federation's publicly accessible JWS. Outdated data in the local store can hinder a member's ability to discover and connect with other relevant entities.</li>
</ul>
<t>Here's how metadata is kept up-to-date:</t>

<ul>
<li><t>Member Responsibility: The primary responsibility for maintaining accurate metadata lies with each member. Members are obligated to:</t>

<ul>
<li>Promptly update their member metadata whenever any relevant information changes and submit it to the metadata repository.</li>
<li>Periodically refresh their local metadata store, regardless of whether a caching mechanism is used. This ensures they retrieve the latest information from the federation's JWS, even if they have cached data.</li>
</ul></li>
<li><t>Federation Operator Role: The Federation Operator plays a crucial role in maintaining data integrity within the federation. Their responsibilities include:</t>

<ul>
<li>Defining clear guidelines for metadata updates, member responsibilities, and expiration time management.</li>
<li>Implementing automated mechanisms to update the published JWS containing the aggregate member metadata, ensuring it adheres to the expiration time (exp, see <xref target="metadata-signing"></xref>) and cache TTL (cache_ttl, see <xref target="federation-metadata-claims"></xref>) specifications.</li>
</ul></li>
</ul>
<t>By adhering to these responsibilities, the Federation ensures that information remains valid for the defined timeframe and that caching mechanisms utilize up-to-date data effectively.</t>
</section>

<section anchor="authentication"><name>Authentication</name>
<t>All communication established within the federation leverages mutual TLS authentication, as defined in <xref target="RFC8446"></xref>. This mechanism ensures the authenticity of both communicating parties, establishing a robust foundation for secure data exchange.</t>

<section anchor="public-key-pinning"><name>Public Key Pinning</name>
<t>To further fortify this trust and mitigate risks associated with fraudulent certificates issued by unauthorized entities, the federation implements public key pinning as specified in <xref target="RFC7469"></xref>. Public key pinning associates one or many unique public keys with each endpoint within the federation, stored in the federation metadata. During connection establishment, clients and servers validate the received certificate against the pre-configured public key pins retrieved from the federation metadata. This effectively thwarts attempts to utilize fraudulent certificates impersonating legitimate endpoints.</t>
</section>

<section anchor="pin-discovery-and-preloading"><name>Pin Discovery and Preloading</name>
<t>Peers in the federation retrieve these unique public key pins, serving as pre-configured trust parameters, from the federation metadata. The federation MUST facilitate the discovery process, enabling peers to identify the relevant pins for each endpoint. Information such as organization, tags, and descriptions within the federation metadata aids in this discovery.</t>
<t>Before initiating any connection, both clients and servers preload the chosen pins in strict adherence to the guidelines outlined in section 2.7 of <xref target="RFC7469"></xref>. This preloading ensures connections only occur with endpoints possessing matching public keys, effectively blocking attempts to use fraudulent certificates.</t>
</section>

<section anchor="verification-of-received-certificates"><name>Verification of Received Certificates</name>
<t>Upon connection establishment, both endpoints (client and server) must either leverage public key pinning or validate the received certificate against the published pins. Additionally, the federation metadata contains issuer information, which implementations MAY optionally use to verify certificate issuers. This step remains at the discretion of each individual implementation.</t>
<t>In scenarios where a TLS session terminates independent of the application (e.g., via a reverse proxy), the termination point can utilize optional untrusted TLS client certificate authentication or validate the certificate issuer itself. Depending on the specific implementation, pin validation can then be deferred to the application itself, assuming the peer certificate is appropriately transferred (e.g., via an HTTP header).</t>
</section>

<section anchor="failure-to-validate"><name>Failure to Validate</name>
<t>It is crucial to note that failure to validate a received certificate against the established parameters, whether through pinning or issuer verification, results in immediate termination of the connection. This strict approach ensures only authorized and secure communication channels are established within the federation.</t>
</section>
</section>

<section anchor="federation-metadata"><name>Federation Metadata</name>
<t>Federation metadata is published as a JWS <xref target="RFC7515"></xref>. The payload contains statements
about federation members entities.</t>
<t>Metadata is used for authentication and service discovery. A client selects a server based on metadata claims (e.g., organization, tags). The client then use the selected server claims base_uri, pins and if needed issuers to establish a connection.</t>
<t>Upon receiving a connection, a server validates the received client certificate using the client's published pins. Server MAY also check other claims such as organization and tags to determine if the connections is accepted or terminated.</t>

<section anchor="federation-metadata-claims"><name>Federation Metadata claims</name>
<t>This section defines the set of claims that can be included in metadata.</t>

<ul>
<li><t>version (REQUIRED)</t>
<t>Schema version follows semantic versioning (<eref target="https://semver.org">https://semver.org</eref>).</t>
</li>
<li><t>cache_ttl (OPTIONAL)</t>
<t>Specifies the duration in seconds for caching the downloaded federation metadata. This allows for caching independent of specific HTTP implementations or configurations, which is particularly beneficial in scenarios where the communication mechanism is not solely HTTP-based. In the event of an outage of the published metadata, members can rely on the cached metadata until it expires, as indicated by the exp claim in the JWS header (see <xref target="metadata-signing"></xref>). This approach ensures continuity of operations and avoids disruptions during temporary issues. However, once the metadata expires, it MUST no longer be trusted to maintain the security and integrity of the federation.</t>
</li>
<li><t>Entities (REQUIRED)</t>
<t>List of entities (see <xref target="entities"></xref>).</t>
</li>
</ul>

<section anchor="entities"><name>Entities</name>
<t>Metadata contains a list of entities that may be used for communication within the federation. Each entity describes one or more endpoints owned by a member. An entity has the following properties:</t>

<ul>
<li><t>entity_id (REQUIRED)</t>
<t>A URI that uniquely identifies the entity. This identifier MUST NOT collide with any other entity_id within the federation or with any other federation that the entity interacts with.</t>
<t>Example: &quot;<eref target="https://example.com&quot;">https://example.com"</eref></t>
</li>
<li><t>organization (OPTIONAL)</t>
<t>A name identifying the organization that the entity's metadata represents. The federation operator MUST ensure a mechanism is in place to verify that the organization claim corresponds to the rightful owner of the information exchanged between nodes. This is crucial for the trust model, ensuring certainty about the identities of the involved parties. The federation operator SHOULD choose an approach that best suits the specific needs and trust model of the federation.</t>
<t>Example: &quot;Example Org&quot;.</t>
</li>
<li><t>issuers (REQUIRED)</t>
<t>A list of certificate issuers that are allowed to issue certificates for the entity's endpoints. For each issuer, the issuer's root CA certificate is included in the x509certificate property (PEM-encoded).</t>
</li>
<li><t>servers (OPTIONAL)</t>
<t>List of the entity's servers (see <xref target="servers-clients"></xref>).</t>
</li>
<li><t>clients (OPTIONAL)</t>
<t>List of the entity's clients (see <xref target="servers-clients"></xref>).</t>
</li>
</ul>

<section anchor="servers-clients"><name>Servers / Clients</name>
<t>A list of the entity's servers and clients.</t>

<ul>
<li><t>description (OPTIONAL)</t>
<t>A human readable text describing the server or client.</t>
<t>Example: &quot;SCIM Server 1&quot;</t>
</li>
<li><t>base_uri (OPTIONAL)</t>
<t>The base URL of the server (hence required for endpoints describing servers).</t>
<t>Example: &quot;<eref target="https://scim.example.com/&quot;">https://scim.example.com/"</eref></t>
</li>
<li><t>pins (REQUIRED)</t>
<t>A list of Public Key Pins <xref target="RFC7469"></xref>. Each pin has the following properties:</t>

<ul>
<li><t>alg (REQUIRED)</t>
<t>The name of the cryptographic hash algorithm. The only allowed value is &quot;sha256&quot;.</t>
<t>Example: &quot;sha256&quot;</t>
</li>
<li><t>digest (REQUIRED)</t>
<t>The public key of the end-entity certificate converted to a Subject Public Key Information (SPKI) fingerprint, as specified in section 2.4 of <xref target="RFC7469"></xref>. For clients, the digest MUST be globally unique for unambiguous identification. However, within the same entity_id object, the same digest MAY be assigned to multiple clients.</t>
<t>Example: &quot;+hcmCjJEtLq4BRPhrILyhgn98Lhy6DaWdpmsBAgOLCQ=&quot;</t>
</li>
</ul></li>
<li><t>tags (OPTIONAL)</t>
<t>A list of strings that describe the endpoint's capabilities.</t>
<t>Tags are fundamental for discovery within a federation, aiding both servers and clients in identifying appropriate connections.</t>

<ul>
<li><t>Servers:  Tags enable servers to identify clients with specific characteristics or capabilities. For instance, a server might want to serve only clients with particular security clearances or those supporting specific protocol versions. By filtering incoming requests based on relevant tags, servers can efficiently identify suitable clients for serving.</t>
</li>
<li><t>Clients:  Tags also assist clients in discovering servers offering the services they require. Clients can search for servers based on tags indicating supported protocols or the type of data they handle. This enables clients to efficiently locate servers meeting their specific needs.</t>
</li>
</ul>
<t>Federation-Specific Considerations</t>
<t>While tags are tied to individual federations and serve distinct purposes within each, several key considerations are crucial to ensure clarity and promote consistent tag usage:</t>

<ul>
<li><t>Well-Defined Scope: Each federation MUST establish a clear scope for its tags, detailing their intended use, allowed tag values, associated meanings, and any relevant restrictions. Maintaining a well-defined and readily accessible registry of approved tags is essential for the federation.</t>
</li>
<li><t>Validation Mechanisms: Implementing validation mechanisms for tags is highly recommended. This may involve a dedicated operation or service verifying tag validity and compliance with the federation's regulations. Such validation ensures consistency within the federation by preventing the use of unauthorized or irrelevant tags.</t>
</li>
</ul>
<t>Pattern: <tt>^[a-z0-9]{1,64}$</tt></t>
<t>Example: <tt>[&quot;scim&quot;, &quot;xyzzy&quot;]</tt></t>
</li>
</ul>
</section>
</section>
</section>

<section anchor="metadata-schema"><name>Metadata Schema</name>
<t>The FedTLS metadata schema is defined in <xref target="json-schema-for-fedtls-metadata"></xref>. This schema specifies the format for describing entities involved in FedTLS and their associated information.</t>
<t><strong>Note:</strong> The schema in Appendix A is folded due to line length limitations as specified in <xref target="RFC8792"></xref>.</t>
</section>

<section anchor="example-metadata"><name>Example Metadata</name>
<t>The following is a non-normative example of a metadata statement. Line breaks within the issuers' claim is for readability only.</t>

<sourcecode type="json">{
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;cache_ttl&quot;: 3600,
  &quot;entities&quot;: [{
    &quot;entity_id&quot;: &quot;https://example.com&quot;,
    &quot;organization&quot;: &quot;Example Org&quot;,
    &quot;issuers&quot;: [{
      &quot;x509certificate&quot;: &quot;-----BEGIN CERTIFICATE-----\nMIIDDDCCAf
      SgAwIBAgIJAIOsfJBStJQhMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV\nBAM
      MEHNjaW0uZXhhbXBsZS5jb20wHhcNMTcwNDA2MDc1MzE3WhcNMTcwNTA2MD
      c1\nMzE3WjAbMRkwFwYDVQQDDBBzY2ltLmV4YW1wbGUuY29tMIIBIjANBgk
      qhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEAyr+3dXTC8YXoi0LDJTH0lTfv
      8omQivWFOr3+/PBE\n6hmpLSNXK/EZJBD6ZT4Q+tY8dPhyhzT5RFZCVlrDs
      e/kY00F4yoflKiqx9WSuCrq\nZFr1AUtIfGR/LvRUvDFtuHo1MzFttiK8Wr
      wskMYZrw1zLHTIVwBkfMw1qr2XzxFK\njt0CcDmFxNdY5Q8kuBojH9+xt5s
      ZbrJ9AVH/OI8JamSqDjk9ODyGg+GrEZFClP/B\nxa4Fsl04En/9GfaJnCU1
      NpU0cqvWbVUlLOy8DaQMN14HIdkTdmegEsg2LR/XrJkt\nho16diAXrgS25
      3xbkdD3T5d6lHiZCL6UxkBh4ZHRcoftSwIDAQABo1MwUTAdBgNV\nHQ4EFg
      QUs1dXuhGhGc2UNb7ikn3t6cBuU34wHwYDVR0jBBgwFoAUs1dXuhGhGc2U\
      nNb7ikn3t6cBuU34wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAA
      OCAQEA\nrR9wxPhUa2XfQ0agAC0oC8TFf8wbTYb0ElP5Ej834xMMW/wWTSA
      N8/3WqOWNQJ23\nf0vEeYQwfvbD2fjLvYTyM2tSPOWrtQpKuvulIrxV7Zz8
      A61NIjblE3rfea1eC8my\nTkDOlMKV+wlXXgUxirride+6ubOWRGf92fgze
      DGJWkmm/a9tj0L/3e0xIXeujxC7\nMIt3p99teHjvnZQ7FiIBlvGc1o8FD1
      FKmFYd74s7RxrAusBEAAmBo3xyB89cFU0d\nKB2fkH2lkqiqkyOtjrlHPoy
      6ws6g1S6U/Jx9n0NEeEqCfzXnh9jEpxisSO+fBZER\npCwj2LMNPQxZBqBF
      oxbFPw==\n-----END CERTIFICATE-----&quot;
    }],
    &quot;servers&quot;: [{
      &quot;description&quot;: &quot;SCIM Server 1&quot;,
      &quot;base_uri&quot;: &quot;https://scim.example.com/&quot;,
      &quot;pins&quot;: [{
        &quot;alg&quot;: &quot;sha256&quot;,
        &quot;digest&quot;: &quot;+hcmCjJEtLq4BRPhrILyhgn98Lhy6DaWdpmsBAgOLCQ=&quot;
      }],
      &quot;tags&quot;: [
        &quot;scim&quot;
      ]
    }],
    &quot;clients&quot;: [{
      &quot;description&quot;: &quot;SCIM Client 1&quot;,
      &quot;pins&quot;: [{
        &quot;alg&quot;: &quot;sha256&quot;,
        &quot;digest&quot;: &quot;+hcmCjJEtLq4BRPhrILyhgn98Lhy6DaWdpmsBAgOLCQ=&quot;
      }]
    }]
  }]
}
</sourcecode>
</section>

<section anchor="metadata-signing"><name>Metadata Signing</name>
<t>The federation metadata is signed with JWS and published using JWS JSON Serialization according to the General JWS JSON Serialization Syntax defined in <xref target="RFC7515"></xref>. It is RECOMMENDED that federation metadata signatures are created with algorithm <em>ECDSA using P-256 and SHA-256</em> (&quot;ES256&quot;) as defined in <xref target="RFC7518"></xref>.</t>
<t>The following federation metadata signature protected headers are REQUIRED:</t>

<ul>
<li><t><tt>alg</tt> (Algorithm)</t>
<t>Identifies the algorithm used to generate the JWS signature <xref target="RFC7515"></xref>, section 4.1.1.</t>
</li>
<li><t><tt>iat</tt> (Issued At)</t>
<t>Identifies the time on which the signature was issued. Its value MUST be a number containing a NumericDate value <xref target="RFC7519"></xref>, section 4.1.6.</t>
</li>
<li><t><tt>exp</tt> (Expiration Time)</t>
<t>Identifies the expiration time on and after which the signature and federation metadata are no longer valid. The expiration time of the federation metadata MUST be set to the value of exp. Its value MUST be a number containing a NumericDate value <xref target="RFC7519"></xref>, section 4.1.4.</t>
</li>
<li><t><tt>iss</tt> (Issuer)</t>
<t>A URI uniquely identifying the issuing federation, playing a critical role in establishing trust and securing interactions within the FedTLS framework. The iss claim differentiates federations, preventing ambiguity and ensuring entities are recognized within their intended context. Verification of the iss claim enables determining the origin of information and establishing trust with entities within the identified federation <xref target="RFC7519"></xref>, section 4.1.1.</t>
</li>
<li><t><tt>kid</tt> (Key Identifier)</t>
<t>The key ID is used to identify the signing key in the key set used to sign the JWS <xref target="RFC7515"></xref>, section 4.1.4.</t>
</li>
</ul>
</section>

<section anchor="example-signature-protected-header"><name>Example Signature Protected Header</name>
<t>The following is a non-normative example of a signature protected header.</t>

<sourcecode type="json">{
    &quot;alg&quot;: &quot;ES256&quot;,
    &quot;exp&quot;: 1707739718,
    &quot;iat&quot;: 1706875718,
    &quot;iss&quot;: &quot;https://fedtls.example.com&quot;,
    &quot;kid&quot;: &quot;c2fb760e-f4b6-4f7e-b17a-7115d2826d51&quot;
}
</sourcecode>
</section>
</section>

<section anchor="example-usage-scenarios"><name>Example Usage Scenarios</name>
<t>The examples in this section are non-normative.</t>
<t>The following example describes a scenario within the federation &quot;Skolfederation&quot; where FedTLS is already established. Both clients and servers are registered members of the federation. In this scenario, clients aim to manage cross-domain user accounts within the service. The standard used for account management is SS 12000:2018 (i.e., a SCIM extension).</t>

<sourcecode type="ascii-art">+---------------------------------------------+
|                                             |
|             Federation Metadata             |
|                                             |
+---+--------------------------+--------------+
    |                          |
   (A)                        (A)
    |                          |
    v                          v
+---+----+        +------------+--------------+
|Local MD|        |         Local MD          |
+---+----+        +----+------------- ---+----+
    |                  |                 |
   (B)                (C)               (F)
    |                  |                 |
    v                  v                 v
+---+----+        +----+---+        +----+---+
|        |        |        |        |        |
| Client |        | Reverse|        |  App   |
|        +--(D)--&gt;+ Proxy  +--(E)--&gt;+        |
|        |        |        |        |        |
|        |        |        |        |        |
+--------+        +--------+        +--------+
</sourcecode>

<ol type="A">
<li>Entities collect member metadata from the federation metadata.</li>
<li>The client pins the server's public key pins.</li>
<li>The reverse proxy trust anchor is setup with the clients' certificate issuers.</li>
<li>The client establishes a connection with the server using the base_uri from the federation metadata.</li>
<li>The reverse proxy forwards the client certificate to the application.</li>
<li>The application converts the certificate to a public key pin and checks the federation metadata for a matching pin. The entity's entity_id should be used as an identifier.</li>
</ol>

<section anchor="client"><name>Client</name>
<t>A certificate is issued for the client and the issuer is published in the federation metadata together with the client's certificate public key pins</t>
<t>When the client wants to connect to a remote server (identified by an entity identifier) the following steps need to be taken:</t>

<ol>
<li>Find possible server candidates by filtering the remote entity's list of servers based on tags.</li>
<li>Connect to the server URI. Include the entity's list of certificate issuers in the TLS clients list of trusted CAs, or trust the listed pins explicitly.</li>
<li>If pinning was not used, validate the received server certificate using the entity's published pins.</li>
<li>Commence transactions.</li>
</ol>
</section>

<section anchor="server"><name>Server</name>
<t>A certificate is issued for the server and the issuer is published in the federation metadata together with the server's name and certificate public key pin.</t>
<t>When the server receives a connection from a remote client, the following steps need to be taken:</t>

<ol>
<li>Populate list of trusted CAs using all known entities' published issuers and required TLS client certificate authentication, or configure optional untrusted TLS client certificate authentication (e.g., optional_no_ca).</li>
<li>Once a connection has been accepted, validate the received client certificate using the client's published pins.</li>
<li>Commence transactions.</li>
</ol>
</section>

<section anchor="spki-generation"><name>SPKI Generation</name>
<t>Example of how to use OpenSSL to generate a SPKI fingerprint from a PEM-encoded certificate.</t>

<sourcecode type="bash">  openssl x509 -in &lt;certificate.pem&gt; -pubkey -noout | \
  openssl pkey -pubin -outform der | \
  openssl dgst -sha256 -binary | \
  openssl enc -base64
</sourcecode>
</section>

<section anchor="curl-and-public-key-pinning"><name>Curl and Public Key Pinning</name>
<t>Example of public key pinning with curl. Line breaks are for readability only.</t>

<sourcecode type="bash">  curl --cert client.pem --key client.key --pinnedpubkey 'sha256//0Ok
  2aNfcrCNDMhC2uXIdxBFOvMfEVtzlNVUT5pur0Dk=' https://host.example.com
</sourcecode>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>

<section anchor="security-risks-and-trust-management"><name>Security Risks and Trust Management</name>
<t>The security risks associated with the FedTLS framework are confined to each individual federation. Both the federation operator and federation members share the responsibility of maintaining trust and security within the federation. Proper handling and management of metadata, as well as thorough vetting of federation members, are crucial to sustaining this trust and security. Each federation operates within a trust framework, which includes its own security policies and procedures to ensure the integrity and reliability of the federation.</t>
</section>

<section anchor="tls"><name>TLS</name>
<t>The security considerations for TLS 1.3 <xref target="RFC8446"></xref> are detailed in Section 10, along with Appendices C, D, and E of RFC 8446.</t>
</section>

<section anchor="federation-metadata-updates"><name>Federation Metadata Updates</name>
<t>Regularly updating the local copy of federation metadata is essential for accessing the latest information about active entities, current public key pins <xref target="RFC7469"></xref>, and valid issuer certificates. The use of outdated metadata may expose systems to security risks, such as interaction with revoked entities or acceptance of manipulated data.</t>
</section>

<section anchor="verifying-the-federation-metadata-signature"><name>Verifying the Federation Metadata Signature</name>
<t>Ensuring data integrity and security within the FedTLS framework relies on verifying the signature of downloaded federation metadata. This verification process confirms the data's origin, ensuring it comes from the intended source and has not been altered by unauthorized parties. By establishing the authenticity of the metadata, trust is maintained in the information it contains, including valid member public key pins and issuer certificates. To achieve a robust implementation, it is crucial to consider the security aspects outlined in <xref target="RFC7515"></xref>. Key points include handling algorithm selection, protecting against key compromise, and ensuring the integrity of the signature process.</t>
</section>

<section anchor="time-synchronization"><name>Time Synchronization</name>
<t>Maintaining synchronized clocks across all federation members is critical for the security of the FedTLS framework. Inaccurate timestamps can compromise the validity of digital signatures and certificates, hinder reliable log analysis, and potentially expose the system to time-based attacks. Therefore, all federation members MUST employ methods to ensure their system clocks are synchronized with a reliable time source.</t>
</section>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>This project was funded through the NGI0 PET Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825310.</t>
<t>The authors would like to thank the following people for the detailed review and suggestions:</t>

<ul>
<li>Rasmus Larsson</li>
<li>Mats Dufberg</li>
<li>Joe Siltberg</li>
<li>Stefan Norberg</li>
<li>Petter Blomberg</li>
</ul>
<t>The authors would also like to thank participants in the EGIL working group for their comments on this specification.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document has no IANA actions.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7469.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7638.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7518.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8792.xml"/>
</references>

<section anchor="json-schema-for-fedtls-metadata"><name>JSON Schema for FedTLS Metadata</name>
<t>This JSON schema defines the format of FedTLS metadata.</t>
<t>Version: 1.0.0</t>

<artwork>=============== NOTE: '\\' line wrapping per RFC 8792 ===============

{
    &quot;$schema&quot;: &quot;https://json-schema.org/draft/2020-12/schema&quot;,
    &quot;$id&quot;: &quot;https://www.fedtls.se/schema/fedtls-metadata-schema.json\
\&quot;,
    &quot;title&quot;: &quot;JSON Schema for Federated TLS Authentication&quot;,
    &quot;description&quot;: &quot;Version: 1.0.0&quot;,
    &quot;type&quot;: &quot;object&quot;,
    &quot;additionalProperties&quot;: true,
    &quot;required&quot;: [
        &quot;version&quot;,
        &quot;entities&quot;
    ],
    &quot;properties&quot;: {
        &quot;version&quot;: {
            &quot;title&quot;: &quot;Metadata schema version&quot;,
            &quot;description&quot;: &quot;Schema version follows semantic versioni\
\ng (https://semver.org)&quot;,
            &quot;type&quot;: &quot;string&quot;,
            &quot;pattern&quot;: &quot;^\\d+\\.\\d+\\.\\d+$&quot;,
            &quot;examples&quot;: [
                &quot;1.0.0&quot;
            ]
        },
        &quot;cache_ttl&quot;: {
            &quot;title&quot;: &quot;Metadata cache TTL&quot;,
            &quot;description&quot;: &quot;How long (in seconds) to cache metadata.\
\ Effective maximum TTL is the minimum of HTTP Expire and TTL&quot;,
            &quot;type&quot;: &quot;integer&quot;,
            &quot;minimum&quot;: 0,
            &quot;examples&quot;: [
                3600
            ]
        },
        &quot;entities&quot;: {
            &quot;type&quot;: &quot;array&quot;,
            &quot;items&quot;: {
                &quot;$ref&quot;: &quot;#/components/entity&quot;
            }
        }
    },
    &quot;components&quot;: {
        &quot;entity&quot;: {
            &quot;type&quot;: &quot;object&quot;,
            &quot;additionalProperties&quot;: true,
            &quot;required&quot;: [
                &quot;entity_id&quot;,
                &quot;issuers&quot;
            ],
            &quot;properties&quot;: {
                &quot;entity_id&quot;: {
                    &quot;title&quot;: &quot;Entity identifier&quot;,
                    &quot;description&quot;: &quot;Globally unique identifier for t\
\he entity.&quot;,
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;format&quot;: &quot;uri&quot;,
                    &quot;examples&quot;: [
                        &quot;https://example.com&quot;
                    ]
                },
                &quot;organization&quot;: {
                    &quot;title&quot;: &quot;Name of entity organization&quot;,
                    &quot;description&quot;: &quot;Name identifying the organizatio\
\n that the entity's metadata represents.&quot;,
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;examples&quot;: [
                        &quot;Example Org&quot;
                    ]
                },
                &quot;issuers&quot;: {
                    &quot;title&quot;: &quot;Entity certificate issuers&quot;,
                    &quot;description&quot;: &quot;A list of certificate issuers th\
\at are allowed to issue certificates for the entity's endpoints. Fo\
\r each issuer, the issuer's root CA certificate is included in the \
\x509certificate property (PEM-encoded).&quot;,
                    &quot;type&quot;: &quot;array&quot;,
                    &quot;items&quot;: {
                        &quot;$ref&quot;: &quot;#/components/cert_issuers&quot;
                    }
                },
                &quot;servers&quot;: {
                    &quot;type&quot;: &quot;array&quot;,
                    &quot;items&quot;: {
                        &quot;$ref&quot;: &quot;#/components/endpoint&quot;
                    }
                },
                &quot;clients&quot;: {
                    &quot;type&quot;: &quot;array&quot;,
                    &quot;items&quot;: {
                        &quot;$ref&quot;: &quot;#/components/endpoint&quot;
                    }
                }
            }
        },
        &quot;endpoint&quot;: {
            &quot;type&quot;: &quot;object&quot;,
            &quot;additionalProperties&quot;: true,
            &quot;required&quot;: [
                &quot;pins&quot;
            ],
            &quot;properties&quot;: {
                &quot;description&quot;: {
                    &quot;title&quot;: &quot;Endpoint description&quot;,
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;examples&quot;: [
                        &quot;SCIM Server 1&quot;
                    ]
                },
                &quot;tags&quot;: {
                    &quot;title&quot;: &quot;Endpoint tags&quot;,
                    &quot;description&quot;: &quot;A list of strings that describe \
\the endpoint's capabilities.&quot;,
                    &quot;type&quot;: &quot;array&quot;,
                    &quot;items&quot;: {
                        &quot;type&quot;: &quot;string&quot;,
                        &quot;pattern&quot;: &quot;^[a-z0-9]{1,64}$&quot;,
                        &quot;examples&quot;: [
                            &quot;xyzzy&quot;
                        ]
                    }
                },
                &quot;base_uri&quot;: {
                    &quot;title&quot;: &quot;Endpoint base URI&quot;,
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;format&quot;: &quot;uri&quot;,
                    &quot;examples&quot;: [
                        &quot;https://scim.example.com&quot;
                    ]
                },
                &quot;pins&quot;: {
                    &quot;title&quot;: &quot;Certificate pin set&quot;,
                    &quot;type&quot;: &quot;array&quot;,
                    &quot;items&quot;: {
                        &quot;$ref&quot;: &quot;#/components/pin_directive&quot;
                    }
                }
            }
        },
        &quot;cert_issuers&quot;: {
            &quot;title&quot;: &quot;Certificate issuers&quot;,
            &quot;type&quot;: &quot;object&quot;,
            &quot;additionalProperties&quot;: false,
            &quot;properties&quot;: {
                &quot;x509certificate&quot;: {
                    &quot;title&quot;: &quot;X.509 Certificate (PEM)&quot;,
                    &quot;type&quot;: &quot;string&quot;
                }
            }
        },
        &quot;pin_directive&quot;: {
            &quot;title&quot;: &quot;RFC 7469 pin directive&quot;,
            &quot;type&quot;: &quot;object&quot;,
            &quot;additionalProperties&quot;: false,
            &quot;required&quot;: [
                &quot;alg&quot;,
                &quot;digest&quot;
            ],
            &quot;properties&quot;: {
                &quot;alg&quot;: {
                    &quot;title&quot;: &quot;Directive name&quot;,
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;enum&quot;: [
                        &quot;sha256&quot;
                    ],
                    &quot;examples&quot;: [
                        &quot;sha256&quot;
                    ]
                },
                &quot;digest&quot;: {
                    &quot;title&quot;: &quot;Directive value (Base64)&quot;,
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;pattern&quot;: &quot;^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+\
\/]{2}==|[A-Za-z0-9+/]{3}=)?$&quot;,
                    &quot;examples&quot;: [
                        &quot;HiMkrb4phPSP+OvGqmZd6sGvy7AUn4k3XEe8OMBrzt8\
\=&quot;
                    ]
                }
            }
        }
    }
}
</artwork>
</section>

</back>

</rfc>
