Re: [IPsec] WGLC of draft-ietf-ipsecme-labeled-ipsec

Valery Smyslov <smyslov.ietf@gmail.com> Fri, 05 November 2021 14:10 UTC

Return-Path: <smyslov.ietf@gmail.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A18C03A0DBD for <ipsec@ietfa.amsl.com>; Fri, 5 Nov 2021 07:10:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, 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 T-EGrHRKzkOs for <ipsec@ietfa.amsl.com>; Fri, 5 Nov 2021 07:10:36 -0700 (PDT)
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 414B73A0F35 for <ipsec@ietf.org>; Fri, 5 Nov 2021 07:10:27 -0700 (PDT)
Received: by mail-lf1-x12a.google.com with SMTP id f3so18879157lfu.12 for <ipsec@ietf.org>; Fri, 05 Nov 2021 07:10:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=i0Fc7rHoiLjv0EeLNpQYE3yYWLAHOiNiXkb7oJPpPPQ=; b=WifWycEYFELbWo7SwyN7AraqlG2P+7iPz5Krwvv4mUfTZ17cdrRC/PdSZk1Nqxcr3S scGs+znkm6q0a1kFNunLye2svKXNb/ihx2F+QJFr59vL27zsFVTsWT8UOZbE6oc5qsIk K2YhJyVMJoCSTlOt68L9UkQhvby2xAjJVUEFYD7CYcfn9xKqzf0575REA7wBZrvFoI7Z IQ5OkapyHW6PzJNoTXhmLW2YztLFZFJV43Gte1E6ynkYZYJ029C5iYzSi2aArQHRdSOa u0aEispNqDTKBqrvY0uqcUJEnSByIa2lNbXQcu32otdSRIDb9etQU0ONVunMMDowPOob IH2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=i0Fc7rHoiLjv0EeLNpQYE3yYWLAHOiNiXkb7oJPpPPQ=; b=Xdd1SFOGNpMVFwvglJz8nhm+Ord7Xgt364eUCiNLdXZxr8SlTpiVh+GBXXksphHToG nskCI9DyGX0QwleRlf8uAs/pC0AjEBAQeJOFLvNrVtPEk7UMdfslBEIfZG3RYwQNsjOy x2Ioe7TUycoqtE0jUaEcilCAH+7kNE5ugkXqS/cbhpqRV5FSGRB+4x68UQhi53LJcaMv L+SR6HwhXjz6dttV4nseGNRzOVQVoWkw+yh/Qqb7608XMLy4Ix0OVhtSVL1LfdxzsRdK 80hlYDSe0NcnMtZxXEjh495rFy5gDhfACtbxlwZRon/PMwRAVO7zw3LKOKH4NlYziZET Z69Q==
X-Gm-Message-State: AOAM5318bXdNb0rbTBtSQ6Q5gB+K7a+5gUwLq12lBoi0TA9SRw4vO/Xp RDGOgaviOEIF7RBtgf4LE60vzWfdNvw=
X-Google-Smtp-Source: ABdhPJzc3zAWWNRl7sdPiPbvMqh3MGpE19I1W0fbQk8nomKVYH7xAAFjiwTYspAVqNq1l7ACFMIhcw==
X-Received: by 2002:ac2:4f8b:: with SMTP id z11mr18292211lfs.91.1636121423898; Fri, 05 Nov 2021 07:10:23 -0700 (PDT)
Received: from svannotebook ([185.15.119.157]) by smtp.gmail.com with ESMTPSA id g12sm781588ljl.131.2021.11.05.07.10.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Nov 2021 07:10:22 -0700 (PDT)
From: Valery Smyslov <smyslov.ietf@gmail.com>
To: 'Paul Wouters' <paul@nohats.ca>
Cc: ipsec@ietf.org, 'Tero Kivinen' <kivinen@iki.fi>
References: <24831.15082.263253.443690@fireball.acr.fi> <2d1501d799ba$af76bc40$0e6434c0$@gmail.com> <ed3d346-8f66-620-1914-d55e0dd9f2c@nohats.ca> <080101d7cfc5$88f62a60$9ae27f20$@gmail.com> <d297ab6c-a182-3d51-e0b5-ccd7b09dcda8@nohats.ca> <093501d7d0b1$dd0db1d0$97291570$@gmail.com> <4066a22d-fe4b-e27f-3350-f41ab91ff76@nohats.ca>
In-Reply-To: <4066a22d-fe4b-e27f-3350-f41ab91ff76@nohats.ca>
Date: Fri, 05 Nov 2021 17:10:21 +0300
Message-ID: <0d2501d7d24e$df7e7e10$9e7b7a30$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQKYNO/A1f9S/Q/00+U6x9xSlcVzmwFmfHkfARefwpsCZGyDnAJXSyjwAXIS6DwBjrRV5KoiRoBg
Content-Language: ru
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/n0PD-V-njZE0ARiPfQpTmZv45WE>
Subject: Re: [IPsec] WGLC of draft-ietf-ipsecme-labeled-ipsec
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Nov 2021 14:10:40 -0000

> On Wed, 3 Nov 2021, Valery Smyslov wrote:
> 
> > It can represent optionality of the security label.
> 
> An optional security label has no meaning. If you have a real case of
optional
> security labels, lets year it. Otherwise, I think we should move on
without
> supporting optional security labels. From a security point of view, it
just makes
> no sense. From a migration point of view, it can be done without further
> protocol support.

Migration is not the only use case. For closed environments I tend to agree
with you.
But for open environments, you generally don't know whether peer that 
you contact for the first time supports security labels or not. As far as 
I understand, there is pretty limited support for them in OSes, so 
the use case when initiator proposes both using security labels and 
not using them makes sense for me. After all, initiator's policy
will control which traffic it is willing to send over the SA depending
on whether security labels are supported by the peer.

> >> It is too ambiguous with "no security label". It makes common sense
> >> to me to simply not allow it. And comparing a 0 size NULL with a zero
> >> byte also seems just way to risky.
> >
> > I failed to understand why do you think implementers are so stupid,
> > that even such a primitive task would run them into problems.
> 
> Experience reading and acting on opensource code ?

No. Just my opinion.

> >> Ideally, I would have
> >> stated "a minimum length of one non-zero octet".
> >>
> >> I guess we need to get other people's opinion on this.
> >
> > OK, let's wait for other opinions.
> 
> Okay, good.
> 
> >> In our implementation you can define two "conns", one with and one
> >> without. And choosing the right one will work. On the responder,
> >> there is a connection switching mechanism that can switch to the
> >> better matching connection once the TS payloads are read from
> >> IKE_AUTH. So first you add all the conns with sec_label. And after a
> >> while, you can just remove all the conns without sec_label.
> >
> > When upgraded initiator contacts not yet upgraded responder this won't
> work.
> 
> Correct. this assumes you have an established system of updating
> configurations, like cloud/terraform based, or puppet or system roles or
> ansible or what not.

Please, see above another scenario.

> > To make this case workable the initiator must implement a complex
> > logic (first it tries TS with seclabels, then it receives
> > TS_UNACCEPTABLE, which BTW may come due to any reason, but it guesses
> > that it may be due to seclabels, and perform another attempt with no
> seclabels).
> > This logic complicates IKEv2 state machine and may lead to more
> > serious implementation errors.
> 
> I don't think this is a change to the state machine. It is a change to the
allowed
> configuration and/or default action. No state machine changes are needed.

You have to somehow handle the case when the responder returns
TS_UNACCEPTABLE.
Currently it's a fatal error (requires changing local policy). In your case 
implementations will need to handle it properly.

> You can simple choose to not support the unlikely use case. Security
labels are
> dictated to systems _before_ you are allowed to access them.
> The hypothetical upgrade case is not a real life deployment scenario.
>
> Still, with todays automated (cloud) deployments, you first upgrade the
> required software, then upgrade the required configuration files, then let
> machines switch to the new behaviour.

You are talking here about closed homogenous system.
I don't think it's so simple in multi-domain heterogenous
systems, that are not controlled from a single center.

> > If you make TS_SECLABLE with no data an indication, that seclabels are
> > optional for this connection, then it would require require minimum
> > changes to IKE state machine and in fact is much safer with regard to
> > implementation errors.
> 
> I fail to see how it would be safer to include a mechanism for allowing
for
> mismatched configurations to establish a less secure connection ?

By "safer" I meant less implementation errors.

> > And more efficient from protocol point of view.
> 
> Thie claimed efficiency is for a use case (upgrading via optional security
labels
> without configuration change) that I just don't see a real life use case
for. And
> it comes at a cost of complexity and error handling of configuration
mismatch
> cases that would be more likely, not less likely, to be prone to errors.

See another use case above.

And of course optionality must be controlled via local configuration,
so it is not built in the protocol. If initiator's policy states, that 
security labels are optional, it includes an empty TS_SECLABEL
along with others, if not - it doesn't. So I'm puzzled why you
write "without configuration change".

> >>>> Changed. Old text:
> >>>>
> >>>>     A responder that selected a TS with TS_SECLABEL MUST use the
> Security
> >>>>     Label for all selector operations on the resulting IPsec SA.  It
MUST
> >>>>     NOT select a TS_set with a TS_SECLABEL without using the
specified
> >>>>     Security Label, even if it deems the Security Label optional, as
the
> >>>>     initiator TS_set with TS_SECLABEL means the initiator mandates
using
> >>>>     that Security Label.
> >>>>
> >>>> New text:
> >>>>
> >>>>     A responder that selected a TS with TS_SECLABEL MUST use the
> Security
> >>>>     Label for all selector operations on the resulting TS. It MUST
> >>>>     NOT select a TS_SECLABEL without using the specified Security
Label,
> >>>>     even if it deems the Security Label optional, as the initiator
has
> >>>>     indicated (and expects) that Security Label will be set for all
> >>>>     traffic matching the negotiated TS.
> >>>
> >>> I'm a bit confused with the part of \new text:
> >>>
> >>> "...all selector operations on the resulting TS."
> >>> What do you mean? Did you mean
> >>> "on the resulting Traffic Selector"?
> >>> Or am I missing something?
> >>
> >> I mean to say, if you pick a TS with TS_SECLABEL, you MUST have a
> >> security label as part of your SPD selector mechanism. You cannot
> >> decide to ignore it and only use IP address based SPD selectors.
> >
> > Isn't it obvious?
> 
> It is. But I wanted to clarify it because it might be that the IKE daemon
needs to
> "do something" to make that happen that goes beyond installing an IPsec
SA.
> I'm okay to leave it out.

OK, please.

> >>>> (I avoided talking about IPsec SA or Child SA, as one of those
> >>>> _may_ include multiple different TS'es)
> >>>
> >>> So what? I think that the essence of this text is that if
> >>> TS_SECLABEL is used, then it is applied for the whole Traffic Selector
for
> this Child SA.
> >>> Am I missing the essence?
> >>
> >> I avoided talking about IPsec / Child SA because different ones can
> >> have different negotiated TS_SECLABELS - eg they can be independent
> >> from the exchange we are talking about. (I think we are saying the
> >> same thing?)
> >
> > Of course different IPsec SAs can have different Traffic Selectors.
> > But you talked not about any IPsec SA, but about the IPsec SA that
> > resulted from negotiation, which included Traffic Selector with
seclabels:
> >
> > Old text.
> >
> >     A responder that selected a TS with TS_SECLABEL MUST use the
Security
> >     Label for all selector operations on the resulting IPsec SA.
> >
> > ^^^^^^^^^^^^^^^^^^
> >
> > I think, that this sentence is more clear than the corresponding one
> > from new text (the rest of new text is OK).
> 
> I'm okay removing it.

Or retain the old text for the first sentence (cited above).

> > OK. I seem to understand the source of my confusion.
> >
> > With first para of Section 3.2 you seem to imply the following
negotiation
> scenario:
> >
> > Initiator:
> >   TSi = (TS_SECLABEL="nfs-client", TS_SECLABEL="nfs-server")
> >   TSi = (TS_SECLABEL="nfs-client", TS_SECLABEL="nfs-server")
> >
> > Responder:
> >   TSi = (TS_SECLABEL="nfs-client")
> >   TSi = (TS_SECLABEL="nfs-server")
> >
> > Am I right?
> 
> No. Our implementation never uses more than one sec_label, due to the
> nature of the sec_label. In our case, it basically comes from an ACQUIRE
> message, so the IKE daemon has no way of determining that the reply to a
> packet we send would require a different sec_label by the remote peer.
> In fact, the IKE daemon does not even know if the reply traffic would
match
> the inbound SA sec-label or not. The remote peer's sec-label will receive
its
> own ACQUIRE if the return traffic has another sec-label set, and will
negotiate
> a second IPsec SA that only differs in label.

OK, this all is clear and aligned with my understanding.

> > If you mean this case, then it's a major change what the semantics of
traffic
> selectors currently is.
> 
> I don't mean that.
> 
> > You seem to imply that with regard to seclabels matching the following
logic
> applies:
> > for outgoing packet to match SPD only TSi should be checked on
> > initiator and only TSr on responder and visa versa for incoming packet.
> > But this is not how it is defined in RFC7296 and how it works now -
> > both TSi and TSr are checked for any packet.
> 
> I do not imply that.
> 
> > Unless I'm missing something and my speculations above are wrong,
> 
> It is.
> 
> > Either remove the possibility of having different seclabels in TSi and
> > TSr or add clarification and describe, that this is another update for
> > RFC 7296 (and probably for 4301 too).
> 
> I do not believe our SElinux based labeled IPsec should limit how people
can
> use security labels in general.

Here I'm lost completely.

If my guess of what the first para of Section 3.2 means to say
was wrong, then can you please clarify its meaning?
If it is not about selecting different security labels in TSi and TSr
by the responder, then what it is about?

Regards,
Valery.

> Paul