RFC 8076

A Usage for Shared Resources in RELOAD (ShaRe)

๐Ÿ“… published March 2017, from ietf

๐Ÿ“ฎ RFC 8076: A Usage for Shared Resources in RELOAD (ShaRe) ๐Ÿฆ‹

okay bestie, this one is from the IETF ๐ŸŒธ, and it's literally a Standards Track doc, so it's the real deal โœจ. It was written by A. Knauf, T. Schmidt (Ed.), G. Hege, and M. Waehlisch ๐Ÿซถ. Knauf, Schmidt, and Hege are at HAW Hamburg and daviko GmbH, and Waehlisch is at link-lab & FU Berlin ๐ŸŽ€. It's dated March 2017 ๐Ÿ“, and it's published as RFC 8076 ๐Ÿ’…. It doesn't obsolete or update anything, so it's a brand new spec, no drama ๐Ÿ’–. Its ISSN is 2070-1721 ๐ŸŒˆ.

Quick heads-up, the whole thing is long, so this is part 1 of 4 ๐Ÿงš. There's more coming, so stay tuned, no signing off yet ๐Ÿ’œ.


Abstract โœจ

Okay so the big idea ๐Ÿ”ฅ: this doc defines a RELOAD Usage for managing shared write access to RELOAD Resources. RELOAD is the REsource LOcation And Discovery protocol, and we're calling this Usage ShaRe, short for Shared Resources in RELOAD ๐Ÿฆ‹. Shared Resources are a basic primitive for coordination and notification schemes among distributed peers, and it's giving main character energy ๐Ÿ‘‘.

Access is controlled by a hierarchical trust delegation scheme that lives inside an access list ๐ŸŒธ. There's also a brand new USER-CHAIN-ACL access policy, which lets authorized peers write a Shared Resource without owning its certificate ๐Ÿ˜ญ. On top of that, the spec adds a way to store Resources under a variable name, which is super useful when you need peer-independent rendezvous processes ๐Ÿงš.

Status of This Memo ๐ŸŒˆ

This is an Internet Standards Track document ๐Ÿ’…. It's a product of the IETF, it represents the consensus of the IETF community, it got public review, and it's been approved by the IESG ๐Ÿซถ. If you want more on Internet Standards, check out Section 2 of RFC 7841 ๐ŸŽ€. You can find the current status, errata, and feedback info at http://www.rfc-editor.org/info/rfc8076 โœจ.

Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved ๐Ÿ”ฅ. This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents, which you can read at http://trustee.ietf.org/license-info ๐ŸŒท. Please actually read those, bestie, because they describe your rights and restrictions ๐Ÿ™ˆ. Code Components pulled out of this doc must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty as described in the Simplified BSD License ๐Ÿ’€.

Table of Contents ๐Ÿ“

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   5
3.  Shared Resources in RELOAD  . . . . . . . . . . . . . . . . .   5
  3.1.  Mechanisms for Isolating Stored Data  . . . . . . . . . .   6
4.  Access Control List Definition  . . . . . . . . . . . . . . .   7
  4.1.  Overview  . . . . . . . . . . . . . . . . . . . . . . . .   7
  4.2.  Data Structure  . . . . . . . . . . . . . . . . . . . . .   9
5.  Extension for Variable Resource Names . . . . . . . . . . . .  10
  5.1.  Overview  . . . . . . . . . . . . . . . . . . . . . . . .  10
  5.2.  Data Structure  . . . . . . . . . . . . . . . . . . . . .  11
  5.3.  Overlay Configuration Document Extension  . . . . . . . .  12
6.  Access Control to Shared Resources  . . . . . . . . . . . . .  13
  6.1.  Granting Write Access . . . . . . . . . . . . . . . . . .  13
  6.2.  Revoking Write Access . . . . . . . . . . . . . . . . . .  14
  6.3.  Validating Write Access through an ACL  . . . . . . . . .  14
  6.4.  Operations of Storing Peers . . . . . . . . . . . . . . .  15
  6.5.  Operations of Accessing Peers . . . . . . . . . . . . . .  16
  6.6.  USER-CHAIN-ACL Access Policy  . . . . . . . . . . . . . .  16
7.  ACCESS-CONTROL-LIST Kind Definition . . . . . . . . . . . . .  17
8.  Security Considerations . . . . . . . . . . . . . . . . . . .  17
  8.1.  Resource Exhaustion . . . . . . . . . . . . . . . . . . .  17
  8.2.  Malicious or Misbehaving Storing Peer . . . . . . . . . .  18
  8.3.  Trust Delegation to a Malicious or Misbehaving Peer . . .  18
  8.4.  Privacy Issues  . . . . . . . . . . . . . . . . . . . . .  18
9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  19
  9.1.  Access Control Policy . . . . . . . . . . . . . . . . . .  19
  9.2.  Data Kind-ID  . . . . . . . . . . . . . . . . . . . . . .  19
  9.3.  XML Namespace Registration  . . . . . . . . . . . . . . .  19
10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  20
  10.1.  Normative References . . . . . . . . . . . . . . . . . .  20
  10.2.  Informative References . . . . . . . . . . . . . . . . .  20
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  21
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  22

1. Introduction ๐Ÿฆ‹

Okay so [RFC6940] defines the base RELOAD protocol ๐ŸŒธ, and it lets people build app-specific extensions called Usages ๐Ÿงš. This doc defines one of those Usages for managing shared write access to RELOAD Resources, plus a way to store Resources with variable names ๐Ÿ’…. ShaRe lets overlay users share their exclusive write access to specific Resource/Kind pairs with other people ๐Ÿซถ. Shared Resources are a basic primitive for all kinds of coordination and notification schemes among distributed peers ๐Ÿ”ฅ. Write permission is controlled by an Access Control List (ACL) Kind, which keeps a chain of Authorized Peers for each Shared Resource ๐Ÿ’œ. And the newly defined USER-CHAIN-ACL access control policy is what makes shared write access work in RELOAD ๐ŸŒˆ.

ShaRe is built for jointly coordinated group apps among distributed peers ๐Ÿ‘‘. Examples are third-party registration (see [RFC7904]) and distributed conferencing ๐ŸŽ€. The really big use case is rendezvous processes, where one identifier is linked to multiple dynamic instances of a distributed cooperative service โœจ. Shared write access runs on trust delegation: you transfer the authority to write a specific Kind by storing logical Access Control Lists ๐Ÿ˜ญ. An ACL holds the ID of the Kind being shared, plus trust delegations from one authorized user to another, previously unauthorized, user ๐Ÿ“.

Shared write access also sits on top of the RELOAD security model ๐Ÿ™ˆ. That model says peers can only write resources at a small set of well-defined locations (Resource-IDs) in the overlay ๐Ÿ’€. With the standard RELOAD access control rules, those locations are tied to the username or Node-ID in the peer's certificate ๐ŸŒท. This doc extends the base policies so that multiple users can get controlled write access to one shared Resource-ID ๐Ÿฆ‹.

Last thing: this spec also defines an optional mechanism for storing Resources with a variable Resource Name ๐ŸŒธ. It lets you store Resources whose names follow a specific pattern ๐Ÿงš. The pattern itself is arbitrary, but it MUST contain the username of the Resource creator ๐Ÿ’….

2. Terminology ๐Ÿ’–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ๐Ÿ”ฅ.

This doc uses the terminology and definitions from the RELOAD base [RFC6940] and [RFC7890] ๐ŸŒˆ, especially the RELOAD Usage, Resource, and Kind ๐Ÿซถ. A few more terms are used too ๐Ÿ’œ:

  • Shared Resource: A RELOAD Resource with its associated Kinds that can be written or overwritten by multiple RELOAD users, following the specs in this document ๐Ÿฆ‹.
  • Access Control List: A logical list of RELOAD users allowed to write a specific RELOAD Resource/Kind pair, following this doc's specs ๐ŸŒธ. The list items are stored as Access Control List Kinds that map trust delegations from user A to user B ๐Ÿงš. A is allowed to write the Shared Resource and the ACL, and B gets write access to the specified Kinds from A ๐Ÿ’….
  • Resource Owner: The RELOAD peer that first stored a Resource to be shared ๐ŸŽ€. The Resource Owner holds the RELOAD certificate that grants write access to that Resource/Kind pair under the RELOAD certificate-based access control policies ๐Ÿ‘‘.
  • Authorized Peer: A RELOAD peer that got write access to a Shared Resource, granted by the Resource Owner or by another Authorized Peer โœจ.

3. Shared Resources in RELOAD ๐ŸŒท

A RELOAD user who owns a certificate for writing at a specific overlay location can maintain one or more RELOAD Kinds meant for non-exclusive write access shared with other RELOAD users ๐Ÿ”ฅ. Sharing those Resource/Kind pairs with a group takes two basic steps ๐Ÿ“:

  1. Storing the Resource/Kind pairs to be shared ๐Ÿฆ‹.
  2. Storing an Access Control List (ACL) associated with those Kinds ๐Ÿ’œ.

ACLs are created by the Resource Owner and hold ACL items, each delegating permission to write the shared Kind to one specific user, called the "Authorized Peer" ๐Ÿซถ. For each shared Kind data, the Resource Owner stores a root item that starts an Access Control List ๐ŸŒˆ. The Authorized Peer can also be given the right to delegate write permission further, which builds a tree of trust delegations with the Resource Owner as the trust anchor at its root ๐ŸŒธ.

Any RELOAD Kind that follows these specs can be a Resource/Kind pair to share ๐Ÿงš:

Isolated Data Storage: To stop concurrent writes from causing race conditions, each data item stored within a Shared Resource SHALL be exclusively maintained by the RELOAD user who created it. So Usages that allow storing Shared Resources are REQUIRED to use either the array or dictionary data model, and to apply extra mechanisms for isolating data as described in Section 3.1 ๐Ÿ’….

Access Control Policy: To make sure Authorized Peers can write to a Shared Resource, each Usage MUST use the USER-CHAIN-ACL access policy described in Section 6.6 ๐ŸŽ€.

Resource Name Extension: To let Shared Resources be stored under a variable resource name, this doc defines an optional ResourceNameExtension structure ๐Ÿ‘‘. It holds the Resource Name of the Kind data being stored, and lets any receiver of shared data check whether the Resource Name hashes to the Resource-ID โœจ. The ResourceNameExtension is optional by configuration ๐Ÿ˜ญ. The field only shows up in the Kind data structure when the corresponding kind-block of the overlay configuration document says so (see Section 5.3 for more) ๐Ÿ“. If the configuration allows variable resource names, a Kind using the USER-CHAIN-ACL policy MUST use the ResourceNameExtension as the initial field within its Kind data structure definition ๐Ÿ™ˆ. Otherwise, the Kind data structure does not contain the ResourceNameExtension structure ๐Ÿ’€.


โœจ That's the end of part 1 of 4! Next up is Section 3.1 and the ACL definition ๐Ÿฆ‹. Keep your eyes peeled, bestie ๐Ÿ’–.

3.1. Mechanisms for Isolating Stored Data

okay so this part is all about stopping two peers from stomping on each other's data at the same time ๐Ÿ˜ญ this section lays out the mechanisms that avoid race conditions when you're writing to an array or dictionary of a Shared Resource.

If a dictionary is used in the Shared Resource, the dictionary key MUST be the Node-ID of the certificate that will be used to sign the stored data. Thus, data access is bound to the unique ID holder, and write concurrency does not occur. โœจ this one is so clean, bestie

If the data model of the Shared Resource is an array, each Authorized Peer that chooses to write data SHALL obtain its exclusive range of the array indices. ๐ŸŽ€ here's the algorithm that makes an array indexing scheme with zero collisions:

  1. Obtain the Node-ID of the certificate that will be used to sign the stored data.
  2. Take the least significant 24 bits of that Node-ID to prefix the array index.
  3. Append an 8-bit individual index value to those 24 bits of the Node-ID.

The resulting 32-bit long integer MUST be used as the index for storing an array entry in a Shared Resource. The 24 bits of the Node-ID serve as a collision-resistant identifier. The 8-bit individual index remains under the control of a single Peer and can be incremented individually for further array entries. In total, each Peer can generate 256 distinct entries for application-specific use. ๐Ÿฆ‹

The mechanism to create the array index inherits collision-resistance from the overlay hash function in use (e.g., SHA-1). It is designed to work reliably for small sizes of groups as applicable to resource sharing. In the rare event of a collision, the Storing Peer will refuse to (over-)write the requested array index and protect indexing integrity as defined in Section 6.1. A Peer could rejoin the overlay with a different Node-ID in such a case. ๐ŸŒธ


4. Access Control List Definition ๐Ÿ”ฅ

4.1. Overview

An Access Control List (ACL) is a (self-managed) Shared Resource that contains a list of AccessControlListItem structures as defined in Section 4.2. Each entry delegates write access for a specific Kind data to a single RELOAD user. An ACL enables the RELOAD user who is authorized to write a specific Resource-ID to delegate his exclusive write access to a specific Kind to further users of the same RELOAD overlay. Therefore, each Access Control List data structure carries the information about who obtains write access, the Kind-ID of the Resource to be shared, and whether delegation includes write access to the ACL itself. The latter condition grants the right to delegate write access further for the Authorized Peer. Access Control Lists are stored at the same overlay location as the Shared Resource and use the RELOAD array data model. They are initially created by the Resource Owner. ๐Ÿ‘‘

Figure 1 shows an example of an Access Control List. We omit the res_name_ext field to simplify illustration. The array entry at index 0x123abc01 displays the initial creation of an ACL for a Shared Resource of Kind-ID 1234 at the same Resource-ID. It represents the root item of the trust delegation tree for this shared RELOAD Kind. The root entry MUST contain the username of the Resource owner in the "to_user" field and can only be written by the owner of the public key certificate associated with this Resource-ID. The allow_delegation (ad) flag for a root ACL item is set to 1 by default. The array index is generated by using the mechanism for isolating stored data as described in Section 3.1. Hence, the most significant 24 bits of the array index (0x123abc) are the least significant 24 bits of the Node-ID of the Resource Owner. ๐Ÿงš

The array item at index 0x123abc02 represents the first trust delegation to an Authorized Peer that is thus permitted to write to the Shared Resource of Kind-ID 1234. Additionally, the Authorized peer Alice is also granted write access to the ACL as indicated by the allow_delegation flag (ad) set to 1. This configuration authorizes Alice to store further trust delegations to the Shared Resource, i.e., add items to the ACL. On the contrary, index 0x456def01 illustrates trust delegation for Kind-ID 1234, in which the Authorized Peer Bob is not allowed to grant access to further peers (ad = 0). Each Authorized Peer signs its ACL items by using its own signer identity along with its own private key. This allows other peers to validate the origin of an ACL item and makes ownership transparent. ๐Ÿ’œ

To manage Shared Resource access of multiple Kinds at a single location, the Resource Owner can create new ACL entries that refer to another Kind-ID as shown in array entry index 0x123abc03. Note that overwriting existing items in an Access Control List with a change in the Kind-ID revokes all trust delegations in the corresponding subtree (see Section 6.2). Authorized Peers are only enabled to overwrite existing ACL item they own. The Resource Owner is allowed to overwrite any existing ACL item, but should be aware of its consequences on the trust delegation chain. โš ๏ธ

      +------------------------------------------------------+
      |                Access Control List                   |
      +-----------+------------------------------+-----------+
      |  #Index   |       Array Entries          | signed by |
      +-----------+------------------------------+-----------+
      | 123abc01  | to_user:Owner Kind:1234 ad:1 |   Owner   |
      +-----------+------------------------------+-----------+
      | 123abc02  | to_user:Alice Kind:1234 ad:1 |   Owner   |
      +-----------+------------------------------+-----------+
      | 123abc03  | to_user:Owner Kind:4321 ad:1 |   Owner   |
      +-----------+------------------------------+-----------+
      | 123abc04  | to_user:Carol Kind:4321 ad:0 |   Owner   |
      +-----------+------------------------------+-----------+
      |    ...    |           ...                |    ...    |
      +-----------+------------------------------+-----------+
      | 456def01  | to_user:Bob   Kind:1234 ad:0 |   Alice   |
      +-----------+------------------------------+-----------+
      |    ...    |           ...                |    ...    |
      +-----------+------------------------------+-----------+

  Figure 1: Simplified Example of an Access Control List, Including
   Entries for Two Different Kind-IDs and Varying Delegation (AD)
                           Configurations

Implementors of ShaRe should be aware that the trust delegation in an Access Control List need not be loop free. Self-contained circular trust delegation from A to B and B to A are syntactically possible, even though not very meaningful. ๐Ÿ™ˆ

4.2. Data Structure

The Kind data structure for the Access Control List is defined as follows:

struct {
     /* res_name_ext is optional, see documentation */
     ResourceNameExtension  res_name_ext;
     opaque                 to_user<0..2^16-1>;
     KindId                 kind;
     Boolean                allow_delegation;
} AccessControlListItem;

The AccessControlListItem structure is composed of:

  • res_name_ext: This optional field contains the Resource Name of a ResourceNameExtension (see Section 5.2) to be used by a Shared Resource with a variable resource name. This name is used by the storing peer for validating, whether a variable resources name matches one of the predefined naming pattern from the configuration document for this Kind. The presence of this field is bound to a variable resource name element in the corresponding kind-block of the configuration document whose "enable" attribute is set to true (see Section 5.3). Otherwise, if the "enable" attribute is false, the res_name_ext field SHALL NOT be present in the Kind data structure. ๐Ÿ“
  • to_user: This field contains the username of the RELOAD peer that obtains write permission to the Shared Resource.
  • kind: This field contains the Kind-ID of the Shared Resource.
  • allow_delegation: If true, this Boolean flag indicates that the Authorized Peer in the 'to_user' field is allowed to add additional entries to the ACL for the specified Kind-ID.

5. Extension for Variable Resource Names โœจ

5.1. Overview

In certain use cases, such as conferencing, it is desirable to increase the flexibility of a peer in using Resource Names beyond those defined by the username or Node-ID fields in its certificate. For this purpose, this document presents the concept for variable Resources Names that enables providers of RELOAD instances to define relaxed naming schemes for overlay Resources. ๐ŸŽ€

Each RELOAD node uses a certificate to identify itself using its username (or Node-ID) while storing data under a specific Resource-ID (see Section 7.3 in [RFC6940]). The specifications in this document scheme adhere to this paradigm, but enable a RELOAD peer to store values of Resource Names that are derived from the username in its certificate. This is done by using a Resource Name with a variable substring that still matches the username in the certificate using a pattern defined in the overlay configuration document. Thus, despite being variable, an allowable Resource Name remains tied to the Owner's certificate. A sample pattern might be formed as follows:

Example Pattern:

.*-conf-$USER@$DOMAIN

When defining the pattern, care must be taken to avoid conflicts arising from two usernames of which one is a substring of the other. In such cases, the holder of the shorter name could threaten to block the resources of the longer-named peer by choosing the variable part of a Resource Name to contain the entire longer username. For example, a "*$USER" pattern would allow user EVE to define a resource with name "STEVE" and to block the resource name for user STEVE through this. This problem can easily be mitigated by delimiting the variable part of the pattern from the username part by some fixed string, that by convention is not part of a username (e.g., the "-conf-" in the above Example). ๐Ÿ˜ค

5.2. Data Structure

This section defines the optional ResourceNameExtension structure for every Kind that uses the USER-CHAIN-ACL access control policy.

enum { pattern(1), (255)} ResourceNameType;

struct {
  ResourceNameType type;
  uint16           length;

  select(type) {
      case pattern:
        opaque     resource_name<0..2^16-1>;

      /* Types can be extended */
  };
} ResourceNameExtension;

The content of the ResourceNameExtension consists of:

  • length: This field contains the length of the remaining data structure. It is only used to allow for further extensions to this data structure.

The content of the rest of the data structure depends of the ResourceNameType. Currently, the only defined type is "pattern".

If the type is "pattern", then the following data structure contains an opaque <0..2^16-1> field containing the Resource Name of the Kind being stored. The type "pattern" further indicates that the Resource Name MUST match to one of the variable resource name patterns defined for this Kind in the configuration document. ๐Ÿ’–

The ResourceNameType enum and the ResourceNameExtension structure can be extended by further Usages to define other naming schemes. ๐ŸŒˆ

5.3. Overlay Configuration Document Extension โœจ

okay so this section adds new elements to the overlay configuration document ๐ŸŽ€ for patterns that connect resource names to usernames. ngl the naming rules can change depending on the Usage ๐Ÿ’…. For example, Address of Record (AOR) syntax restrictions apply when you're using P2PSIP [RFC7904], but plain RELOAD can do more general naming ๐Ÿฆ‹

The <variable-resource-names> element is a container for one or more <pattern> sub-elements ๐Ÿ’–. It's an extra parameter inside the kind-block with a boolean "enable" attribute. If that's true, the overlay provider lets this Kind use variable resource names ๐ŸŒธ. The default for "enable" is "false". If a Kind uses the USER-CHAIN-ACL access policy (see Section 6.6) and there's no <variable-resource-names> element for it, implementors MUST assume that default ๐Ÿซถ

A <pattern> element MUST be present if the "enabled" attribute of its parent element is set to true ๐Ÿ“ Each <pattern> defines a pattern for building extended resource names for one Kind. It's an xsd:string that gets read as a regular expression, following "POSIX Extended Regular Expression" (see the specifications in [IEEE-Posix]) ๐Ÿงš In that regex, $USER and $DOMAIN stand in for the matching parts of the username field in the certificate, with $USER coming before the '@' and $DOMAIN coming after it. Both variables MUST be present in every pattern definition ๐Ÿ’œ The variable parts in <pattern> elements in the overlay configuration document MUST stay syntactically separated from the username part (for example, with a dedicated delimiter) so they don't collide with other users' names ๐Ÿ˜ญ If no pattern is defined for a Kind, if "enable" is false, or if the regular expression doesn't meet the requirements in this section, then the only allowable Resource Name is the username of the signer for the Shared Resource ๐Ÿ™ˆ

Here's the RELAX NG Grammar for the Variable Resource Names Extension, verbatim:

# VARIABLE RESOURCE URN SUB-NAMESPACE

namespace share = "urn:ietf:params:xml:ns:p2p:config-base:share"

# VARIABLE RESOURCE NAMES ELEMENT

kind-parameter &= element share:variable-resource-names {

    attribute enable { xsd:boolean },

    # PATTERN ELEMENT

    element share:pattern { xsd:string }*
}?

Whitespace and case processing follows the rules of [OASIS.relax_ng] and XML Schema Datatypes [W3C.REC-xmlschema-2-20041028] ๐ŸŒˆ


6. Access Control to Shared Resources ๐Ÿ”ฅ

6.1. Granting Write Access ๐Ÿ’Œ

okay so write access to a Kind that's meant to be shared with other RELOAD users can only be started by the Resource Owner ๐Ÿ‘‘ Here's how a Resource Owner shares RELOAD Kinds:

  • The Resource Owner stores an ACL root item at the Resource-ID of the Shared Resource. The root item holds the ResourceNameExtension field (see Section 5.2), the username of the Resource Owner, and the Kind-ID of the Shared Resource. The allow_delegation flag is set to 1. The index of array data structure MUST be generated as described in Section 3.1.
  • Further ACL items for this Kind-ID that the Resource Owner stores MAY delegate write access to Authorized Peers. These ACL items contain the same resource name extension field, the username of the Authorized Peer, and the Kind-ID of the Shared Resource. Optionally, the Resource Owner sets the "ad" to 1 (the default equals 0) so the Authorized Peer can delegate write access further ๐Ÿฆ‹ For each succeeding ACL item, the Resource Owner increments its individual index value by one (see Section 3.1), so the items can be stored in numerical order of the array index, starting with the index of the root item โœจ

An Authorized Peer with delegation allowance ("ad"=1) can extend access to an existing Shared Resource like this:

  • An Authorized Peer can store additional ACL items at the Resource-ID of the Shared Resource. These ACL items contain the resource name extension field, the username of the newly Authorized Peer, and the Kind-ID of the Shared Resource. Optionally, the "ad" flag is set to 1 so the newly Authorized Peer can delegate write access further ๐Ÿ’– The array index MUST be generated as described in Section 3.1. Each succeeding ACL item can be stored in numerical order of the array index ๐Ÿงš

A store request from an Authorized Peer that tries to overwrite any ACL item signed by another Peer is unauthorized and causes an Error_Forbidden response from the Storing Peer ๐Ÿšซ Access conflicts like this could be caused by an array index collision ๐Ÿ˜ญ Still, the chance of two or more identical array indices colliding is negligibly low when you use the mechanism for isolating stored data (see Section 3.1) ๐Ÿซถ

6.2. Revoking Write Access ๐Ÿฅ€

Write permissions get revoked by storing a nonexistent value (see [RFC6940], Section 7.2.1) at the matching item of the Access Control List ๐Ÿ’€ Revoking a permission automatically invalidates every delegation that user made, including all the subsequent delegations ๐ŸŒณ That means you can wipe out an entire subtree of the delegations tree with just one operation ๐Ÿ“ Overwriting the root item with a nonexistent value in an Access List invalidates the whole delegations tree at once ๐Ÿ”ฅ

An existing ACL item MUST only be overwritten by the user who first stored that entry, or by the Resource Owner, who is allowed to overwrite all ACL items to revoke write access ๐Ÿ‘‘

To protect the users' privacy, the Resource Owner SHOULD overwrite all the subtrees that have been invalidated ๐Ÿ™ˆ

6.3. Validating Write Access through an ACL ๐Ÿ”

ACLs are used to transparently check whether peers are authorized to write a data value at a Shared Resource ๐Ÿ’… The validating peer is assumed to have the complete and most recent ACL for that specific Resource/Kind pair. The procedure recursively walks the trust delegation tree, and strings are compared as binary objects ๐Ÿงš Here's how it goes:

  1. Get the username of the certificate used to sign the data stored at the Shared Resource. This is the user who requested the write operation ๐ŸŽ€
  2. Check that an item in the matching ACL (that is, for this Resource/Kind pair) has a "to_user" field whose value equals the username from step 1. If the Shared Resource being examined is an Access Control List Kind, also check whether the "ad" flag is set to 1 โœจ
  3. Select the username of the certificate that was used to sign the ACL item found in the previous step ๐Ÿฆ‹
  4. Check that an item in the matching ACL has a "to_user" field whose value equals the username from step 3. Also check that the "ad" flag is set to 1 ๐ŸŒธ
  5. Repeat steps 3 and 4 until the "to_user" value equals the username of the signer of the ACL in the selected item. This final ACL item is expected to be the root item of this ACL, and it MUST be further validated by checking that the root item was signed by the owner of the ACL Resource ๐Ÿ‘‘

The trust delegation chain is valid if and only if every verification step succeeds ๐ŸŒˆ When that happens, the creator of the data value at the Shared Resource is an Authorized Peer ๐Ÿ’–

Heads up: the ACL validation procedure can be skipped whenever the creator of the data at a Shared Resource is the Resource Owner itself ๐Ÿ™ˆ You can verify that using its public key certificate, as defined in Section 6.6 ๐Ÿ’œ

6.4. Operations of Storing Peers ๐Ÿ 

Storing peers are the ones where the Shared Resource and ACL are physically stored, so they're in charge of controlling storage attempts to a Shared Resource and its matching Access Control List ๐Ÿซถ To assert the USER-CHAIN-ACL access policy (see Section 6.6), a storing peer MUST run the access validation procedure described in Section 6.3 on every incoming store request, using the most recent Access Control List for each Kind that uses the USER-CHAIN-ACL policy ๐Ÿ”ฅ It SHALL also make sure that only the Resource Owner stores new ACL root items for Shared Resources ๐Ÿ‘‘

6.5. Operations of Accessing Peers ๐Ÿ“ฅ

Accessing peers are the ones that fetch a Shared Resource ๐Ÿฆ‹ They can check that whoever originated the Shared Resource was authorized to store data at that Resource-ID, by going through the matching ACL โœจ To run the access validation procedure from Section 6.3, an accessing peer first needs to grab the most recent Access Control List, like this:

  1. Send a Stat request to the Resource-ID of the Shared Resource to get all the array indexes of the stored ACL Kinds (as per [RFC6940], Section 7.4.3.) ๐Ÿงš
  2. Fetch all indexes of the existing ACL items at this Resource-ID, using the array ranges you got back in the Stat request answer ๐Ÿ’–

Peers can cache previously fetched Access Control Lists up to the maximum lifetime of an individual item ๐ŸŒธ Since stored values could've been changed or invalidated before they expire, an accessing peer SHOULD send a Stat request to check for updates before it uses the cached data ๐Ÿ˜ญ

6.6. USER-CHAIN-ACL Access Policy ๐ŸŒŸ

This document adds an extra access control policy to the RELOAD base document [RFC6940] ๐Ÿ’… The USER-CHAIN-ACL policy lets Authorized Peers write a Shared Resource even though they don't own the matching certificate ๐Ÿซถ It also lets Kinds with a variable resource name get stored, as long as they follow one of the specified naming patterns ๐Ÿฆ‹ So, when an inbound store request comes in for a Kind that uses the USER-CHAIN-ACL access policy, the following rules MUST be applied ๐Ÿ‘‘

A given value MUST NOT be written or overwritten under the USER-CHAIN-ACL policy if neither the USER-MATCH access policy nor the USER-NODE-MATCH access policy from the base document [RFC6940] applies. (USER-NODE-MATCH is mandatory if the data model is dictionary.) ๐Ÿ™…

The store request MUST be denied if the signer's certificate doesn't contain a username that matches the user and domain portion of one of the variable resource name patterns (cf. Section 5) in the configuration document. It must also be denied if the hashed Resource Name doesn't match the Resource-ID ๐Ÿ’€ The Resource Name of the Kind being stored MUST be taken from the mandatory ResourceNameExtension field in the corresponding Kind data structure ๐Ÿ“

If the access rights can't be verified with the ACL validation procedure from Section 6.3, the store request MUST also be denied ๐Ÿšซ

Otherwise, the store request can be processed further ๐ŸŽ€


7. ACCESS-CONTROL-LIST Kind Definition ๐ŸŽ€

okay this section defines the ACCESS-CONTROL-LIST Kind we talked about earlier in the document ๐ŸŒˆ

  • Name: ACCESS-CONTROL-LIST
  • Kind IDs: The Resource Name for the ACCESS-CONTROL-LIST Kind-ID is the Resource Name of the Kind that will be shared using the ACCESS-CONTROL-LIST Kind ๐Ÿ’–
  • Data Model: The data model for the ACCESS-CONTROL-LIST Kind-ID is array. The array indexes are formed using the mechanism for isolated stored data described in Section 3.1 โœจ
  • Access Control: USER-CHAIN-ACL (see Section 6.6) ๐Ÿ‘‘

8. Security Considerations ๐Ÿ”โœจ

okay bestie, this part is serious but still slay ๐Ÿ’…. We're talking about the security issues that pop up when you use Shared Resources in RELOAD [RFC6940]. ๐Ÿซถ

8.1. Resource Exhaustion ๐ŸŒธ

okay so joining a RELOAD overlay is already a lot ๐Ÿ˜ญ, because your peer has to store and forward data for other peers. In normal RELOAD vibes, each Resource-ID (and so each position in the overlay) can only be written by a limited set of peers, often just one, and that keeps the load lowkey manageable ๐Ÿ’…. With Shared Resources it's different. One resource can be written by multiple peers, and they might even write an arbitrary number of entries (like delegations in the ACL) ๐Ÿ‘€. So individual overlay nodes end up using way more resources ๐Ÿ’€.

The good news is that for Usages based on the ShaRe-Usage, you can cut this problem down by putting restrictions on size, i.e., a <max-size> element for a certain Kind in the configuration document โœจ. main character energy for your storage ๐Ÿงš

8.2. Malicious or Misbehaving Storing Peer ๐Ÿฆ‹

The RELOAD overlay is built to keep working even when a small group of misbehaving peers is around ๐Ÿ’ช. Shared Resources are no different. A small set of malicious peers won't break the overlay in general, but they can cause problems for peers that need to store or access info at the specific locations in the ID space they control ๐Ÿ˜ฌ.

A storing peer could hold back stored data, which is a denial of service for the group using that resource ๐Ÿ™ˆ. But it can't return forged data, because anyone can independently verify the validity of stored data using the attached signatures ๐Ÿ”.

8.3. Trust Delegation to a Malicious or Misbehaving Peer ๐Ÿšฉ

If a Resource Owner accidentally delegates write access to a Shared Resource to a misbehaving peer, that peer can mess with the group app in a bunch of unwanted ways ๐Ÿ˜ค. The destructive stuff can range from eating up shared storage to dedicated app-specific misuse. And a sketchy peer with delegation rights can also authorize more malicious collaborators to write to the Shared Resource ๐Ÿ™ƒ.

It is the obligation of the Resource Owner to tie trust delegation to apparent trustworthiness ๐Ÿซถ. Extra measures to monitor proper behavior may be applied. Either way, the Resource Owner can revoke the trust delegation of an entire tree in a single overwrite operation โœจ, and it also has the right to overwrite any contributions to the shared resource that are being misused ๐Ÿ‘‘.

8.4. Privacy Issues ๐Ÿ™ˆ

All data stored in the Shared Resource can be read by any node in the overlay, so apps that need privacy have to encrypt their data ๐Ÿ”. The ACL has to be stored unencrypted, which means the list members of a group using a Shared Resource will always be publicly visible ๐Ÿ‘€. no cap, that's a big deal to know about ๐Ÿ˜ญ.


9. IANA Considerations ๐Ÿ“‹

9.1. Access Control Policy ๐ŸŽ€

IANA has registered the following entry in the "RELOAD Access Control Policies" registry (cf. [RFC6940]) to represent the USER-CHAIN-ACL Access Control Policy, as described in Section 6.6 ๐Ÿ’–

                 +-------------------+----------+
                 | Access Policy     |      RFC |
                 +-------------------+----------+
                 | USER-CHAIN-ACL    | RFC 8076 |
                 +-------------------+----------+

9.2. Data Kind-ID ๐Ÿงš

IANA has registered the following code point in the "RELOAD Data Kind-ID" registry (cf. [RFC6940]) to represent the ShaRe ACCESS-CONTROL-LIST kind, as described in Section 7 ๐Ÿฆ‹

          +----------------------+------------+----------+
          | Kind                 |    Kind-ID |      RFC |
          +----------------------+------------+----------+
          | ACCESS-CONTROL-LIST  |        0x4 | RFC 8076 |
          +----------------------+------------+----------+

9.3. XML Namespace Registration ๐Ÿ’œ

This document registers the following URI for the config XML namespace in the IETF XML registry defined in [RFC3688] ๐Ÿ“š

URI:  urn:ietf:params:xml:ns:p2p:config-base:share

Registrant Contact:  The IESG

XML:  N/A, the requested URI is an XML namespace

10. References ๐Ÿ“š

10.1. Normative References ๐Ÿ’…

Here are the normative refs, verbatim so nothing gets lost ๐Ÿซถ

[IEEE-Posix]
           "IEEE Standard for Information Technology - Portable
           Operating System Interface (POSIX) - Part 2: Shell and
           Utilities (Vol.  1)", IEEE Std 1003.2-1992, ISBN
           1-55937-255-9, DOI 10.1109/IEEESTD.1993.6880751, January
           1993, <http://ieeexplore.ieee.org/document/6880751/>.

[OASIS.relax_ng]
           Clark, J. and M. Murata, "RELAX NG Specification",
           December 2001.

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

[RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
           DOI 10.17487/RFC3688, January 2004,
           <http://www.rfc-editor.org/info/rfc3688>.

[RFC6940]  Jennings, C., Lowekamp, B., Ed., Rescorla, E., Baset, S.,
           and H. Schulzrinne, "REsource LOcation And Discovery
           (RELOAD) Base Protocol", RFC 6940, DOI 10.17487/RFC6940,
           January 2014, <http://www.rfc-editor.org/info/rfc6940>.

[W3C.REC-xmlschema-2-20041028]
           Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes
           Second Edition", World Wide Web Consortium Recommendation
           REC-xmlschema-2-20041028, October 2004,
           <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028>.

10.2. Informative References โœจ

And the informative ones, also verbatim ๐Ÿงš

[RFC7890]  Bryan, D., Matthews, P., Shim, E., Willis, D., and S.
           Dawkins, "Concepts and Terminology for Peer-to-Peer SIP
           (P2PSIP)", RFC 7890, DOI 10.17487/RFC7890, June 2016,
           <http://www.rfc-editor.org/info/rfc7890>.

[RFC7904]  Jennings, C., Lowekamp, B., Rescorla, E., Baset, S.,
           Schulzrinne, H., and T. Schmidt, Ed., "A SIP Usage for
           REsource LOcation And Discovery (RELOAD)", RFC 7904,
           DOI 10.17487/RFC7904, October 2016,
           <http://www.rfc-editor.org/info/rfc7904>.

Acknowledgments ๐Ÿ’–

This work was stimulated by fruitful discussions in the P2PSIP working group and the SAM research group ๐ŸŒˆ. The authors want to thank all the active members for their constructive thoughts and feedback ๐Ÿซถ. In particular, the authors would like to thank (in alphabetical order) Emmanuel Baccelli, Ben Campbell, Alissa Cooper, Lothar Grimm, Russ Housley, Cullen Jennings, Matt Miller, Peter Musgrave, Joerg Ott, Marc Petit-Huguenin, Peter Pogrzeba, and Jan Seedorf ๐Ÿ‘‘. This work was partly funded by the German Federal Ministry of Education and Research, projects HAMcast, Mindstone, and SAFEST ๐ŸŽ€.

Authors' Addresses ๐Ÿงš

Alexander Knauf
HAW Hamburg
Berliner Tor 7
Hamburg  D-20099
Germany

Phone: +4940428758067
Email: alexanderknauf@gmail.com


Thomas C. Schmidt
HAW Hamburg
Berliner Tor 7
Hamburg  D-20099
Germany

Email: t.schmidt@haw-hamburg.de
URI:   http://inet.haw-hamburg.de/members/schmidt


Gabriel Hege
daviko GmbH
Schillerstr. 107
Berlin  D-10625
Germany

Phone: +493043004344
Email: hege@daviko.com


Matthias Waehlisch
link-lab & FU Berlin
Hoenower Str. 35
Berlin  D-10318
Germany

Email: mw@link-lab.net
URI:   http://www.inf.fu-berlin.de/~waehl
๐Ÿ“ฆ where this page comes from