Abstract: | This specification provides a way for XMPP entities to have a privileged access to some other entities data |
Author: | Jérôme Poisson |
Copyright: | © 1999 - 2014 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2015-01-27 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Requirements
3. Glossary
4. Accessing Roster
4.1. Server Allows Roster Access
4.2. Server Advertise Entity Of Allowed Permission
4.3. Privileged Entity Manage Roster
5. Message Permission
5.1. Authorizing Messages
5.2. Advertising Permission
5.3. Sending Messages
6. Presence Permission
6.1. Managed Entity Presence
6.2. Advertising Permission
6.3. Server Send presence informations
6.4. Roster Presence
6.5. Advertising Permission
6.6. Privileged Entity Receive Roster Presences
7. Security Considerations
8. IANA Considerations
9. XMPP Registrar Considerations
9.1. Protocol Namespaces
9.2. Protocol Versioning
10. XML Schema
11. Acknowledgements
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
XMPP components are used for long through Jabber Component Protocol (XEP-0114) [1], 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:
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 must be able to do what a PEP service can do and to access roster, so it must be able to (according to configuration):
The privilege mechanism MUST be totally transparent for the managed entities.
Roster access is granted in the server configuration. Roster access can have 4 types:
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
<message from='capulet.net' to='pubub.capulet.lit' id='12345'> <privilege xmlns='urn:xmpp:privilege:0'> <perm namespace='jabber:iq:roster' type='both'/> </privilege> </message>
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 RFC 6121 [2] 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:
<iq id='roster1' from='pubsub.capulet.lit' to='juliet@example.com' type='get' id='roster1'> <query xmlns='jabber:iq:roster'/> </iq>
The server then answers normally, as it would have done to the managed entity:
<iq id='roster1' from='juliet@example.com' to='pubsub.capulet.net' type='result'> <query xmlns='jabber:iq:roster' ver='ver7'> <item jid='nurse@example.com'/> <item jid='romeo@example.net'/> </query> </iq>
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:
A privileged entity can then send message on the behalf either of the server or of a bare JID of the server, using Message Forwarding (XEP-0297) [3], with the following restrictions:
If any of this rules is violated, the server MUST return a <not-authorized/> stream error and close the connection, as explained in RFC 6120 [4] section 4.9.3.12.
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':
<message from='capulet.net' to='pubub.capulet.lit' id='54321'> <privilege xmlns='urn:xmpp:privilege:0'> <perm namespace='jabber:iq:roster' type='both'/> <perm namespace='message' type='outgoing'/> </privilege> </message>
Now that pubsub.capulet.lit is allowed, it can send messages using <forwarded/> elements.
<message from='pubsub.capulet.lit' to='capulet.lit' id='notif1'> <forwarded xmlns='urn:xmpp:forward:0'> <message from='juliet@capulet.lit' id='foo' to='romeo@montague.lit/orchard' type='headline' xmlns='jabber:client'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='http://jabber.org/protocol/tune'> <item> <tune xmlns='http://jabber.org/protocol/tune'> <artist>Gerald Finzi</artist> <length>255</length> <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source> <title>Introduction (Allegro vigoroso)</title> <track>1</track> </tune> </item> </items> </event> <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> </message> </forwarded> </message>
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:
<message from='juliet@capulet.lit' id='bar' to='romeo@montague.lit/orchard' type='headline'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='http://jabber.org/protocol/tune'> <item> <tune xmlns='http://jabber.org/protocol/tune'> <artist>Gerald Finzi</artist> <length>255</length> <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source> <title>Introduction (Allegro vigoroso)</title> <track>1</track> </tune> </item> </items> </event> <delay xmlns='urn:xmpp:delay' stamp='2014-11-25T14:34:32Z'/> </message>
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:
If the privilege is granted, the server MUST use a directed presence, as specified in RFC 6121 [5] 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:
<presence from='juliet@capulet.lit/balcony' id='presence1' xml:lang='en'> <show>chat</show> <status>Staying on the balcony</status> </presence>
<presence from='juliet@capulet.lit/balcony' to='pubsub.capulet.lit' id='presence1' xml:lang='en'> <show>chat</show> <status>Staying on the balcony</status> </presence>
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"
<message from='capulet.net' to='pubub.capulet.lit' id='54321'> <privilege xmlns='urn:xmpp:privilege:0'> <perm namespace='jabber:iq:roster' type='both'/> <perm namespace='message'/> <perm namespace='presence' type='roster'/> </privilege> </message>
Note the presence of jabber:iq:roster permission request.
<presence from='romeo@montaigu.lit/orchard'/>
<presence from='romeo@montaigu.lit/orchard' to='juliet@capulet.lit'/> <presence from='romeo@montaigu.lit/orchard' to='pubsub.capulet.lit'/>
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [6].
The XMPP Registrar [7] includes 'urn:xmpp:privilege:0' in its registry of protocol namespaces (see <http://xmpp.org/registrar/namespaces.html>).
If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:privilege:0' xmlns='urn:xmpp:privilege:0' elementFormDefault='qualified'> <xs:element name='privilege'> <xs:complexType> <xs:element name='perm' maxOccurs='unbounded'> <xs:complexType> <xs:attribute name='namespace' use='required' type='xs:string'/> <xs:simpleType base='xs:NMTOKEN'> <xs:enumeration value='jabber:iq:roster'/> <xs:enumeration value='message'/> <xs:enumeration value='presence'/> </xs:simpleType> <xs:attribute name='type' use='required'> <xs:simpleType base='xs:NMTOKEN'> <xs:enumeration value='none'/> <xs:enumeration value='get'/> <xs:enumeration value='set'/> <xs:enumeration value='both'/> <xs:enumeration value='outgoing'/> <xs:enumeration value='managed_entity'/> <xs:enumeration value='roster'/> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:complexType> </xs:element> </xs:schema>
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.
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.
Series: XEP
Number: 0356
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2015-01-27
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
goffi@goffi.org
JabberID:
goffi@jabber.fr
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0114: Jabber Component Protocol <http://xmpp.org/extensions/xep-0114.html>.
2. RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc6121>.
3. XEP-0297: Message Forwarding <http://xmpp.org/extensions/xep-0297.html>.
4. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.
5. RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc6121>.
6. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
7. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial published version approved by the XMPP Council.
(XEP Editor (mam))First draft.
(jp)END