Re: [Ace] WGLC draft-ietf-ace-mqtt-tls-profile

Cigdem Sengul <cigdem.sengul@gmail.com> Tue, 22 September 2020 20:37 UTC

Return-Path: <cigdem.sengul@gmail.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 D0DC53A1987 for <ace@ietfa.amsl.com>; Tue, 22 Sep 2020 13:37:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 nrDjZTPjJK-U for <ace@ietfa.amsl.com>; Tue, 22 Sep 2020 13:37:57 -0700 (PDT)
Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8D6113A1985 for <ace@ietf.org>; Tue, 22 Sep 2020 13:37:57 -0700 (PDT)
Received: by mail-vs1-xe35.google.com with SMTP id x203so11071500vsc.11 for <ace@ietf.org>; Tue, 22 Sep 2020 13:37:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dRONLMQAoTo9xl4EF/BVQAf/grgBZEtxhQYmzgU7wxI=; b=T2KAW5MIBdhwJp/h6iOJxAg2VV8+dlmvpmAoznvygCcVdKgPopZljNWJRKe07mQxDX 8aSScJ1FaqgwVLiUSnZvxlRsvvvfhgXA1QcdqUUqiMkXB5QIoJeIuzvWp6Z+UovVpMDP XDl+30A4SykbA1PjoWX3OHD1wc3jalk+SuIxe6Jwd+K6gcdElo5lGQemcBldhtyBx1cw iBxUuvngtnwnYj0kOvLkox2zAJY5Uerb1Pt5qjbHA13KzQMhvql7V04+CpUUIwZ/+87k NS66b4C2qLdBy9/6imGR2sg1jTmo5epzQ/G6jwVNGWSZyF4IDnHDKgVtsDX4JhiBvl0Q hGsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dRONLMQAoTo9xl4EF/BVQAf/grgBZEtxhQYmzgU7wxI=; b=t+1xE0/EmM2L47Oc1X4RUEzksKqTHT8vHgWKWGZuPaSwQn5DBwFYptBHVb2d8R+A7v XYns95SyETM3Qf0vD3kvOV/anXlPw9dmj0br9at4Js9y4PABwL/5GjBun1bCUTIhftdU rLAgegVwal+ESbi1n5GOdXga65qIcfJPOnntv7fZcwEXxLITcOMIv4Fn9l7s3cW3FpOc kKn0U7UlR/Q/TidFIODtkhtWUVgDRCuiJG9wV6z9DJFio5P/6mbBLUy+GluWVECZV8AM Y/NiZUB31F6++cUAppAq4QsxISTznLBDNumNMMI9WKky5hAB0zg1bJJcOMik05HsEluH lUSg==
X-Gm-Message-State: AOAM531SswGluqoBiaD9MxoK/Hfe1thUUy5svBxvxn2FY5uaZWgCpExW hmiUAl/bfIHqKBSXJsU0WgvoofVF1A8wcuozKkc=
X-Google-Smtp-Source: ABdhPJwjXY2AFNJkilr3yd6o4nb0t650TcF94eHBWasdOhoVRydB0x7/oTA7nJNm5Kxa9I6wQCUpkNwD7aNOGEmRWL8=
X-Received: by 2002:a67:e248:: with SMTP id w8mr5190296vse.39.1600807076423; Tue, 22 Sep 2020 13:37:56 -0700 (PDT)
MIME-Version: 1.0
References: <CADZyTkmMd7iO3jo359QSS+y1LoSKvoDw+vJonD8VUfheEgXLTA@mail.gmail.com> <CADZyTkm9x62oTxHp8EwqWxkQT3Tn6szZ4myuM5XJWt-4FQS92g@mail.gmail.com> <CAA7SwCPOsn5nd=H9EHDn451VZ0MhJEk6vR+qMHBcuC3kaA55wQ@mail.gmail.com> <CADZyTkmpwx68YJGeoh9Tki8A_eqMMhJVzQwF6_9mZanurj_CsA@mail.gmail.com>
In-Reply-To: <CADZyTkmpwx68YJGeoh9Tki8A_eqMMhJVzQwF6_9mZanurj_CsA@mail.gmail.com>
From: Cigdem Sengul <cigdem.sengul@gmail.com>
Date: Tue, 22 Sep 2020 21:37:46 +0100
Message-ID: <CAA7SwCNevGqv641ZRCJPJiUaJ4TEZ2gsx=7BBTN678CN0EYeWA@mail.gmail.com>
To: Daniel Migault <mglt.ietf@gmail.com>
Cc: Ace Wg <ace@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000024eae905afecf155"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/gv-j2HsELlt-83uEr7s4gWtwjQk>
Subject: Re: [Ace] WGLC draft-ietf-ace-mqtt-tls-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: Tue, 22 Sep 2020 20:38:00 -0000

Dear Daniel,

Thank you very much for the responses. Mine are inline as well.
Kind regards,
--Cigdem



On Mon, Sep 21, 2020 at 4:06 PM Daniel Migault <mglt.ietf@gmail.com> wrote:

> Hi Cigdem,
>
> Please find my quick answer. Note these answers/comments are based on your
> response and what I remember from the document. That should be sufficient
> to clear most of them. I preferred to post the response earlier.
>
> Yours,
> Daniel
>
> On Sat, Sep 19, 2020 at 11:05 AM Cigdem Sengul <cigdem.sengul@gmail.com>
> wrote:
>
>>
>>>
>>> 2.2.  Client Connection Request to the Broker (C)
>>>
>>> 2.2.1.  Client-Server Authentication over TLS and MQTT
>>>
>>>
>>>    It is RECOMMENDED that the Client follows TLS:Anon-MQTT:ace.
>>>
>>>    The Broker MUST be authenticated during the TLS handshake.  If the
>>>    Client authentication uses TLS:Known(RPK/PSK), then the Broker is
>>>    authenticated using the respective method.  Otherwise, to
>>>    authenticate the Broker, the client MUST validate a public key from a
>>>  X.509 certificate or an RPK from the Broker against the 'rs_cnf'
>>>    parameter in the token response.  The AS MAY include the thumbprint
>>>    of the RS's X.509 certificate in the 'rs_cnf' (thumbprint as defined
>>>    in [I-D.ietf-cose-x509]).  In this case, the client MUST validate the
>>>    RS certificate against this thumbprint.
>>>
>>> <mglt>
>>>
>>> I am considering two main ways to
>>> authenticate the client
>>> TLS:Anon-MQTT:ace and
>>> TLS:Known(RPK/PSK)-MQTT:none. If a
>>> server supports both it is unclear
>>> to me how he can distinguish one
>>> method of authentication versus the
>>> other.
>>>
>>> TLS:Known(PSK)-MQTT:none If the TLS
>>> client provides a psk_identity, the
>>> TLS server may take this as an
>>> indication and lookup in the
>>> authz-info to see if there is a
>>> matching identity. This would
>>> assume that that kid is mentioned
>>> in the PoP.
>>>
>>> TLS:Known(RPSK)-MQTT:none If the
>>> client provides a
>>> post_handshake_auth, this may be
>>> taken as a hint that the client is
>>> associated to a RPSK. The Broker
>>> may instead chose to send a
>>> CertificateRequest, and upon
>>> receiving the Certificate message
>>> verify there is a matching RPK.  If
>>> the client does not provide the
>>> post_handshake_auth, it is unclear
>>> to me how the broker may
>>> distinguish a
>>> TLS:Known(RPSK)-MQTT:none from a
>>> TLS:Anon-MQTT:ace.
>>>
>>> In case there is no matching RPK, I
>>> am wondering if the broker falls
>>> back in a expected
>>> TLS:Anon-MQTT:ace.
>>>
>>> I might be missing something, but
>>> it seems that the authentication
>>> method is pre-agreed. Maybe some
>>> text may be added here.
>>>
>>> </mglt>
>>>
>>
>> [Cigdem: Yes, I assumed the flow you mentioned:
>> If the client is using PSK to authenticate then, I assume Client Hello
>> includes pre_shared_key (as described in RFC 8446: 2.2.  Resumption and
>> Pre-Shared Key (PSK)).
>> For clients that want to do RPK,  I assumed they will do  "post_handshake_auth"
>> and the server will do a CertificateRequest, but if the client declines
>> or fails to authenticate, will expect authentication over MQTT:ace.
>>
> <mglt>
> Unless I am missing something in TLS 1.3 or in ACE. The client can
> authenticate with a Post Handshake Client Authentication or during the TLS
> base handshake (appendix E.1.2). In the second case ,  I do not see any
> specific extensions that the client provides to indicate it supports the
> client authentication during the handshake. It seems the server logic that
> decides to send a CertificateRequest
> </mglt>
>

[Cigdem: TLS 1.3:
""When the client has sent the “post_handshake_auth” extension (see Section
4.2.6), a server MAY request client authentication
at any time after the handshake has completed by sending a
CertificateRequest message. The client MUST respond with the
appropriate Authentication messages (see Section 4.4). If the client
chooses to authenticate, it MUST send Certificate,
CertificateVerify, and Finished. If it declines, it MUST send a Certificate
message containing no certificates followed by
Finished."

So, my understanding the client may not authenticate during
post_handshake_auth. Cllient authentication over TLS can be configured
optional at the server, and the server can tolerate an empty certificate
list. In this case, I assumed that the server checks the client
verification result and falls back to authenticating via MQTT connect.

Again, if any of the handshake fails - PSK/RPK aborts (different than empty
certificate list), authentication fails.
]


>
>> If the client TLS handshake includes PSK/RPK authentication information,
>> then the AS will look for whether a token has been submitted via authz-info.
>>
>> Next, after processing the MQTT CONNECT message, it finds another token,
>> then it overwrites all the permissions set-up in TLS handshake.
>>
>> I can add: "If the client fails to authenticate over TLS, the AS falls
>> back to  TLS:Anon-MQTT:ace."
>>
>> Would that be more clear?
>>
> <mglt>
> This means that MQTT server will send a CertificateRequest, If an empty
> Certificate is received from the client and the client has provided a
> post_handshake extension, the MQTT server will try a post handshake
> exchange.
> In both cases, the client authentication may fail because the server is
> unable to verify the signature or because no signature is provided.  If the
> signature fails, TLS exchange is aborted. So MQTT authentication is only
> considered if the client has not been authenticated via TLS due to the
> absence of a signature. In this case, it will use ace authentication during
> the CONNECT message.
>

[Cigdem : Yes, actually, this is what I described above. Due to absence of
a certificate, I suggest it can fall back to CONNECT]


>
> If TLS client is authenticated, the MQTT server will look for at
> authz_info right after the TLS exchange. Then looking at the CONNECT.
>

[Cigdem: If TLS client managed to authenticate, then the MQTT server may
have already used what was submitted through authz_info.
i.e., if it is through RPK, it would assume to find it mathching rpk bound
to the pre-submitted token via authz-info.]



>
> Am I correct ?
>
> I think that originally, my comment was here as I expected that a
> server could support a single mode, but it seems the MQTT server needs to
> support all modes. Correct ? If so, maybe that could be clarified as well
> as the specific logic of the server.
>
> </mglt>
>

[Cigdem: I assumed some flexibility, i.e PSK or RPK; if client does not
submit an RPK, fall back to CONNECT.
If this is not acceptable, I can clarify more strictly a single mode]

>
>>> 3.1.  PUBLISH Messages from the Publisher Client to the Broker
>>>
>>>
>>>    If the Client is allowed to publish to the topic, the Broker must
>>>
>>> <mglt>
>>>
>>> I have the impression MUST would be
>>> acceptable too.  I am not saying
>>> "must" is not acceptable but I
>>> would like we check this is not a
>>> mistake.
>>>
>>> </mglt>
>>>
>>
>> [Cigdem: I think I should add an explanation that if the requirement
>> comes from MQTT standart, the draft uses "must".
>> All the musts for the profile are MUST.
>> ]
>>
> <mglt>
> So must has also a different meaning than MUST in IETF language. So all
> must cannot be given that meaning. I suspect that either we put MUST or add
> an explanation line that clarify the meaning (origin) of the must.
> </mglt>
>
[Cigdem: This seems to be creating a confusion with others too. Then I
remove must/should etc. language, and just say: "If the client is allowed
to publish to the topic, the RS publishes the message to all valid
subscribers of the topic."]