Re: [Ace] draft-ietf-ace-mqtt-tls-profile - Validating a subscription is in scope

Jim Schaad <ietf@augustcellars.com> Tue, 14 January 2020 16:50 UTC

Return-Path: <ietf@augustcellars.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 BDF90120A12; Tue, 14 Jan 2020 08:50:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 r5LQJTshqp1c; Tue, 14 Jan 2020 08:50:17 -0800 (PST)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5FFCC120A10; Tue, 14 Jan 2020 08:50:16 -0800 (PST)
Received: from Jude (73.180.8.170) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 Jan 2020 08:50:07 -0800
From: Jim Schaad <ietf@augustcellars.com>
To: 'Cigdem Sengul' <cigdem.sengul@gmail.com>
CC: draft-ietf-ace-mqtt-tls-profile@ietf.org, 'Ace Wg' <ace@ietf.org>
References: <003f01d5c9b2$1fe439b0$5facad10$@augustcellars.com> <CAA7SwCOieCSUhKHGS=y+zakoPvTkaZm4jLwcVq0rCpqS=GT3JA@mail.gmail.com>
In-Reply-To: <CAA7SwCOieCSUhKHGS=y+zakoPvTkaZm4jLwcVq0rCpqS=GT3JA@mail.gmail.com>
Date: Tue, 14 Jan 2020 08:50:05 -0800
Message-ID: <00de01d5cafa$adefb420$09cf1c60$@augustcellars.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_00DF_01D5CAB7.9FCF5A50"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQG68Cx4Lv4gMYGrZ81gKRTlPGEQPwK+Nj7oqAoi4lA=
Content-Language: en-us
X-Originating-IP: [73.180.8.170]
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/dqvNoGhY-026_9RgzAWHijf6yvQ>
Subject: Re: [Ace] draft-ietf-ace-mqtt-tls-profile - Validating a subscription is in scope
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: Tue, 14 Jan 2020 16:50:22 -0000

 

 

From: Cigdem Sengul <cigdem.sengul@gmail.com> 
Sent: Tuesday, January 14, 2020 6:24 AM
To: Jim Schaad <ietf@augustcellars.com>
Cc: draft-ietf-ace-mqtt-tls-profile@ietf.org; Ace Wg <ace@ietf.org>
Subject: Re: [Ace] draft-ietf-ace-mqtt-tls-profile - Validating a subscription is in scope

 

Hello Jim,

 

Topic filter and permission filter matching is something that I would like to have a better resolution as well. 

Responses inline. 

On Mon, Jan 13, 2020 at 1:38 AM Jim Schaad <ietf@augustcellars.com <mailto:ietf@augustcellars.com> > wrote:

I have run across an interesting question for doing validation of
subscriptions that I would like to get an opinion on.

When doing a publish, there is not an issue.  One simply takes the set of
values in the scope field as topic filters and checks the publication topic
against the set of permissible publication topic filters in the scope.

 

[CS] Yes. 

 


When doing a subscribe, there are four distinct cases that can arise:
1.  The subscription is for a single topic and either is or is not
successfully matched against the scope topic filter.

 

[CS] Yes. 

 

2.  The subscription is for a topic filter and it is identical to the scope
topic filter.

 

[CS] Yes. 

3.  Both are topic filters and are not the same.  Is one supposed to do some
type of subset matching on the two filters or does one always say that this
is not a match.  This is not addressed in the MQTT document and I am not
sure where it would be addressed.   As an example:

Scope value is subscribe_sport/#
Subscription topic is sport/tennis/#

The second is clearly a subset of the first and thus it would seem logical
to include it, but it gets more complicated if one instead asks for

Subscription topic is sport/+

In this case the two wild cards are not the same value.

 

We were thinking using a subset matching to check whether the token would permit the subscription request. 

For your example, a subscription request 

"sport/+" would cover all the single-levels under "sport" - including "sport/" but not "sport" . 

So if the scope is "subscribe_sport/#" which covers all multi-levels under "sport" (including "sport", the subscription request should still succeed. (i.e., the subscriber has a larger set of permissions than the request)

 

Now when the broker receives a publication with "sport/tennis" then it should pass this message on to the subscriber. 

When it receives a publication "sport/tennis/player1" then it should not. This would be normal broker behaviour as well (without using ace). 

 

[JLS] This is what I expected the answer to be, I will need to figure out what this algorithm looks like now for all of the corner cases.

 

It gets interesting when the scope is more restricted than the subscription request. 

For instance, the scope is sport/+

But subscription is sport/#

 

Should this be refused? Obviously the subscriber is attempting to subscribe to more than it has permission for. But does the broker still allow the subscription but reduce it to "sport/+"?

Currently would opt for the former, because the second option may be hard to signal to the subscriber - the SUBACK reason string together with the user property field may be used for such feedback to the subscriber but would need to be defined properly.

 

[JLS] Given that this is not defined in the base MQTT specification, most clients would not expect this if the ACE is grafted on the side of the program.  I would therefore say this is a “not authorized” and go on.

 

Jim

 

 

--Cigdem 


Jim


_______________________________________________
Ace mailing list
Ace@ietf.org <mailto:Ace@ietf.org> 
https://www.ietf.org/mailman/listinfo/ace