# HG changeset patch # User Goffi # Date 1418921306 -3600 # Node ID db9316a753060ad5b4b34ceddaf1fac9cb02c635 # Parent b70084aa0af71c60302eb363559bfea0a1dae1fc XEP: updated privileged entity according to discussions following the council's veto (see http://mail.jabber.org/pipermail/standards/2014-December/029378.html): - Big simplification and restriction following council's veto and standard@ discussions - Configuration is not done only on server own configuration - No more client mode - Permissions are adverised using - The only privilege still available is jabber:iq:roster diff -r b70084aa0af7 -r db9316a75306 xmpp/xep-proto-namespace-delegation.xml --- a/xmpp/xep-proto-namespace-delegation.xml Tue Nov 18 13:26:01 2014 +0100 +++ b/xmpp/xep-proto-namespace-delegation.xml Thu Dec 18 17:48:26 2014 +0100 @@ -35,6 +35,12 @@ goffi@jabber.fr + 0.0.2 + 2014-11-27 + jp +

+
+ 0.0.1 2014-11-13 jp @@ -72,12 +78,12 @@ -

Once the managing entity is authenticated and stream is started, the entity can request to manage a namespace. It does it by sending an &IQ; stanza with 'urn:xmpp:delegation:0' namespace. The &QUERY; element MUST have a type of value "request" and MAY have a 'delegation' attribute with the value "admin".

+

Once the managing entity is authenticated and stream is started, the entity can request to manage a namespace. It does it by sending an &IQ; stanza with 'urn:xmpp:delegation:0' namespace. The &QUERY; element MAY have a 'delegation' attribute with the value "admin".

Namespace delegations are asked with a <delegate/> element, which MUST contain a 'namespace' attribute set to the requested namespace.

Only <iq/> stanza namespaces can be delegated.

- + @@ -88,7 +94,7 @@

If the server accepts the delegation (e.g.: namespace mapping specified in configuration), it MUST return an &IQ; result stanza, with allowed delegations in <delegate> elements:

- + @@ -256,7 +262,6 @@ @@ -306,12 +311,10 @@
]]>

Here Juliet allows pubsub.montaigu.lit to manage the PubSub (and then PEP) service.

-

Finaly, the server notifies the entity of the granted delegation. For this it uses a &QUERY; element with the 'allowed' type, and puts the client JID in a 'from' attribute:

+

Finaly, the server notifies the entity of the granted delegation. For this it uses a &QUERY; element with the client JID in a 'from' attribute:

- + @@ -541,12 +544,6 @@ - - - - - - diff -r b70084aa0af7 -r db9316a75306 xmpp/xep-proto-privileged-component.xml --- a/xmpp/xep-proto-privileged-component.xml Tue Nov 18 13:26:01 2014 +0100 +++ b/xmpp/xep-proto-privileged-component.xml Thu Dec 18 17:48:26 2014 +0100 @@ -7,7 +7,7 @@
privileged entity - This specification provides a way for XMPP entities to have a privileged access to other entities data + This specification provides a way for XMPP entities to have a privileged access to some other entities data This XMPP Extension Protocol is copyright (c) 1999 - 2014 by the XMPP Standards Foundation (XSF). Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation. @@ -35,6 +35,19 @@ goffi@jabber.fr + 0.0.4 + 2014-12-18 + jp +
    +
  • Big simplification and restriction following council's veto and standard@ discussions
  • +
  • Configuration is not done only on server own configuration
  • +
  • No more client mode
  • +
  • Permissions are adverised using &MESSAGE;
  • +
  • The only &IQ; privilege still available is jabber:iq:roster
  • +
+
+
+ 0.0.3 2014-11-13 jp @@ -68,26 +81,26 @@
-

XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access an other entity data with the same privileges than the entity itself, that means send and receive &IQ; stanzas on its behalf (and in some cases, send &MESSAGE; or receive &PRESENCE; stanzas).

+

XMPP components are used for long through &xep0114;, but are quite limited: they have a restricted access to other entities data, similar to what a client can do. This is sufficient for components like gateways, but very limiting for more complex components like a PubSub service. The goal of this XEP is to allow a component or any entity to have a "privileged" status, and access some other entity data with the same privileges than the entity itself, that means manage an entity roster on its behalf, send &MESSAGE; or receive &PRESENCE; stanzas in the name of the server.

Privileged entities have numerous advantages, including:

  • 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
  • +
  • possibility to overpass a server limitation (typically: incomplete PEP 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

-

A privileged entity can be used in two modes:

+

A privileged entity must be able to do what a PEP service can do and to access roster, so it must be able to (according to configuration):

    -
  • admin mode, where it is installed by the server administrator.
  • -
  • client mode, where it can be installed by any user
  • +
  • get and modify the roster of any entity managed by the server
  • +
  • send a &MESSAGE; stanza on behalf of the server
  • +
  • access &PRESENCE; informations for entities in a managed entity's roster (and for managed entity itself)
-

In admin mode, the privileged entity MAY be able to emit &IQ; stanzas in the same way as any entity, including managing roster or accessing persistent storage. The privilege mechanism MUST be totally transparent for the managed entities.

-

In client mode, a privileged entity MUST have an explicit authorization for any &IQ; namespace he wants to use. Client SHOULD be able to check and revoke granted permissions, and if it's not possible, permissions MUST be revoked after a disconnection.

-

In addition, some special permissions can permit to send &MESSAGE; stanzas on behalf of the server or access &PRESENCE; informations.

+

The privilege mechanism MUST be totally transparent for the managed entities.

@@ -97,56 +110,35 @@ - + - - -

Once an entity is authenticated and stream is started, it can request a privileged status. It does it by sending an &IQ; stanza with 'urn:xmpp:privilege:0' namespace.

-

The &QUERY; element MUST have a "request" type and MAY have a 'privilege' attribute with the value "admin". Namespace permissions are asked with a <perm/> element, which MUST contain a 'namespace' attribute set to the requested namespace and a 'type' attribute which can be:

-
    -
  • get — the entity needs the privilege to send &IQ; stanzas of type 'get'
  • -
  • set — the entity needs the privilege to send &IQ; stanzas of type 'set'
  • -
  • both — the entity needs the privilege to send &IQ; stanzas of type 'get' and 'set'
  • -
- - - - - - - ]]> -
- -

If the server accepts the privileged status (e.g.: admin status specified in configuration), it MUST return an &IQ; result stanza with a &QUERY; element of type "allowed", and listing the allowed permissions in <perm/> elements:

- - - - - - -]]> -

Note: the granted permissions MAY be different from the requested ones, according to server's configuration.

-
- -

If the server rejects the privileged status, it MUST return a &forbidden; error:

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

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.
  • +
  • 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'.
  • +
- -

Sending an &IQ; stanza is done by sending the stanza the way it would be done by the managed entity, except that its JID is in the 'to' attribute. In the following example, the PubSub service want to know Juliet's roster because she owns a node with access model based on publiser's 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

+ + + + + + ]]> +

Here pubsub.capulet.lit is allowed to do get and set operations on all entities managed by capulet.lit

+
+ + +

Doing a get or set operation on the roster of a managed entity is done in the usual way (as described in &rfc6121; section 2), except that the 'to' attribute is set to the attribute of the managed entity. The server MUST check that the privileged entity has right to get or set the roster of managed entity, and MUST return a &forbidden; error if it is not the case:

+ @@ -167,176 +159,37 @@ ]]> -

In the following example, the sync.capulet.net privileged entity want to access managed entity's bookmarks to synchronize them with an online service. It can request the bookmarks in the following way:

- - - - - - ]]> -

and server answers:

- - - - - - - - JC - - - - - - - ]]>
- - -

In client mode, the privileged entity is not certified by the server administrator, so the permissions MUST be explicitly allowed by the managed entity. This is initiated by the privileged entity (it can be after an interaction with a managed entity, like a subscription). It's done in the same way as for admin mode with the following exceptions:

-
    -
  1. the privilege type is client instead of admin
  2. -
  3. the privilege is given per entity, so the managed entity MUST be specified in a 'to' attribute
  4. -
-

If an entity want a read/write access to a client's roster (Juliet) and a read only access to her pubsub, it can ask the permission like this: -

- - - - - - -]]> -

Once received the permission request, the server asks the client to grant or deny the requested permission using &xep0004;. The form SHOULD allow to fine tune the granted permissions. The server uses a challenge which it MUST have generated himself. -

- - - priv.montaigu.net wants some privileges. - Do you you allow him to use the following features? - - Be careful! According permissions to an entity is a serious thing, - think twice that you can trust the entity before doing this. - - - Privileges request - priv.montaigu.net wants to use the following features: - Do you allow it? - 5439123 - - urn:xmpp:privilege:0 - - - 0 - - - - - - - 0 - - - - - -]]> -

The server SHOULD include a warning message, SHOULD translate the namespace to human friendly names (and MAY keep the original namespace in addition) and MUST set the default value to "none" (permission refused). The server SHOULD use namespace as field var, so a client can use it to have a customized display.

-

The client can then answer to the form:

- - - - - - 5439123 - both - none - - -]]> -

Here Juliet allows priv.montaigu.net to use 'set' and 'get' in order to manage her roster, but doesn't want it to do any 'get' on her pubsub nodes.

-

Finaly, the server notify the entity of the granted permissions. For this it uses a &QUERY; element with the 'allowed' type, and puts the client JID in a 'from' attribute:

- - - - - - -]]> -

The privileged entity can now act according to permission granted to him.

-
- -

Sending &IQ; stanzas is done in the exact same way as for admin mode. If an entity wants to sent a non authorized &IQ;, it will get a &forbidden; error:

- - - - - -]]> - - - - - - - ]]> -
-
- - -

In some cases, an entity may need extra permission beyond what &IQ; stanzas can do. An entity may want to send &MESSAGE; stanzas on behalf of the server, or get &PRESENCE; informations. The special permissions manage these cases with some restrictions.

- - -

With some namespaces it can be desirable to send notifications (e.g. PEP service), so the privileged entity must be able to send &MESSAGE; stanzas. To do this, it MUST request it by using a <perm/> element with the special "message" namespace attribute and a 'type' attribute with the value "outgoing" (any other type MUST be rejected with a &forbidden; error).

+ + +

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.
  • +
  • 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:

  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
  3. -
  4. in client mode, the forwarded &MESSAGE; 'from' attribute can only be one of a managed entity which has explicitly accepted the delegation

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.

-

In the following example, pubsub.capulet.lit asks for pubsub and outgoing messages permission

- - +
+ + +

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':

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

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

@@ -387,28 +240,26 @@ ]]>
+ - -

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

-

To do this, the privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute and a 'type' attribute with the value "managed_entity".

If the delegation 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.

This privilege MUST NOT be requested in client mode, if so the server MUST reject the request by setting the allowed type to "none". If an entity needs presence information in client mode, it SHOULD request it using the normal &PRESENCE; subscription mechanism.

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

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.
  • +
  • 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.

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

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"

+
+ +

Once the "presence" permission is granted, the server send presence informations:

Staying on the balcony ]]> + Staying on the balcony ]]> +
- -

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).

-

In this case, privileged entity MUST ask for presence information when requesting privileges, using a special "presence" namespace attribute (as in previous section) and a 'type' attribute with the value "roster". Furthermore, 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 managing entity is receiving.

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). If allowed in client mode, server SHOULD display an extra warning when requesting permissions to the managed entity.

- - + +

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.

+

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"

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

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

+
- - - - - - - -]]> - + ]]> @@ -466,55 +315,10 @@
- -

Server SHOULD provide a way for clients to check already granted permission, and revoke them by using &xep0050; on the well-defined command node 'urn:xmpp:privilege:0#configure'.

-

If present, the configuration commands MUST allow at least to check permissions granted to a privileged entity, and to revoke them. A server MAY offer an option to keep permission from one session to an other (see business rules).

-
- - -

If a server or an entity supports the privileged entity protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:privilege:0" in response to a &xep0030; information request:

- - - - ]]> - - - ... - - ... - - - ]]> -
- - -
    -
  1. In client mode, server MAY keep permission granted to an entity by a client from one session to an other, but if it do so, it MUST provide configuration like explained in the suitable section. If server offers this feature, it SHOULD add a field directly in configuration commands.
  2. -
  3. If a client can't check or revoke permission (i.e. it doesn't support &xep0050;) when granting permissions, the server MUST NOT keep granted permissions from one session to an other, and permissions will be asked on each new session.
  4. -
  5. If permissions are changed during a session, server MUST notify privileged entity of the new permissions, like in permission request use case.
  6. -
  7. A server MUST NOT grant permission for this XEP namespace ('urn:xmpp:privilege:0').
  8. -
-
- - -

As admin mode is far more easy to implement than client mode, a server MAY choose to only implement the former.

-
-
    -
  1. Privileged entity nearly have the same possibility as the server itself, admin permission should be granted carefuly, only if you absolutely trust the entity.
  2. -
  3. A server MAY choose to filter allowed namespaces, to avoid giving dangerous permissions. In this case, it MUST always set the allowed type of filtered namespaces to "none"
  4. -
  5. Roster presence is particulary sensitive, because if an entity accept this permission, it shares presence information of its whole roster. For this reason, a server MAY choose to forbid its use in client mode (by always setting the allowed type to "none"). A server SHOULD at least disallow it in default configuration.
  6. - -
  7. In case of filtering, a whitelist system is more secure and SHOULD be prefered to a blacklist (idealy, configuration would allow no filtering, whitelist filtering and blacklist filtering).
  8. +
  9. 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.
  10. +
  11. Roster presence is particulary sensitive, because presence informations of whole rosters are shared.
@@ -544,38 +348,32 @@ xmlns='urn:xmpp:privilege:0' elementFormDefault='qualified'> - + - - - - - - - - - - - - - - + + + + + + + + - + ]]> @@ -583,7 +381,8 @@

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.

-

The client mode permission mechanism is inspired from &xep0321; permission request.

+

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.

+