Re: [netconf] Paul Wouters' Discuss on draft-ietf-netconf-crypto-types-29: (with DISCUSS and COMMENT)

Paul Wouters <paul.wouters@aiven.io> Fri, 09 February 2024 02:51 UTC

Return-Path: <paul.wouters@aiven.io>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AFA16C14F5FC for <netconf@ietfa.amsl.com>; Thu, 8 Feb 2024 18:51:53 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.105
X-Spam-Level:
X-Spam-Status: No, score=-7.105 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=aiven.io
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d3eAmYedGGaa for <netconf@ietfa.amsl.com>; Thu, 8 Feb 2024 18:51:49 -0800 (PST)
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D0361C14F6FB for <netconf@ietf.org>; Thu, 8 Feb 2024 18:51:48 -0800 (PST)
Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a389ea940f1so51072566b.3 for <netconf@ietf.org>; Thu, 08 Feb 2024 18:51:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aiven.io; s=google; t=1707447107; x=1708051907; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZyW0heq6LRbyUQF855TJDAekVVNRdpIZJyrsH6k86UM=; b=nMM4RKmoYJAmwUArYh9tmqY47Lswpig5vdSl3ZhNVuoQSQk1zoh8UDMHDXkHUWUCC9 A+VNQWMy//RZes5CSkktdDkhcdqE2bX+Y0QaOPiICeWFrcxsjIFibhocHNHa31LwAxgU OO7MhhZ6Tyuc+fzejlFYUlvE6W9IifrK5p6u0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707447107; x=1708051907; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZyW0heq6LRbyUQF855TJDAekVVNRdpIZJyrsH6k86UM=; b=P2PaKDSEY1MK0CZ+axvyZG3TW7WClvlv40mcInrWLXabbmujOkA6ILKEBENhWhFg1O ZGfACHlLtAjtMbggvfwzDyyXEUo61pmympNMTYWm/3UzjMyUjW/tRuLK45tewEgC1qQ0 WtBYqGwZEDOISWf6FXwoyuPenJakFLEv9wd93R/Ls+XHim3IsJCbDUn/y+NEUhkZbw+y nl/0RkLytXU8bFofhpfnUUi8xjtsN88W0/z2gHWS3BKZ1RwBqZCfrMjEf6AAl+zreFfn nZ3SpBUx2tXeg4ieyoog6KE7ebVqPZdpyunigobXoocLUXJTfR3XH14ISQPI9Ih/TSoB D4kw==
X-Gm-Message-State: AOJu0Yx/4fB0PezGWoog4y+YR0JOgLela6ghjDksEOC62mRpKaRvZftm bzTrjQWd036xKXLuKAmGJ+M5LkoF/z12vhEfj801hymOKuqo8sUfxLcV/HiY//NUALGKBDH7BXC hbjZJDwJkBz+MRTCsvtXx5l4ydmh82ChKMrQtug==
X-Google-Smtp-Source: AGHT+IFk5nfsvgcgl24veaE1isTiTrBrspOCAW3t5Ek+9QsQGw1kGsdguR39gtQrd36rgbu0wALHasEp5y1GTctKtEo=
X-Received: by 2002:a17:906:ada:b0:a38:4e7b:36b with SMTP id z26-20020a1709060ada00b00a384e7b036bmr140759ejf.17.1707447107233; Thu, 08 Feb 2024 18:51:47 -0800 (PST)
MIME-Version: 1.0
References: <170675399539.19316.7954882445105097051@ietfa.amsl.com> <0100018d66109ad8-781f5d15-a15d-4914-859d-1947edb2bd5c-000000@email.amazonses.com>
In-Reply-To: <0100018d66109ad8-781f5d15-a15d-4914-859d-1947edb2bd5c-000000@email.amazonses.com>
From: Paul Wouters <paul.wouters@aiven.io>
Date: Thu, 08 Feb 2024 21:51:35 -0500
Message-ID: <CAGL5yWZe=Hic_naYevxPhPK739Lc=kN6+r_ro-3wynt92=J2HA@mail.gmail.com>
To: Kent Watsen <kent@watsen.net>
Cc: The IESG <iesg@ietf.org>, draft-ietf-netconf-crypto-types@ietf.org, "netconf-chairs@ietf.org" <netconf-chairs@ietf.org>, "netconf@ietf.org" <netconf@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000004cfbe00610ea028a"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/j9GinZQHtXCbm_WOkSwKZ791mA0>
Subject: Re: [netconf] Paul Wouters' Discuss on draft-ietf-netconf-crypto-types-29: (with DISCUSS and COMMENT)
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Feb 2024 02:51:53 -0000

On Thu, Feb 1, 2024 at 2:06 PM Kent Watsen <kent@watsen.net> wrote:

>
> PS, to all IESG members: if my response ever suggests that an update has
> been made, i.e., using words like “fixed” or “updated”, please know that I
> always mean that the update has been made in my local copy.  It is my
> intention to publish a bulk-update (to all nine drafts) once the churn dies
> down on these first three drafts.
>

Note that in general, it is impossible for us to track other repositories
or emails with promises so we always have to check the actual draft in the
datatracker :)
1) Regarding “name”, the intention here is for it to not necessarily
reproduce any of the fields mentioned (CN, SAN, etc.), though that would
certainly be possible and likely make sense in most cases.  That said,
conjoining  this comment with my response to Éric yesterday (who was hoping
to surface "validity period" information, to support key/cert rollover),
the name may be mangled as follows:

Understood, also from the keystore ballot discussion.


>       <certificate>
>         <name>My certificate (notBefore: AAA, notAfter BBB)</name>
>         <cert-data>BASE64VALUE=</cert-data>
>       </certificate>
>
> Please note that I don’t think name-mangling a wonderful idea, but notable
> in that there is possibly no end to how much information could go into the
> “name” field.
>
> To make things even more complicated, please note that (in Section
> 2.1.4.12), the actually payload of this YANG node is a CMS that may encode
> a chain.  Obviously the focus would be on the leaf-cert of the chain, but
> it shows that picking just one CN/SAN/etc wouldn’t tell the whole story
> either.
>
>
> 2) Regarding “type” (the last two sentences in your comment), I don’t
> follow.  Can you provide an example so I can better understand.
>

Not relevant anymore.


>
>
> My current thought is to focus on improving the “description” statement
> for the “name” node.  For instance, something like this:
>
> OLD:
>         leaf name {
>           type string;
>           description
>             "An arbitrary name for the certificate.";
>         }
>
> NEW:
>         leaf name {
>           type string;
>           description
>             "An arbitrary name for the certificate.  The name should
>              provide enough information to uniquely identify the
> certificate.
>              The certificate’s inherent identifiers (e.g., CommonName,
>              SubjectAltName, etc.) may be used or, alternatively, the
>              name may encode other characteristics (e.g., notBefore,
>              notAfter, etc.).";
>         }
>

Looks good.


>
> Thoughts?
>
>
> 2.2.1 talks about "asymmetric key" without specifying if it is referring to
> a public key or a private key. I think "private" is mean here on all
> occasions.
> Should that be clarified?
>
>
> I made a couple changes, but I think that you want to see more.
>
> Here are the changes I made:
>
>              <t>Notably, this example module and associated configuration
> data illustrates that
> -              a hidden asymmetric key (ex-hidden-asymmetric-key)
> +              a hidden private key (ex-hidden-asymmetric-key)
>                has been used to encrypt a symmetric key
> (ex-encrypted-one-symmetric-based-symmetric-key)
> -              that has been used to encrypt another asymmetric key
> (ex-encrypted-rsa-based-asymmetric-key).
> +              that has been used to encrypt another private key
> (ex-encrypted-rsa-based-asymmetric-key).
>                Additionally, the symmetric key is also used to encrypt a
> password (ex-encrypted-password).</t>
>
> The change that I didn’t make, which you may be looking for also, is in
> the artwork found in that section.  There, a YANG node call
> “asymmetric-key” exists, which is an instance of the
> “asymmetric-key-pair-grouping” that, in all but its “hidden” form, encodes
> both the private and public halves.  As such, it truly seems more correct
> to call the node “asymmetric-key”.
>

Okay.


>
> As a preview of things to come, the “keystore” draft also defines nodes
> called “asymmetric-key” for the same reason.  I see your review of the
> keystore draft in my Inbox, so this comment is a tad stale, but I thought
> worth mentioning for others who might be here.
>

:)


> 2.2.1.2 uses "cleartext-key" and "cleartext-private-key". Would it not be
> less
> confusing to rename "cleartext-key" to "cleartext-sym-key" ?
>
>
> I see your point, and the same follows for the “hidden” and “encrypted “
> forms as well.
>
> I made the following change (affects all nine drafts):
>
> s/cleartext-key/cleartext-symmetric-key/
> s/hidden-key/hidden-symmetric-key/
> s/encrypted-key/encrypted-symmetric-key/
>

Thanks!


> Section 3.5
>
>        That said, expert Security opinion suggests that already it is
>        infeasible to break a 128-bit symmetric key using a classical
>        computer, and thus the concern for conveying higher-strength
>        keys begins to lose its allure.
>
> I don't think this document should make this statement.
>
>
> Statement removed - thanks.
>

Thanks


>
> Section 3.6 Use of Recommended Ciphersuites
>
> Why is this document containing this single recommendation ?  I would
> rename this section to "Use of Secure Transport Protocols" and refer
> to RFC 9325 or BCP195 and maybe mention using IKEv2/IPsec RFC 7296 with
> RFC 8247/8221 as another secure transport that can be used. (I think
> IKEv2/IPsec might not be used with netconf/restconf so perhaps ignore
> that part)
>
>
> Or delete the section entirely?
> To your point, this seem better placed in protocol-specific documents.
> For instance, both the SSH and TLS RFCs make similar statements.
> I’ve deleted this section, per your first sentence...
> But please let me know if I misunderstood your comment.
>

That's fine too. Although I wouldn't mind a reference to 9325 just to give
implementers a nudge the right way.

Section 3.8 states:
>
>         Passwords and keys may be encrypted via a symmetric key
>
> Doesn't this move the problem? Isn't _that_ symmetric key then not
> still stored in the clear?
>
>
> But not if that symmetric key is hidden or encrypted - right?
>
> Separately, I note that the text is a bit wrong, in that a password or a
> key could be encrypted by *either* a symmetric or asymmetric key.  So I
> made this change:
>
>
> OLD:
> -          <t>The module contained within this document enables passwords
> and keys to be
> -            encrypted.  Passwords and keys may be encrypted via a
> symmetric key using
> -            the "cms-encrypted-data-format" format.  This format uses the
> CMS
> -            EncryptedData structure, which allows any encryption algorithm
> -            to be used.</t>
>
> NEW:
> +          <t>The module contained within this document enables cleartext
> +            passwords and keys to be encrypted via another key, either
> +            symmetric or asymmetric.  Both formats use a CMS structure
> +            (EncryptedData and EnvelopedData respectively), which allows
> +            any encryption algorithm to be used.</t>
>
> Okay?
>

It's fine. it was more a comment than a DISCUSS. I think in the other
document you made some clarification that this
for instance could be a hidden key.



> ----------------------------------------------------------------------
> COMMENT:
> ----------------------------------------------------------------------
>
>
>
> I see no mention of CRLs or OCSP? Is this not commonly used with NETCONF
> or RESTCONF ?
>
>
> They should be commonly used, yes, but what text-edit are you looking for?
>

I was wondering if you needed configuration options for this to be
representable in the model. But I guess if you assume
these are all encoded on the CA/certs with like CRLdistributionPoints etc,
then I guess nothing is needed.

>
> Specifically, as CRL/OCSP responses are never *configured* (right?), what
> might a YANG module have in it to support them.
>

One config option I am aware of is a "strict mode", so if your CRL is
expired but you can't fetch a new one, you might let clients
connect or not.


> It seems that it’s up to the implementation of the TLS-stack to fetch
> fresh CRL/OCSP responses, using information extracted from the certs
> themselves…
>
> Please advise.
>

Yes, feel free to ignore if you dont think this comes up in your world.


>
>
> 2.1.2 What about OpenPGP key types? Would it be expected some openpgp
> module would update this module with a new type?
>
>
> It is possible that a PGP key/cert could be added by future work.  This is
> why this draft defined base-identities (symmetric-key-format,
> public-key-format, private-key-format).  YANG “identify” statements (as
> opposed to YANG enumerations) are extensible.
>
> This work did not define support for PGP because PGP is never used in the
> NETCONF ecosystem and, well, we needed to draw the line somewhere ;)
>

Totally fair. I tend to read these models as generic use ones where other
people use it for more than netconf/restconf, but it is also fine that
those people
do the hard work.


> 2.1.4 Why not a pkix based grouping for all pkix operations?
>
>
> I think that you are saying something very specific here.
>
> Let me start with that X.509 certs do use PKI infra (e.g., CAs, CRL/OCSP
> distribution points, etc.).
>
> That said, you may be asking why this work doesn’t codify output from the
> PKIX WG, for which I guess I’ll point to my previous comment about needing
> to draw the line somewhere...
>
> Is there something specific you have in mind?  Maybe a Security
> Consideration?
>

No I just thought that pkix related elements might make logical sense to be
within its own substructure. But it was a comment, not a discuss. I don't
feel strongly.


> 2.1.4.2 What about hashed passwords (eg crypt(), PBKDF2, ARGON2, SCRYPT))
> and their parameters? I guess passwords here focus on the devices and their
> storage? not on password types received from a human or the network for
> validation?
> Which I would assume is the same reason we do not list PINs anywhere in
> the model
>
>
> Éric had a similar question.  The “password-grouping” enables
> configuration of authentication TO a peer, not BY a peer.   To address
> Éric’s comment, I made this change:
>
> OLD:
>    grouping password-grouping {
>      description
> -      "A password that may be encrypted.";
>
> NEW:
>    grouping password-grouping {
>      description
> +      "A password used for authenticating to a remote system.
> +
> +       The 'ianach:crypt-hash' typedef from RFC 7317 should be
> +       used instead when needing a password to authencate a
> +       local account.";
>

Ahhh ye sthanks that answers my question.


> And I just now added similar text to the body of the document (in Section
> 2.1.4.2):
>
>                 <li>The "password-grouping" enables configuration of
> credentials needed to
>                    authenticate to a remote system.  The
> 'ianach:crypt-hash' typedef from
>                    <xref target="RFC 7317"/> should be used instead when
> needing to
>                    configure a password to authencate a local account.</li>
>
> Does this address your comment?
>

Yes :)


> Section 3.8 states:
>
>        In order to thwart rainbow attacks, algorithms that result in
>        a unique output for the same input SHOULD NOT be used. For
>        instance, AES using "ECB" SHOULD NOT be used to encrypt values,
>        whereas "CBC" mode is permissible since an unpredictable
>        initialization vector (IV) MUST be used for each use.
>
> I didn't find this clear. How about something like:
>
>        To securely encrypt a password or key with a symmetric key, a
>        proper block cipher mode such as an AEAD or CBC MUST be used. This
>        ensures that a random IV is part of the input, which guarantees
>        that the output for encrypting the same password or key still
>        produces a different unpredictable ciphertext. This avoids leaking
>        that some encrypted keys or passwords are the same and makes it
>        much harder to pre-generate rainbow tables to brute force attack
>        weak passwords. The ECB block cipher mode MUST NOT be used.
>
>
> I swapped in your paragraph - thanks!
>

Awesome :)


>        However, comparing key strengths can be complicated
>
> Add "of different algorithms" ? Because comparing AES128 to AES256 is not
> complicated :)
>
>
> Good point.  I added "of different algorithms"
>

Ok.

I've cleared my DISCUSS,

Thanks!

Paul