Re: [Rats] do not address yang warnings by making nodes writable

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Mon, 08 March 2021 11:50 UTC

Return-Path: <J.Schoenwaelder@jacobs-university.de>
X-Original-To: rats@ietfa.amsl.com
Delivered-To: rats@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E025A3A0C33 for <rats@ietfa.amsl.com>; Mon, 8 Mar 2021 03:50:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_MSPIKE_H2=-0.001, 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=jacobsuniversity.onmicrosoft.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 HkEjq1mBr7K7 for <rats@ietfa.amsl.com>; Mon, 8 Mar 2021 03:50:27 -0800 (PST)
Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80057.outbound.protection.outlook.com [40.107.8.57]) (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 4C1E83A0C32 for <rats@ietf.org>; Mon, 8 Mar 2021 03:50:26 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dxd3XxN4OjqPLTxgHSIhSeMbfHOoXAkUUFZd9s8lQMigTniA4AR7eo5nDPJSiNS9LcTZPnaWZj4qrUqXWwD9+mcHWOVduenyhCo9PvFlw8R6pNhSsrl3+TggxCrf/NtuBrICR+Ew2Iga0E02V9zuG/8huZon2RMhvFSUuSmh7gzvdGztQsgL8opfvn1NNXMW1qwDiMXUykxhAC3q2c+WSZ8EZ+wXGOyiJwkUUULwLG1359jccXWff4YIYvcLcanmDDBjzNomp4WwDm3/UXcaDwU2MAx7UsspoTdcLuqCoi3qoS1zkUIq2kTMiIz0hrbFb2+YG3bsTbqhLvRVop7Olw==
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=8fdNHKt73iOJOAEy3gRT6vOb1nHd2xq4wbXZJxiiSn8=; b=S4CU1OGvB+cJljGpxSCou5xCMKM6TT66Dd/bIP0om706BZoPRCfl6BqEgr0YRjpJsR8GlITYT1ZdRzIA1CZjrdL5yc37a9t0lWN7diX3XSnX+Zi5bVj19EpGiy0i0tp1ru4lPo7KYDfkMTqBQ77/gnl1GlmjNkunu6swDnAX+d8nhGoQ4n9tcRrtXSTiNyzwIgf2SU9r8u2NgdyRH9AzT9A8/s3zeM+3Z9GE+pBj23Q8Z6xFFMNTIqlxg0FtjQt/CYQc+xOMz8+pgzUAXgEUmGqEDXu4NBQXtm9+LSBBzI5BLBeSWxAmpI8SqVKrcfzbYaFX2hlMRB6H1ai0BglNLg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8fdNHKt73iOJOAEy3gRT6vOb1nHd2xq4wbXZJxiiSn8=; b=O8PsMmLxlqs6d8US0Sqj+z+rw9RgNHTqDmTvOXcv/uI8eTPcEfvAQoFoSa72DLD7qjFdGXr9QtUAm1sENztmPbDDAvduyMwMdjL/fPYk2IBXWPDvrXF0YzmY0es1fnHRnfUmwt+3SdQ3+JSUAGvMJHIqMhLk+Igc6JxWk+v2EYk=
Authentication-Results: cisco.com; dkim=none (message not signed) header.d=none;cisco.com; dmarc=none action=none header.from=jacobs-university.de;
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23) by AM8P190MB0947.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:1da::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Mon, 8 Mar 2021 11:50:24 +0000
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM ([fe80::e8a2:9886:8dfa:41c6]) by AM0P190MB0641.EURP190.PROD.OUTLOOK.COM ([fe80::e8a2:9886:8dfa:41c6%4]) with mapi id 15.20.3912.027; Mon, 8 Mar 2021 11:50:24 +0000
Date: Mon, 8 Mar 2021 12:50:23 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: "Eric Voit (evoit)" <evoit@cisco.com>
Cc: Michael Richardson <mcr+ietf@sandelman.ca>, "rats@ietf.org" <rats@ietf.org>
Message-ID: <20210308115023.lhhbxxynjdcvltli@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: "Eric Voit (evoit)" <evoit@cisco.com>, Michael Richardson <mcr+ietf@sandelman.ca>, "rats@ietf.org" <rats@ietf.org>
References: <20210219131122.4b3qt7kgapmgv3ax@anna.jacobs.jacobs-university.de> <17694.1613745400@localhost> <20210219160103.26mds5wtenqtfbct@anna.jacobs.jacobs-university.de> <BL0PR11MB312290AB0F53053548E1D43DA1849@BL0PR11MB3122.namprd11.prod.outlook.com> <20210305111144.ptkqpler3rjmgx6i@anna.jacobs.jacobs-university.de> <BL0PR11MB3122D8926C5143368F4C77C5A1969@BL0PR11MB3122.namprd11.prod.outlook.com> <20210305155245.p23ab4isvpn2vxdo@anna.jacobs.jacobs-university.de> <BL0PR11MB31227B686A7EE19225F91EB7A1969@BL0PR11MB3122.namprd11.prod.outlook.com> <20210305165859.evgne3amtovj635u@anna.jacobs.jacobs-university.de> <BL0PR11MB31229018322B4AE74C48751FA1969@BL0PR11MB3122.namprd11.prod.outlook.com>
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BL0PR11MB31229018322B4AE74C48751FA1969@BL0PR11MB3122.namprd11.prod.outlook.com>
X-Originating-IP: [212.201.44.244]
X-ClientProxiedBy: AM0P190CA0022.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::32) To AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from localhost (212.201.44.244) by AM0P190CA0022.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Mon, 8 Mar 2021 11:50:24 +0000
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 8c5f3df5-c05e-46fd-dc7c-08d8e2285c00
X-MS-TrafficTypeDiagnostic: AM8P190MB0947:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <AM8P190MB0947AF1982BB44A82D964B1ADE939@AM8P190MB0947.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:8882;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: fN13jUKW5TTIozctRUfk2GtPh3PdOwRjt+m/D32viis1NxhZLa+bLFS45PfXom699yNtSjKi4htKPZHWGPAiK8qJrjhP98eaneeKK534GssTpPdoZ6pbNQ2u+e9tW8E2EDQE34JJV04PZXQHbXEy6I9YVnItcxEAkAfDAtB9gWwtP2j22g+R9tEYUACdbKQ+AlqC1+B+E+gWKMmq306/WanGuUsnqYdmoPULkzK/A/0zjEZ0RUCwDmt8iD8S5nh4+9U10ONV9YmddixvNsFSRLamoeEuLNckz+6zL94I5MuLEEFfO3RwRUF9jIPCWYwcNycAaUVhQmUojkea2ZJUasHCQu4SEnLCF6Cx8DIi98L6d+owkH8jFXUZLGhGYY+U2nQApPXMMWl74Kyk+/AEJwpK/LKYIjTAaWtUAz+ZLfOW08sfibOde7pWY433hSDAngu36ymi5E7Lxyzdl+T1TJveoH581PmDjh39CgcVKIOtU4gHkSF99e6avG/03k/qU0RLWjHFa8bEQuXZhSBE5woheTyhu5pBCthMUCcB9L1snxKsIVxzHC+8A7vQzkyiTybI3yNi+An+Iz5mjQLHmUo+01Dr1eZe5nn4p+yvHa4=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0P190MB0641.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(366004)(39850400004)(346002)(376002)(396003)(136003)(6916009)(26005)(786003)(316002)(956004)(3450700001)(83380400001)(186003)(1076003)(5660300002)(66556008)(6486002)(8936002)(66476007)(4326008)(8676002)(52116002)(16526019)(6496006)(3716004)(86362001)(2906002)(66946007)(478600001)(54906003); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?ZLC4tSimxFWjbIVQHczrHB6VpXb1ezJHS7Z7s6jnw+ewhbiNh+u34LTtgBqO?= =?us-ascii?Q?YEZuyzlAZTJGJuvgQANs18V846QrmsLr2UrCRz4fiqN49zik6wHSXnVjFCzQ?= =?us-ascii?Q?o31kzQ7WkGrkYHRuI4fFcDyDVx8vpNebqjf0f/Qe8JVieGbmvUm+wEsuRxX/?= =?us-ascii?Q?sZNGMJfGJVTvkdd4gMxVukGTLRJ6FVJe5MH9EGfMjeogb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YPYDzlkL4gQ6qkkMQgpNK+enmpGJ6epbcSf9dGITb5mHZa?= =?us-ascii?Q?fgxJi0ZK6OM6rIwTGLRGUzGwo938gTN9ncK7/EZdE+oyBN3C3xAYwBjKE6dn?= =?us-ascii?Q?3jcN1vNwaw/hmHmxE2Oaiuk2jX3QW4TaBaSf6BleDBGwGGehU7FcfweeSbap?= =?us-ascii?Q?auRGeix7PDgx/VTeif2QRKYr58dHEHJ8viuKiKtf9ol0NL4aSqgqNXK6JBlp?= =?us-ascii?Q?TVdyTGW7pQx1YCJixokOypw7?=
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: 8c5f3df5-c05e-46fd-dc7c-08d8e2285c00
X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0641.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2021 11:50:24.4777 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zY6E90spyB86y2eRdohnvMW+bm+cmYBKaeK7nMf/GAdTzAQEywILFQcb0+YDNqWlYi5mgiSs3FhzNyO5BqbonxvvIbYHdjo1GFUFuCDIUDA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P190MB0947
Archived-At: <https://mailarchive.ietf.org/arch/msg/rats/jiq9kyqJ1eWEaMDn3o3ehRAiO9E>
Subject: Re: [Rats] do not address yang warnings by making nodes writable
X-BeenThere: rats@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Remote ATtestation procedureS <rats.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rats>, <mailto:rats-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rats/>
List-Post: <mailto:rats@ietf.org>
List-Help: <mailto:rats-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rats>, <mailto:rats-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 08 Mar 2021 11:50:30 -0000

On Fri, Mar 05, 2021 at 06:30:10PM +0000, Eric Voit (evoit) wrote:
> > From: Juergen Schoenwaelder, March 5, 2021 11:59 AM
> > 
> > On Fri, Mar 05, 2021 at 04:23:27PM +0000, Eric Voit (evoit) wrote:
> > > Hi Juergen,
> > >
> > > > On Fri, Mar 05, 2021 at 03:42:54PM +0000, Eric Voit (evoit) wrote:
> > > > > Hi Juergen,
> > > > >
> > > > > Where you say "this config applies to TPMs version X", we are
> > > > > accomplishing a similar function via when statements,  E.g.:
> > > > >
> > > > >         uses TPM12-hash-algo {
> > > > >           when "tpm-firmware-version = 'taa:tpm12'";
> > > > >
> > > > > It is possible to place what is currently within these 'when'
> > > > > statement to instead be within the descriptions.  But using 'when'
> > > > > statements seemed a more robust approach.
> > > >
> > > > Except you had a broken config true node.
> > > >
> > > > > Based on our discussion, I can adjust that description of "leaf
> > > > > tpm-firmware-version" to:     "Identifies the cryptoprocessor API
> set
> > > > > supported.  This is automatically configured by the device and
> > > > > should
> > > not be
> > > > > changed."   This will eliminate the earlier text about a YANG
> warning
> > > and
> > > > > NMDA.  Is this a reasonable approach?
> > > >
> > > > Overwriting YANG semantics is not what you want. Perhaps you
> > > > actually want
> > > to
> > > > use a YANG feature to make parts of the model conditional to a
> > > > feature indicating different TPM versions. Of, you already have an
> > > > if-feature. It
> > > might
> > > > well be that I do not understand what you are trying to achieve.
> > >
> > > Unfortunately using an if-feature does not provide sufficient
> granularity.
> > > A device can concurrently support multiple TPMs, each potentially
> > > having either TPM1.2 or TPM2 firmware.  The model is trying to ensure
> > > that a specific instance of a TPM can only be configured to use a valid
> subset
> > of
> > > the allowable algorithms permitted by the type of firmware available.
> > >
> > 
> > But then the config needs to say to which TPM and TPM type (version) it
> applies.
> > And in case there is a mismatch, the config does not get applied or even
> > rejected. 
> 
> I believe the current model accomplishes this, without the need for placing
> the constraining information in the description.  More below.
> 
> > From the interfaces YANG model:
> > 
> >          leaf type {
> >            type identityref {
> >              base interface-type;
> >            }
> >            mandatory true;
> >            description
> >              "The type of the interface.
> > 
> > 	      [...]
> > 
> >               If a client tries to set the type of an interface to a
> >               value that can never be used by the system, e.g., if the
> >               type is not supported or if the type does not match the
> >               name of the interface, the server MUST reject the request.
> >               A NETCONF server MUST reply with an rpc-error with the
> >               error-tag 'invalid-value' in this case.";
> >            reference
> >              "RFC 2863: The Interfaces Group MIB - ifType";
> >          }
> > 
> > The point here is that the config explicitly says what is
> required/expected and
> > the server reacts to it. I configure
> > 
> > <tpms>
> >   <tpm-name>tpm42</tpm-name>
> >   <tpm-firmware-version>taa:tpm12</tpm-firmware-version>
> >   <TPM12-hash-algo>taa:TPM_ALG_SHA1</TPM12-hash-algo>
> >   <!-- -->
> > </tpms>
> > 
> > and this gets applied if there is a tpm42 which supports taa:tpm12.
> 
> I agree there are lots of similarities to the interface model.  In the
> interface model, you have:
> 
>      +--rw interfaces
>         +--rw interface* [name]
>            +--rw name                        string
>            +--rw type                        identityref 
> 
> And in this model we have:
> 
>    +--rw tpms
>       +--rw tpm* [tpm-name]
>          +--rw tpm-name                        string
>          +--rw tpm-firmware-version    identityref
> 
> In both cases above the device itself should recognize the hardware
> instances and configure those objects appropriately.

I do not think the interfaces model has a config true leaf saying:

            "Identifies the cryptoprocessor API set supported.  This
            cannot be configured.  However it is referenced via XPATH
            as part of configuration, so is shown as 'rw'
            to eliminate YANG warnings related NMDA.";

This is what got this discussion started.

> Now looking at the
> other object in the tree above "TPM12-hash-algo", i.e.,
> 
>    +--rw tpms
>       +--rw tpm* [tpm-name]
>         +--rw TPM12-hash-algo?        identityref
> 
> This object can only be provisioned if that identityref also exists in
> container "attester-supported-algos".  This container identifies which TCG
> algorithms are available for use the platform.  This allows container also
> has the benefit of allowing an operator to limit algorithms available for
> use by RPCs to just a  desired set from the universe of all allowed by the
> firmware.  To see more, check the descriptions of:
> 
>    +--rw attester-supported-algos
>       +--rw tpm12-hash*                 identityref {taa:TPM12}?

My point is that TPM12-hash-algo is having

          when "tpm-firmware-version = 'taa:tpm12'";

and hence tpm-firmware-version needs to be configured for this to
be meaningful.

/js

PS: I find the mixed capitalization and hyphen/underscore style
    confusing

    leaf TPM_QUOTE2 {
      type binary;
      description
	"Result of a TPM1.2 Quote2 operation. This includes PCRs,
        signatures, locality, the provided nonce and other data which
	can be further parsed to appraise the Attester.";
      reference
        "TPM1.2 commands rev116 July 2007, Section 16.5";
    }
    
    As far as I understand, TPM_QUOTE2 is the name of an operation
    and not the name of its result. So is this meant to be the
    serialization (network byte order?, alignment?) of the Outgoing
    Operands? Is the exact format of the binary blobs well defined?

    When I search for binary in the I-D, I hit quite a few leafs where
    the description does not tell me much what the binary format will
    be.

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>