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

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 05 March 2021 16:59 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 A412A3A282B for <rats@ietfa.amsl.com>; Fri, 5 Mar 2021 08:59:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 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_DNSWL_BLOCKED=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 4rMFtA6V0BGk for <rats@ietfa.amsl.com>; Fri, 5 Mar 2021 08:59:03 -0800 (PST)
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70080.outbound.protection.outlook.com [40.107.7.80]) (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 D2AA43A282A for <rats@ietf.org>; Fri, 5 Mar 2021 08:59:02 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k6eBs6CJhiExBG3vvrVClLPRauq/9HjVPz9hbi7RjJ3GVPy1cYpUQKZsacQ88TcjL1eReCLuEvvz3ID4sb29vTUvy/RB82FKn7Zf4Ku8zSn7jkAOTBORKsrzAqJalelmzZwVc1cnagSHtUusr20vtNTKdhwFr13pJAebp9Bdap1b3BxVCdMp09kioFXZJchYkqvKqGWnuRBo0X0iYpsOP6OZYTP6GQ0C58pOAqDY+3LJYTmk2CrHtu34JdN7adEgMdIUJg04nqJ0PeSU3RDaDMTjH9w5J9dn4TuNr7JjWrMk1a3pQ6TMZWbgxcMEl/EEPP5wcRGXgTG3WMzOyJ85Yw==
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=XqH61IPJ3Pou2LI0yxChBjPMzyAeaFhDUOm+xPYLyvU=; b=RdINt/0W+wD3XSZZxMUpDou1//zWH8xakDy9uwxRSnxyQDtlxfIk8szyHCr22IlXExHOsMn/OP/y6T8pR5Qh8UN0wZ+W5ij0Fm8pZwSMwdxGnI+meEoWWnzkU+fOS6I0nO0QU815a3lW6jqyFqrlDc8evh2r/Lp9ijOCXhRxDwnoFOGVTNMW4l7Vowgd2gAUoKtUCWA6/pVj+sjZZUekoDHMkon1MUueNCIoPXphcgzl/idyzi8dOvDBu96rvlITWZq9BmSSf/unbWhK1h0j0XZvzcKS/3NRjapOT70JuINeMfNX+MGw1Ew99Jw9SU9gQKsSph5jNmaZj0NrNbVnkw==
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=XqH61IPJ3Pou2LI0yxChBjPMzyAeaFhDUOm+xPYLyvU=; b=Wo9tt9T6zVxoAO+/CzFz9BGnXBgKjSGicFcBTKHh6sdqyU1GIBvO5Eo3XLCk4zUAsMDq2iqTZd5SguOWaFKCJZIEKuM0CcANMaeGVoNXu17td1Fb17OzgHp1LmkYxciDejDUxgtI0Wd4RdeHN5tb0Trx/d2QaZh6eYF0nWkpojU=
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 AM9P190MB1331.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:26b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Fri, 5 Mar 2021 16:59:00 +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.022; Fri, 5 Mar 2021 16:59:00 +0000
Date: Fri, 5 Mar 2021 17:58:59 +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: <20210305165859.evgne3amtovj635u@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>
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BL0PR11MB31227B686A7EE19225F91EB7A1969@BL0PR11MB3122.namprd11.prod.outlook.com>
X-Originating-IP: [212.201.44.244]
X-ClientProxiedBy: AM0PR04CA0059.eurprd04.prod.outlook.com (2603:10a6:208:1::36) 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 AM0PR04CA0059.eurprd04.prod.outlook.com (2603:10a6:208:1::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Fri, 5 Mar 2021 16:59:00 +0000
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: cf4ac627-0257-4e95-ddf3-08d8dff7f921
X-MS-TrafficTypeDiagnostic: AM9P190MB1331:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <AM9P190MB133122E3A98EE0421C2BC8C6DE969@AM9P190MB1331.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:10000;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: PYh+vffbLlSS86mBdMLpa1yhEXpkG6IvKBs0WdFlVC+RnJzs+9W9LxNEYjhETYygvSX2Z7CP+GNYEERUIAABjv97hrKJQiRbDjdJXIKLm3NH3SRggTpPsQCthIsC45s45t7/ETBDceD3wugaMLYfe6SAsIoiwNCrlaIZvz3JR88f7nXn1ALlFX41mpEFw5hrqLRXka6O7qyDoqLpKlaOo+THbdnDjd+6+Uv3gyI2J3lNf3Y+Za1fN6bOtOCpzfaoJxWprXsh4l5n7ln1qIYiVHTSDBNmY8B2rzrpD7wyW4yGMZsnTRIQnoHUAHw1WrSwSEbmy98WrpwoxQiEf6jdW05m0IFjxD1T6eO10MTx7CIqsVIe5xgGHwQlA1xvuTkWZef2RE3wVQC4at8sUCYKRrv7J1WnS9CGUhRoQy10OqbfQMICLKGt8oQD+txXMt5mXWVlEiBeS1d3W3OwDWi1h8gxxL3SOj7UyafaL878ck3sXTSBx9HWX1r9znybUu+5dfrDD6PQI5NN0uXEnuIYh2eUzI1+OMZaz+poIWoAjfNw24jGDBIgkpcWffXyUrYyju3Y4VdpsGyPuyquIF+bPTV9E1EIpSqmipluRoS/6As=
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:(346002)(396003)(136003)(366004)(39850400004)(376002)(478600001)(956004)(26005)(16526019)(186003)(8676002)(3450700001)(8936002)(6916009)(83380400001)(6486002)(4326008)(6496006)(52116002)(786003)(54906003)(86362001)(66476007)(2906002)(316002)(66556008)(5660300002)(66946007)(1076003); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?XJycj6v5LsBcEGdiikbd5jVrEc512fvRvoHi2YLRryArj6nP+Tg+gYVTSNDK?= =?us-ascii?Q?8lpOlYmHev+I3yHC6Hq5ymtKGUFzZwpT5CxzwjtAol6n7rzBQiFXSkp9qg4c?= =?us-ascii?Q?3vh+sWMkVozy/w8F/nGIA3QDHRbEk3Z7a71QVhS3n+YoJesZqaO73Bji3Z6u?= =?us-ascii?Q?RKfMdVWoSw14XrHIaicl1urF1nf1Rlpv6nZmu+Ckrfe18RD4Ec3S8gQ0YOH6?= =?us-ascii?Q?yXw1klG1SdypCjE64lOuddf1B7ZhypkLMT+JmaSFHAduf0Fo0bZVL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Qgk8HzEa5vCprxJnpjuvGF2ob5QXk5YCMCWn?= =?us-ascii?Q?6BWWTci3ynLrUmbvv2g0A69BtKzd8HjOlLKQs4cgT69hh1azVFJ9aNzPSpzi?= =?us-ascii?Q?F86qSo/ERa2Vc1f9o0mV1kDCd2/oSatbq03MHz38NssNUPxFavGaG9jj8/NF?= =?us-ascii?Q?TD/qthJ5u2ud44EcQ9u5/CYL?=
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: cf4ac627-0257-4e95-ddf3-08d8dff7f921
X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0641.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 16:59:00.3961 (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: K4JT/ZJqraC9Ofy+s5YEo092mHy5icDRUkCRTTDLkMpfUoGW0KoeOC8253e5TPkGkIdXph5T0by6SqO6OcDeHG5G4WiODBlgA/B52VSUpvM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1331
Archived-At: <https://mailarchive.ietf.org/arch/msg/rats/mVgW2trlNJ-Im3qgf_xrpjm7vv4>
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: Fri, 05 Mar 2021 16:59:06 -0000

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. 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.

/js

PS: The example writing also revealed that there is little consistency
    in the naming, sometimes you prefix leaf names, sometimes you
    don't, sometimes you use capital letters, sometimes you use
    underscores then again hyphens etc.

    If you prefix leaf names with the module prefix, you end up with
    tpm:tpm-name and now that I write this it seems odd to call the
    prefix tpm since this is not really about configuring TPMs but
    remote attestations using TPMs. (I would rather leave the tpm
    prefix to a YANG module dealing with TPMs in general. Well,
    perhaps there is the beginning of a generic TPM module hidden in
    here, but then it might be useful to actually factor this out.

-- 
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/>