# HG changeset patch # User Goffi # Date 1427132461 -3600 # Node ID 4c5bd7ddaaca617ca5602d12cc53b8a05611b83a # Parent bbb900a768eae3075f9ee9b76a6728ec7e2ab9ee xep: updated XEP-0356 (privileged entity): Several updates according to feedbacks + review: - added links to PEP and namespace delegation XEPs - removed MUST for default values in configuration - element is now a child of a element - "namespace" attribute has been renamed to "access" - "headline" type restriction for "message" privilege has been removed - "message" permission violation now result in a "forbidden" message error - for "presence" permission, only stanza with no type or with a "unavailable" type are sent to privileged entity - added specifitation for "presence" if a managed entity is unavailable and if a privileged entity is available after first stanzas have been received - added Business Rules section - Updated namespace to reflect incompatible changes diff -r bbb900a768ea -r 4c5bd7ddaaca xmpp/xep-0356.xml --- a/xmpp/xep-0356.xml Sat Mar 21 20:07:46 2015 +0100 +++ b/xmpp/xep-0356.xml Mon Mar 23 18:41:01 2015 +0100 @@ -27,6 +27,26 @@ goffi@jabber.fr + 0.2 + 2015-03-23 + jp + +

Several updates according to feedbacks + review:

+
    +
  • added links to PEP and namespace delegation XEPs
  • +
  • removed MUST for default values in configuration
  • +
  • <forwarded/> element is now a child of a <privilege/> element
  • +
  • <perm/> "namespace" attribute has been renamed to "access"
  • +
  • "headline" type restriction for "message" privilege has been removed
  • +
  • "message" permission violation now result in a "forbidden" message error
  • +
  • for "presence" permission, only &PRESENCE; stanza with no type or with a "unavailable" type are sent to privileged entity
  • +
  • added specifitation for "presence" if a managed entity is unavailable and if a privileged entity is available after first &PRESENCE; stanzas have been received
  • +
  • added Business Rules section
  • +
  • Updated namespace to reflect incompatible changes
  • +
+
+
+ 0.1 2015-01-27 XEP Editor (mam) @@ -84,11 +104,12 @@
  • a step forward in decentralization: it is possible for an entity to do tasks which were before reserved to server itself. For example, a privileged pubsub component can offer access model based on publisher's roster
  • better integration of components: a gateway can add items to an entity roster itself
  • -
  • possibility to overpass a server limitation (typically: incomplete PEP implementation)
  • +
  • possibility to overpass a server limitation (typically: incomplete &xep0163; implementation)
  • quick development cycle: developers can implement the components they need without waiting for a new server release
  • server agnostic
-

Privileged entity has been created with the main goal to create an external, server agnostic, PEP service. It is restricted to only a couple of features, see Acknowledgements section for more details

+

Privileged entity has been created with the main goal to create an external, server agnostic, PEP service. It is restricted to only a couple of features, see Acknowledgements section for more details.

+

This XEP is complementary to &xep0355; (and works in a similar way), although they can be used together or separately. To build something like an external PEP service, it is necessary to use both XEPs.

@@ -113,19 +134,19 @@

Roster access is granted in the server configuration. Roster access can have 4 types:

    -
  • none — the entity is not allowed to access managed entity roster at all. This MUST be the default value.
  • +
  • none — the entity is not allowed to access managed entity roster at all. This is usually the default value.
  • get — the entity is allowed to send &IQ; stanzas of type 'get' for the namespace 'jabber:iq:roster'.
  • set — the entity is allowed to send &IQ; stanzas of type 'set' for namespace 'jabber:iq:roster'.
  • both — the entity is allowed to send &IQ; stanzas of type 'get' and 'set' for namespace 'jabber:iq:roster'.
- -

Once an entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <privilege> elements which MUST have the namespace 'urn:xmpp:privilege:0'. This element contains <perm> elements which MUST contain a 'namespace' attribute of the value "jabber:iq:roster" and a 'type' attribute which must correspond to the type configured as specified in "Server Allows Roster Access" section

- +

Once a privileged entity is authenticated and stream is started, the server send it a &MESSAGE; stanza with a <privilege/> elements which MUST have the namespace 'urn:xmpp:privilege:1'. This element contains <perm/> elements which MUST contain a 'access' attribute of the value "roster" and a 'type' attribute which must correspond to the type configured as specified in "Server Allows Roster Access" section

+ - - + + ]]> @@ -164,24 +185,23 @@

In some cases, it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. This is allowed in server configuration in the same way as for roster permission. The permission type can have the following values:

    -
  • none — the entity is not allowed to send &MESSAGE; stanza in the name of the server. This MUST be the default value.
  • +
  • none — the entity is not allowed to send &MESSAGE; stanza in the name of the server. This is usually the default value.
  • outgoing — the entity is allowed to send &MESSAGE; stanzas in the name of the server, according to following restrictions.
-

A privileged entity can then send message on the behalf either of the server or of a bare JID of the server, using &xep0297;, with the following restrictions:

+

A privileged entity can then send message on the behalf either of the server or of a bare JID of an entity managed by the server (i.e. a bare jid with the same domain as the server), using &xep0297;. The <forwarded/> element MUST be a child of a <privilege/> element with a namespace of 'urn:xmpp:privilege:1', with the following restriction:

    -
  1. forwarded &MESSAGE; 'type' attribute has the value of "headline"
  2. forwarded &MESSAGE; 'from' attribute MUST be a bare JID from the server, no resource is allowed
-

If any of this rules is violated, the server MUST return a <not-authorized/> stream error and close the connection, as explained in &rfc6120; section 4.9.3.12.

+

If this rule is violated, the server MUST return a &MESSAGE; error with condition <forbidden/>, as in &rfc6120; section 8.3.3.4.

-

Server advertise "message" permission in the same way as for "roster" permission, except that 'namespace' attribute has the value of "message", and the 'type' attribute as a value of 'outgoing':

- Server advertises "message" permission in the same way as for "roster" permission, except that 'access' attribute has the value of "message", and the 'type' attribute as a value of 'outgoing':

+ - - - + + + ]]> @@ -191,36 +211,36 @@

Now that pubsub.capulet.lit is allowed, it can send messages using <forwarded/> elements.

- - - - - - - Gerald Finzi - 255 - Music for "Love's Labors Lost" (Suite for small orchestra) - Introduction (Allegro vigoroso) - 1 - - - - - - - + + + + + + + + Gerald Finzi + 255 + Music for "Love's Labors Lost" (Suite for small orchestra) + Introduction (Allegro vigoroso) + 1 + + + + + + + + ]]> -

The server sees that forwarded message type is 'headline', that juliet@capulet.lit is a bare JID of the server, and that outgoing message permission was granted in admin mode (so all bare JIDs from server are allowed); it can now send the notification:

+

The server sees that forwarded message 'from' attribute (juliet@capulet.lit) is a bare JID of the server, and that outgoing message permission was granted; it can now send the notification:

+ to='romeo@montague.lit/orchard'> @@ -245,15 +265,16 @@

It can be often desirable for a privileged entity to have presence information of the managed entities (e.g. to know when to send them notificiations). As privileges must be transparent for the managed entity, this presence has to be sent by the server without modifying managed entity roster.

This is allowed in server configuration in the same way as for roster and message permissions. The "presence" type can have the following values:

    -
  • none — the entity is not allowed to access &PRESENCE; informations at all. This MUST be the default value.
  • +
  • none — the entity is not allowed to access &PRESENCE; informations at all. This is usually the default value.
  • managed_entity — the entity is allowed to receive managed entity presence (see below).
  • roster — the entity is allowed to receive presence informations of managed entity contacts, see Roster Presence section.
-

If the privilege is granted, the server MUST use a directed presence, as specified in &rfc6121; section 4.6 on the behalf of managed entity each time its presence information change.

+

If the privilege is granted, the server MUST use a directed presence from the full jid of the managed entity, to the privileged entity, as specified in &rfc6121; section 4.6, on the behalf of managed entity each time its presence information change.

+

Only presences with no 'type' attribute or with a 'type' attribute with the value "unavailable" are transmitted to the privileged entity, the server MUST NOT transmit &PRESENCE; stanza of any other type.

-

Server advertise "presence" permission in the same way as for "roster" or "message" permissions, except that 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "managed_entity"

+

Server advertises "presence" permission in the same way as for "roster" or "message" permissions, except that 'access' attribute has the value of "presence", and the 'type' attribute has a value of "managed_entity"

@@ -281,23 +302,25 @@

In addition to "managed entity presence", a privileged entity may need to know when a contact in managed entity roster is online (for example, it's necessary for a PEP service because of the presence default access model).

-

As for other permissions, the access in granted in server's configuration, but there is a additional restriction: the privileged entity MUST have read permission on roster namespace (i.e. 'type' attribute in allowed <perm> of namespace jabber:iq:roster MUST have a value of either get or both).

-

If the delegation is granted, the server MUST send to the privileged entity every presence information that the privileged entity is receiving. Having "roster" type for "presence" permission imply that you have also implicitly "managed_entity" type.

The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.

+

As for other permissions, the access is granted in server's configuration, but there is an additional restriction: the privileged entity MUST have read permission on roster namespace (i.e. 'type' attribute in allowed <perm> of access roster MUST have a value of either get or both).

+

If the privilege is granted, the server MUST send to the privileged entity every presence information with no 'type' attribute or with a 'type' with a value of 'unavailable' that the privileged entity is receiving or would receive if it were available. It do it in the same way as for managing entity by using directed &PRESENCE; from the full jid of the entity from which presence information has changed, to the privileged entity. If the managed entity is unavailable but the privileged entity is available, the server MUST send &PRESENCE; stanza to the later anyway.

+

Having "roster" type for "presence" permission imply that you have also implicitly "managed_entity" type.

The server MUST reject the permission if the privileged entity doesn't have read permission on roster namespace.

+

Note: this permission should be given carefully, as it gives access to presence of potentially a lot of entities to the privileged entity (see security considerations).

-

Server advertise roster "presence" permission in the same way as for other permissions, except that the 'namespace' attribute has the value of "presence", and the 'type' attribute has a value of "roster"

- Server advertises roster "presence" permission in the same way as for other permissions, except that the 'access' attribute has the value of "presence", and the 'type' attribute has a value of "roster"

+ - - - - + + + + ]]> -

Note the presence of jabber:iq:roster permission request.

+

Note the presence of roster permission request.

@@ -313,10 +336,18 @@
+ +
    +
  1. For "presence" access, if a privileged entity is connected after first &PRESENCE; stanzas have been received, the server MUST send it all the &PRESENCE; stanzas with no 'type' attribute it would have had if it was connected first (in other words: all the presences informations for connected entities it has access to).
  2. +
  3. For "presence" access, if a privileged entity is supposed to received several time the same &PRESENCE; stanza, the server SHOULD send it only once. For example: if pubsub.capulet.lit has a "presence" access with a "roster" type for capulet.lit, and juliet@capulet.lit and nurse@capulet.it both have romeo@montague.lit in their roster. When romeo is available, pubsub.capulet.lit shoud have its &PRESENCE; stanza only once (instead of 2 times).
  4. +
+
+
  1. Privileged entitiy has access to sensitive data, and can act as the server itself, permissions should be granted carefuly, only if you absolutely trust the entity.
  2. Roster presence is particulary sensitive, because presence informations of whole rosters are shared.
  3. +
  4. Generaly, the server MUST NOT allow the privileged entity to do anything that the managed entity could not do.
@@ -326,9 +357,9 @@ -

The ®ISTRAR; includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see &NAMESPACES;).

+

The ®ISTRAR; includes 'urn:xmpp:privilege:1' in its registry of protocol namespaces (see &NAMESPACES;).

    -
  • urn:xmpp:privilege:0
  • +
  • urn:xmpp:privilege:1
@@ -342,8 +373,8 @@ @@ -351,9 +382,9 @@ - + - + @@ -378,7 +409,7 @@
-

Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout and Johannes Hund for their feedbacks. Thanks to Adrien Cossa for his typos/style corrections.

+

Thanks to Sergey Dobrov, Dave Cridland, Steven Lloyd Watkin, Lance Stout, Johannes Hund, Kurt Zeilenga and Kevin Smith for their feedbacks. Thanks to Adrien Cossa for his typos/style corrections.

Privileged entity was initialy written to be a generic identity based access control (IBAC) which allows an entity to access sensitive data. After a discussion on standard mailing list, it has been decided to restrict the current XEP to immediate needs to build an external PEP service, and to implement separately an Attribute Based Access Control (ABAC) which is more modern, generic and flexible. This XEP is still interesting for being easy to implement and doing the job.