Re: [Ace] Review for draft-palombini-ace-coap-pubsub-profile

Francesca Palombini <francesca.palombini@ericsson.com> Fri, 13 December 2019 15:10 UTC

Return-Path: <francesca.palombini@ericsson.com>
X-Original-To: ace@ietfa.amsl.com
Delivered-To: ace@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9CF87120219 for <ace@ietfa.amsl.com>; Fri, 13 Dec 2019 07:10:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XmyiHWZ05uw8 for <ace@ietfa.amsl.com>; Fri, 13 Dec 2019 07:10:20 -0800 (PST)
Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150073.outbound.protection.outlook.com [40.107.15.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1919D120180 for <ace@ietf.org>; Fri, 13 Dec 2019 07:10:20 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E9ExbBfAI+qJVP4AF3fGOl+HOjTI6sEgVObiQYn7se+N9KNFoo9nDuZRK1O5we+IEFFKew/UVINZAXuuVx99iGsiDDRx8fKBo2faXMkOa1by+PdKH6+t9zg6C+Vq0K3jnk/g8UiyHDoBzicZtNFR1Cz6b1e43qrT96CHaleKXmtcf5p8sEnmjH4h9iRwj7Te2H+RGCCk3YR3DCcLxrENmazh2J8cBITjart/WUePba9Im40qCU7OMdTqpPTtcCBokGHg9wzyKGnmgB2inC6rReRK0XgT8TunpcGAaYil/2E4edZoXRmL3p7jaZLjk5MfscnRvZZtzKK6g8Y6EETEng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5mTO3BDbm3hrWto1CCq/QzCq4sYux9d9j+adOx82hdY=; b=MNmWq4nPrGQDGE1HkUw04VYpxcMp+JKmcZJBlBi55yjKs5UH5UuTJf/sovD3HwR1VrG03uvdwZW8nTdHzXsX1alawz40D9YdFh57WJ5LJRUFr60CBNAYT15+RxMi/Z+4rkZW1xm2CV4UTY+1N71KDoXQoRVpwAlq17eN6y976S1vTxuuqGElQs7uSyuQSWEHT9PcEaG6YAWraWcK+esWkT/TMvlhBgsMjs55EKkm/oWTKA/UJmbZHVH0CaMGFO4HlA4YeXiyEgQyf7a1V4K2VTIP8qoQXCc0I0saO0DBms6hK9bYW+0eEA+OIzbQQYxK6YqkqMPlh47AgvySBX78hw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5mTO3BDbm3hrWto1CCq/QzCq4sYux9d9j+adOx82hdY=; b=XaGWz5rz0IMfuNqwsn6W/ItR8skp+ojLyWAYpqYsATspp56kjw01SQMXbeOaq2OQumh0HU2WBWgK/D+ehsc/u/ughTtsgYvYL/UM4+K2pHymYYNAkMAH0VhKKhbfiNWLW/+FMS8i1aBAfPwYpXxnvokHa2kMgTHGLTBZwzFKQHs=
Received: from AM6PR07MB4053.eurprd07.prod.outlook.com (52.134.117.139) by AM6PR07MB6055.eurprd07.prod.outlook.com (20.178.93.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.4; Fri, 13 Dec 2019 15:10:17 +0000
Received: from AM6PR07MB4053.eurprd07.prod.outlook.com ([fe80::8514:c0f:390b:277]) by AM6PR07MB4053.eurprd07.prod.outlook.com ([fe80::8514:c0f:390b:277%6]) with mapi id 15.20.2538.017; Fri, 13 Dec 2019 15:10:17 +0000
From: Francesca Palombini <francesca.palombini@ericsson.com>
To: Cigdem Sengul <cigdem.sengul@gmail.com>, Ace Wg <ace@ietf.org>
Thread-Topic: [Ace] Review for draft-palombini-ace-coap-pubsub-profile
Thread-Index: AQHVps/FUW0hoZUPcUeZ6nwhguB0oae4Uf0A
Date: Fri, 13 Dec 2019 15:10:16 +0000
Message-ID: <75220EAA-9455-4691-9E99-3E16401D1309@ericsson.com>
References: <CAA7SwCMhdOctrzQqGAUz4-z7SvKfKZLErAJT88eSDwCMedg-rg@mail.gmail.com>
In-Reply-To: <CAA7SwCMhdOctrzQqGAUz4-z7SvKfKZLErAJT88eSDwCMedg-rg@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=francesca.palombini@ericsson.com;
x-originating-ip: [158.174.219.143]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 6262f95f-8bc9-4458-3dda-08d77fde901f
x-ms-traffictypediagnostic: AM6PR07MB6055:
x-microsoft-antispam-prvs: <AM6PR07MB60555C35A48CC291E384F20F98540@AM6PR07MB6055.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0250B840C1
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(136003)(376002)(396003)(346002)(39860400002)(189003)(199004)(52314003)(86362001)(6486002)(53546011)(186003)(33656002)(26005)(44832011)(6506007)(36756003)(2616005)(5660300002)(6512007)(110136005)(2906002)(316002)(8676002)(81156014)(76116006)(91956017)(66556008)(66946007)(66476007)(30864003)(478600001)(9326002)(8936002)(64756008)(66446008)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR07MB6055; H:AM6PR07MB4053.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: hI+wTtXmLpt8/VLMPOde6jyh1YDuNhGAxiZJ49JktEVBDz2qvvNrPos3Cc1xW7fcqrNWyIGpeo6JlhDyWLaa8p44LpUIawH16vcPnc42qPooCa0gNAe0e5ZRnQR4HW64TkAyoYdKtBsS1nYGB3gRpyhwyKNqmKegBcRFUsA/VNzN8Mb0ml9EI6J/OGZeFSQ5lfb4qKEz4ADn/Hmj2pWIgDls5l8sNI7a1JZsMERH4+lcsHP0wC/EqzrAo8bjQyKfmLlJqJpijxHoDO6/TiYZbNSWrDw1JKxVKRAAuA0BTj0IQ0Udt/vik0x+QfGwDqvV3i5bSYfuQc6YuovNh3OP5u/vw20Fk4vk3EaTTOY2t+p/+rfysN4MD1YQStmBz4KO4oqsbzthL/+XQ1qk0DV2dk2TJREr8xhM2tA2iNOY3s0J3aprOcjGa6xr+v3W5taX+gW/nVpvMXquzLVZAxs+lwef0zbvl03ZMnE605Y0OJM0XpzBLgF/Vf8pNO7TM0ob
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_75220EAA945546919E993E16401D1309ericssoncom_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6262f95f-8bc9-4458-3dda-08d77fde901f
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2019 15:10:17.2928 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 6NphDqGHGv3e5vCqxcMBlM/XJIhHkPkDtXJmkEgQ+5G6U4XQZi5CUI3MSNBOA6XLTteujdi6ETbkTMDuDS5MQbnbuGizBXIgZk5yz548t5cZII2+srRdXUAjV2aRXKB5
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR07MB6055
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/olzPgTsDwYGtm6dCCCjg2_rufuI>
Subject: Re: [Ace] Review for draft-palombini-ace-coap-pubsub-profile
X-BeenThere: ace@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Authentication and Authorization for Constrained Environments \(ace\)" <ace.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ace>, <mailto:ace-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ace/>
List-Post: <mailto:ace@ietf.org>
List-Help: <mailto:ace-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ace>, <mailto:ace-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Dec 2019 15:10:23 -0000

Hi Cigdem,

Thanks a lot for your review and your support of this document! Your points are very valid, and of course you are right with noticing that a revision is needed to adapt the text to make it work for MQTT. I appreciate your comments about topics hierarchy as well, that is something we did not think about before and definitely need some discussion.

Detailed answers inline.

Francesca

From: Ace <ace-bounces@ietf.org> on behalf of Cigdem Sengul <cigdem.sengul@gmail.com>
Date: Friday, 29 November 2019 at 17:12
To: Ace Wg <ace@ietf.org>
Subject: [Ace] Review for draft-palombini-ace-coap-pubsub-profile

Hello,

As I remotely promised in the WG meeting in Singapore, here is my review of the pubsub-coap document.

When reviewing the document, I have kept two things in mind: how the document reads now, and whether it can easily be extended to include MQTT as well.  I’ve understood including MQTT is in scope for this document in the workgroup meeting in Singapore. I would be happy to help, if you need me to, for MQTT-specific contributions to this draft.  Doing this would allow the mqtt_tls profile to progress independently of this document by stating that content protection is out of scope for mqtt_tls profile and referring to this document for a solution.

I want to repeat my support for the adoption of this profile, as it addresses a significant problem for publishers to constrain the content of their publications to only their subscribers. It does handle the multiple publishers to a single topic case well (allowing subscribers to learn about all the publishers to a specific topic).

In the following, I list a few things reading the draft made me think, especially in its applicability to MQTT:
(1) What is planned to make this document a generic pubsub solution? Will there a generic architecture section, and specific descriptions for each of the protocols?

FP: Yes, I am planning to make some updates to the text to make this generic. In general, I think the structure of the draft will be the same, but each section would either have a sentence or (if longer text is needed) a subsection talking about the different alternatives. For example, Section 2 would remove current specific text about CoAP pubsub (only talk about general pubsub) and would replace that text with an additional paragraph mentioning that the pubsub protocol can be CoAP or MQTT. Section 3 would have 2 subsections, coap_pubsub_app and mqtt_pubsub_app, etc.

For instance, if an MQTT client implements this,  the client would talk to AS1 to get a token based on the way we describe in the mqtt-tls profile, and then get keying material for topics from AS2.
I expect the MQTT client would use a different profile name like mqtt_tls_app to signal to AS1 that it is supporting the application layer security. This is because the draft hints that there should be a policy agreement between AS1 and AS2: “Note that AS1 and AS2 might either be co-resident or be 2 separate physical entities, in which case access control policies must be exchanged between AS1 and AS2, so that they agree on rights fo  joining nodes about specific topics.”

FP: That is all correct. Moreover, we can also discuss details such as what communication protocol the Client uses to talk to AS2. Right now ace-key-groupcomm is only defined for CoAP, but if MQTT prefers to use HTTP, that is very easy to define.


(2) If we keep AS1 as the mqtt-tls profile AS, then for consistency sake, the MQTT client would expect to talk to HTTPS to AS2, but the coap-pubsub draft describes these, expectedly, in CoAP. Will there be support for HTTPS?

FP: I promise I did not read this question before answering the text above :) Yes. This is really easy to specify, we already do this with CBOR/JSON, in ace-key-groupcomm:

The ACE framework is based
   on CBOR [RFC7049], so CBOR is the format used in this specification.
   However, using JSON [RFC8259] instead of CBOR is possible, using the
   conversion method specified in Sections 4.1 and 4.2 of [RFC7049].

We would add CoAP/HTTP in the same way ("CoAP is default, but HTTP works the same way"). Then the pubsub-profile could specify which protocol is used in the different profiles.

(3) In the mqtt_tls profile, the AS grants tokens that identify both “publish” and “subscribe” rights and the topics by adding scopes in the format, e.g. “publish_topic1” “subscribe_topic2/#”..  This format allows representing all publish/subscribe permissions concisely for the client which may be acting both as a publisher and a subscriber.
In the coap-pubsub, this is separated between AS1 and AS2. “AS1 hosts the policies about the Broker: what endpoints are allowed to Publish on the Broker.” “The AS2 hosts the policies about the topic: what endpoints are allowed to access what topic. “
The coap-pubsub also permits that AS1 can host policies about what endpoints are allowed to Subscribe to the Broker.

However, wouldn’t this separation between AS1 and AS2 have the following issue: Publisher P, having the permission to publish to topic1 and hence, successfully getting an access token from AS1, then goes ahead and sends a PUBLISH on topic 2, which it doesn’t have a right to publish.
Wouldn't the broker would pass this message to subscribers, and the subscribers would discard the message because the publisher does not belong to their “publishers list” (subscribers have all the public keys of all publishers). Have I missed something, does the draft protect against this at the broker?

FP: No, the broker would not accept this message. In fact, during the ACE exchange between Publisher, AS1, and Broker, the Publisher would post a token to the Broker that contains the resource it is allowed to publish to, namely in this case topic 1. If it does have rights to publish to topic 2 as well, that would be included in the token. That is covered by the transport profile used, as you mentioned (MQTTL-TLS/CoAP OSCORE). Orthogonally to this, when getting the keys from AS2 to protect the publication, if the Publisher has tried to publish to topic 2 without having the correct content encryption keying material, the decryption of the publication at the subscriber would fail even before signature verification. But the Subscriber would not get the publication if the Publisher is not authorized to publish on that topic. Note that if the owner wants to protect topic 1 and topic 2 with the same keying material, that is possible, but then the case above would not be an attack but an acceptable scenario (Publisher allowed to post to both topics, publication protected with the same key).

Differently, with the current way mqtt_tls scopes are described, AS1 would need to know not only who can publish or subscribe, but also the policies on topics.

FP: By policies on AS1 I mean exactly that: "what endpoints are allowed to publish on what topics". If one wants to control who can subscribe, that would also be part of the so-called policies.

(4) That brings me to another point regarding this note in coap-pubsub profile. The profile says: “How the policies are exchanged [between AS1 and AS2] is out of scope for this specification.” I wonder whether the token the client gets from AS1 should also be usable towards AS2, and AS2 is replaced with an RS for retrieving the keying material for topics (more on this later), i.e., AS2 does not need to host/manage/coordinate policies with AS1.

FP: That is a possibility. Right now this is not the case because I thought it would be better to keep the two ("authorization to publish on one or more topics on Broker" and "authorization to get encryption keys for one or more topics") independent. The reason for that was that the same key could be used for several topics, i.e. Publisher P could be allowed to publish on topic 1 but not on topic 2, even though topic 1 and 2 use the same encryption key. Yes, that could be a way to do it, but I am not sure about the advantage, apart from the obvious policies synchronization (i.e. in this way there would be no need for synchronizing since in practice AS1 would know both what topic Publisher P can publish to and what content encryption key it can retrieve). But I'd be happy to discuss that further.

(5) Regarding groups and group memberships, it seems like for the draft group = a single topic.

In MQTT, topics can have level separators and multi-level (#) and single-level (+) wildcards.  Similarly, CoAP would also have hierarchies.

FP: Thank you for bringing this up. You are right, hierarchies are something not really thought through right now in this document.

Consider the case when a PUBLISHER is allowed to publish to sport/tennis/player1/# but not sport/tennis/player2/#.  The players' directory may have sub-levels like “rankings”.
And a subscriber has permissions to get content from sport/tennis/#.
It seems like sport/tennis/player1 would be a group, and sport/tennis/player2 be another group.
And, the subscriber needs to be in two groups. This is fine, I believe, according to this document.

FP: Yes, what you describe is a valid scenario covered by the document.

In MQTT token scopes, we also accepted that a publisher represents its PUBLISH rights with topic filters (note a PUBLISH message cannot be sent to a filter, but the topic filters are useful in summarising permissions).
Let’s assume there is a publisher with scope “publish_sport/tennis/+/rankings“?

FP: The first question I have is if it is even possible to indicate scope like this in ACE. I do not think so (and please correct me if I am wrong), and in this case the scope would have to be expressed as the union of the following URIs: publish_sport/tennis/player1/rankings and publish_sport/tennis/player2/rankings

Then being a part of all groups (player 1 and player2) is too general as this publisher cannot publish to everything but only to “rankings”.

FP: But once the scope is expressed for "rankings" only, then the doc should cover this case too. Then it is up to the topic owner (and reflected on the AS2) to decide if the keying material is the same for rankings and for the upper-topics (? as opposed to sub-topic) player1 and player2. And similarly, it will be up to the broker to verify that the authorization for publishing to rankings is separate from publishing to player1 and player2. It is also a valid case to make it so sub-topics inherit authorizations, but that would be up to the application to decide. Anyway, these are all valid considerations that need to be made in the document.

Another approach could be each publisher creating its group. This way the number of groups scales with the number of publishers (and the COSE keys is per publisher).

FP: I don't think this scales well, but yes, an application could also do this.

So, the subscriber still asks permissions for and subscribes to topic filters.
There needs to be a solution that maps the topics to a publisher list...
AS1  (see my earlier discussion on who keeps the policy information) knows who has the right to publish to these topics in their policy database and has the public key information for them. AS2 hosts the COSE key for this publisher.

Putting all this information together,  when a message is received, the subscriber would use the publisher's public key to verify the publisher signature (the draft already supports this), then locate the symmetric key it received from the AS2 for this publisher to decrypt the message.

Would there be any problems with this approach?

FP: No I don't see problems with this, although I am not sure we need to describe this in this document. If I understand correctly, the scenarios should be covered by the current spec. Or did I miss something?

Nits:
Figure 2: Negociation -> Negotiation

FP: Ok, will fix.

Kind regards,
--Cigdem