Re: [Suit] Parameters and Commands

Adrian Shaw <Adrian.Shaw@arm.com> Thu, 27 February 2020 14:26 UTC

Return-Path: <Adrian.Shaw@arm.com>
X-Original-To: suit@ietfa.amsl.com
Delivered-To: suit@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B7B663A09EF for <suit@ietfa.amsl.com>; Thu, 27 Feb 2020 06:26:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=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=armh.onmicrosoft.com header.b=jZsBEbj3; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.b=jZsBEbj3
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 mjD6Q3X9Y05p for <suit@ietfa.amsl.com>; Thu, 27 Feb 2020 06:26:25 -0800 (PST)
Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0621.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::621]) (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 AEA5E3A09F2 for <suit@ietf.org>; Thu, 27 Feb 2020 06:26:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hJpvFULHfSJp2qU5uo7hpOQoibVhyAbE+tuou18GPkY=; b=jZsBEbj3dTWUSfxnps+HiEpY3k1rJGB/fU4SHyKUSCb2RaGye8dYtKgVzKsrrfUtz0rJ/Od5s/cheAcLgvOWxPYdcRj4Pwa0CvSbeCQT+4DZC09KjSVqsYkUJIxARvNnxA3qTQIGSBO76QOGKfx2iVoYWLcCOFZ5T2v273FI9DQ=
Received: from HE1PR0802CA0005.eurprd08.prod.outlook.com (2603:10a6:3:bd::15) by AM0PR08MB4930.eurprd08.prod.outlook.com (2603:10a6:208:157::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.22; Thu, 27 Feb 2020 14:26:21 +0000
Received: from VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::201) by HE1PR0802CA0005.outlook.office365.com (2603:10a6:3:bd::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14 via Frontend Transport; Thu, 27 Feb 2020 14:26:21 +0000
Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; ietf.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;ietf.org; dmarc=bestguesspass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT005.mail.protection.outlook.com (10.152.18.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15 via Frontend Transport; Thu, 27 Feb 2020 14:26:20 +0000
Received: ("Tessian outbound efdea641ed36:v42"); Thu, 27 Feb 2020 14:26:20 +0000
X-CheckRecipientChecked: true
X-CR-MTA-CID: fae457939789ebc0
X-CR-MTA-TID: 64aa7808
Received: from e7927faacce3.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 052A4515-8B4C-401B-A3C4-63E362DA9A71.1; Thu, 27 Feb 2020 14:26:15 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e7927faacce3.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 27 Feb 2020 14:26:15 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GGN38CNe3ATzvJY+/ATUy6OuxnYmxEGlkNCVPO1wujUWigoboUO9HHmcF+yBlCQzA2NQ/2kZXkyxQNTMmzDNJ0BD2ei4e3EKhlHi22tAgpRdDWC+eDOWyEMNFJDKLwrDB26mvuwAusKOlImDrjKklVpH/YspgfLz55T1wcgUOwB08FZdaNx5n7t1/Bm8DBMIhowg+I7Ec+D2N/MEXOv5VTs1dL86gHXCIkDVlRgv7jbeElNiysgAM1B54DKvPwPSpeFsw4lBC2l/x2Qy8pmivsreiZhqydPflQAJ6g7FhF1Eq2sElD3fNglA0vE/Z0HV5aYyj2buesL0sq4/TqvL/w==
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=hJpvFULHfSJp2qU5uo7hpOQoibVhyAbE+tuou18GPkY=; b=oUmRc6wsAva05IAXSmygSDi1+MaI+fYOIurDIRT2IKpI/JJBghs3RhfZ3tvfPUqE2xTTEw9iMq+uGH2grsPcadFoVFm5Lo1Pslsn8Z1SvOFnr775c16D70bOVr/JelZvO/pdKjIEwXhx/S//OJirR3n4fLLxREYRO9kYjzcijqnJ48nzGErwftlWEKCmFWlkl5VxW3ZdQxB85cRDKFIPEkCOOR+E9Oi8hYIcUgFt82a4l4CSYO+0yUftv6C6UeV8+0E8fTdbDXYQ3dWRLja0NoRNcdsxi6ZQSNOjfh7gD/kWHxlb5EISrO8yu1HxWxrgj7TlnzGqdtQ4oDJlzbYrSw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hJpvFULHfSJp2qU5uo7hpOQoibVhyAbE+tuou18GPkY=; b=jZsBEbj3dTWUSfxnps+HiEpY3k1rJGB/fU4SHyKUSCb2RaGye8dYtKgVzKsrrfUtz0rJ/Od5s/cheAcLgvOWxPYdcRj4Pwa0CvSbeCQT+4DZC09KjSVqsYkUJIxARvNnxA3qTQIGSBO76QOGKfx2iVoYWLcCOFZ5T2v273FI9DQ=
Received: from VI1PR08MB3568.eurprd08.prod.outlook.com (20.177.59.211) by VI1PR08MB5501.eurprd08.prod.outlook.com (52.133.246.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.21; Thu, 27 Feb 2020 14:26:13 +0000
Received: from VI1PR08MB3568.eurprd08.prod.outlook.com ([fe80::9c45:88d7:93fb:15a7]) by VI1PR08MB3568.eurprd08.prod.outlook.com ([fe80::9c45:88d7:93fb:15a7%4]) with mapi id 15.20.2750.021; Thu, 27 Feb 2020 14:26:13 +0000
From: Adrian Shaw <Adrian.Shaw@arm.com>
To: Brendan Moran <Brendan.Moran@arm.com>
CC: suit <suit@ietf.org>, Koen Zandberg <koen@bergzand.net>, Emmanuel Baccelli <Emmanuel.Baccelli@inria.fr>
Thread-Topic: [Suit] Parameters and Commands
Thread-Index: AQHV7XQQQA0i3AEJykizdfj2dpCACagvGNGA
Date: Thu, 27 Feb 2020 14:26:13 +0000
Message-ID: <5CBBCF38-5431-4BF7-891D-E4451ECDEAC5@arm.com>
References: <27913A6B-F42C-4AA9-8A7A-64B1D546C13C@arm.com>
In-Reply-To: <27913A6B-F42C-4AA9-8A7A-64B1D546C13C@arm.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Adrian.Shaw@arm.com;
x-originating-ip: [217.140.106.53]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: d811dd93-4135-4110-e77a-08d7bb910414
X-MS-TrafficTypeDiagnostic: VI1PR08MB5501:|VI1PR08MB5501:|AM0PR08MB4930:
x-ms-exchange-transport-forked: True
X-Microsoft-Antispam-PRVS: <AM0PR08MB493036996B886FB482649F34F9EB0@AM0PR08MB4930.eurprd08.prod.outlook.com>
x-checkrecipientrouted: true
nodisclaimer: true
x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000;
x-forefront-prvs: 03264AEA72
X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(189003)(199004)(6636002)(86362001)(53546011)(6506007)(26005)(966005)(316002)(186003)(6486002)(71200400001)(54906003)(37006003)(36756003)(478600001)(8676002)(33656002)(2616005)(81166006)(81156014)(8936002)(4326008)(91956017)(66946007)(76116006)(6512007)(5660300002)(66446008)(66556008)(66476007)(64756008)(2906002)(6862004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB5501; H:VI1PR08MB3568.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: GjmBbM3Z6qQiawIjFmYaX+oCQVVJUwMTBFLYYrxXzBu5vJb71uOlPENiD84WiXHJS5wJTPXAXJUMxGNUeFh5FSqeloJSrIc4+K7cr5GfCIrrHWKl/zFiNbIxj9deJJ0eQRyQ6TQ1qsH+UChFAcUdy9H81BZDU6P5j6E4g6m62JInpc1whTRHwOgJjYIko2iA9AjE3zRf0WvzYQFjyxNRmh2b7/JONv3k4sX9hQSXk8qMcvAoyQG6e8t7TZTEER58Aexgr8fkxjTnx0+V7f3yKyBSSCPDOE5jzRfrcaOJArGOgdZt62iXFHrz4jJ4ROS9YHTQpNDyYbp42A8XqJgOKwECO0qMy0AoSxGf4fBVwwvgRa2N1PbIbGGsI7/ZtRg1Da+oai1M0fq8KUpKjo9RebUMxjf9jqJWBwZnlWko4ySANoIuJyaLY1UUGZMjFfajLKsU4IeTsg/gghC5aeMJ5PQkEbufY8rgizpm13ywUk3CMU9TdRN6cOpfbyZRftXJ73I1DO0JjYfkODh7kWMaHw==
x-ms-exchange-antispam-messagedata: mxfoAzXIVz2Ysa4U3N++s64y/dFpr67XF/1GBKu0Vpj9esF1S4ciXXSluoOAVyIO5Ol5wO61TtD5uW/qaIixOSngqmobzJaSz/QV5FhV2MRmI6UoeOiumGxys+Hc+tU7hySUCIM+fGtK1n766UmPVw==
Content-Type: multipart/alternative; boundary="_000_5CBBCF3854314BF7891DE4451ECDEAC5armcom_"
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5501
Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Adrian.Shaw@arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(39860400002)(396003)(199004)(189003)(37006003)(2616005)(316002)(6506007)(6862004)(36906005)(33964004)(107886003)(53546011)(86362001)(2906002)(45080400002)(54906003)(33656002)(8936002)(6486002)(81156014)(81166006)(5660300002)(6636002)(70586007)(70206006)(478600001)(26826003)(336012)(26005)(30864003)(6512007)(36756003)(966005)(4326008)(186003)(356004)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB4930; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1;
X-MS-Office365-Filtering-Correlation-Id-Prvs: 4afcab14-9310-4aac-f043-08d7bb90ffd5
X-Forefront-PRVS: 03264AEA72
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: rvT3vRcQGvsf+cR0CrW+tTYPHbqc8PP+xwzk+d3kuWCXohWZlbjeLPb2NRy21+gku+73CWlWuzrqLeM96iGq9gUQ7ltWKzd9O3glGIgzbSH1jouEpQ9DUlIhNPZriLVyw/xik6clNl6WXDNzLTphNNRyAHAnd1/4FZgFeXIlpPpZLV0AZZUHtdbUnhJ1xB6VNblBs+A5WIYHVWufUPdcszNfd15tYs6QuJqrhAZIEoQ+icfrQ6XtOj0goylGKqA0A1KNBjJDgXOhaCVnm7sg8XeT+XX9z2PA6k91XchdvjqM0wmx/WpU1qkKgS3NFfDWlRZQr7Vb0k8yf4uw+tLGq+ZzHWLek2kfpwNvA2MVHuQq/Q/W88/Z9E8DgjJ4YHzrml7n8uIh7kGbF9IALfzvnTU+gfSJluAYQoUb857BUoYpC7bsAmHHAa+C2QIqiwhJl5o+HuQNP74Zbs3GvkXGBbiESEjfGYm23yXmOmOQHtpvN28z7e6vSPI8DlFo85GKKmryNGPhDcfAFNce8MCpmw==
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2020 14:26:20.7914 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d811dd93-4135-4110-e77a-08d7bb910414
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4930
Archived-At: <https://mailarchive.ietf.org/arch/msg/suit/30jqAKqGxrqmRMspfKEDfypDX34>
Subject: Re: [Suit] Parameters and Commands
X-BeenThere: suit@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Software Updates for Internet of Things <suit.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/suit>, <mailto:suit-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/suit/>
List-Post: <mailto:suit@ietf.org>
List-Help: <mailto:suit-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/suit>, <mailto:suit-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Feb 2020 14:26:28 -0000

Hi Brendan,

We have also discussed the possibility of defining attestation policy within SUIT. This would mean that we need flags to indicate to the parser which measurements should be reported. For example, a Vendor ID, an image digest, or a component offset might need to be reported in the attestation report. Each of these is checked by a condition. Each of those conditions will consume a parameter under this model. Then, the argument can indicate: report a measurement, do not report a measurement, report a measurement only if comparison is successful, or perhaps other attestation-related policies. Bear in mind that attesting a failed condition may be helpful for attesting why a manifest has failed, as we discussed in the hackathon and virtual interim meeting.

To me it doesn’t make much sense for the signer to define the measurement policy. The signer shouldn’t be trusted for that particular purpose.

Just as a simple example:

If a signer of a non-secure image decides to say "don’t measure me”, and the platform blindly obeys that directive, then the platform cannot accurately describe what the software state is during an attestation.

Alternatively, the manifest may decide to tell the installer to measure things that are not security relevant, whilst deliberately avoiding the parts that are security sensitive. Yes, the metadata is signed, but that only tells you who made the image. In the real world a firmware image wouldn’t tell a secure boot system what to verify and what not to verify, and is a similar case here.

There is also the possibility where, for some particular scenario, you don’t necessarily trust whoever signs the non-secure image, but you want to be able to convey to a remote party what image _is_ installed. In this case, you shouldn’t be trusting the measurement instructions from the non-secure manifest.

In essence, the thing being measured should not have any influence on the measurer, since that would not be a chain of trust. It should be the root of trust’s responsibility to decide what is reported.

Let me know if I’ve misunderstood something, as I may not have the full context.

Cheers,
Adrian

On 27 Feb 2020, at 13:44, Brendan Moran <Brendan.Moran@arm.com<mailto:Brendan.Moran@arm.com>> wrote:

During the hackathon, I discovered that my examples and my manifest generator tool are generating incorrect sequences for testing vendor ID and class ID.

There are currently two ways to handle commands (conditions or directives):

  1.  The command consumes an argument (that is the value that follows the command's key)
  2.  The command consumes a parameter (that is a value set by the “set-parameters” or “override-parameters” commands)

This duality led to my error in setting up the Vendor and Class ID tests in the demo code.

The reasons for each mode are:

  1.  Command consumes an argument
     *   Encoding is more compact (encoding via parameters takes 2-3 more bytes, depending on the situation).
     *   Less storage needed (the argument is consumed immediately)
     *   Does not require matching parameter key
     *   More explicit association between command and argument
  2.  Command consumes a parameter
     *   More compact when the parameter is used more than once (e.g. image digest)
     *   Allows override by dependencies, when set-parameters is used


We’ve talked before about “only one way to do things” and I think I can see a path to making that the case here. Here is my proposal:

Commands consuming a parameter are absolutely necessary due to override and deduplication concerns. Conditions testing against an argument are convenient and more explicit. Therefore, harmonising around a single option probably means that we have to select parameters instead of arguments:


  1.  Eliminate arguments from most commands (see below)
  2.  Match most parameter keys with command keys to simplify the association, make “arguments” more explicit

Only these commands require arguments, since they either deal with setting parameters, setting parameter scope, or with flow control, which requires nested command sequences.


  *   Set Component Index
  *   Set Dependency Index
  *   Set Parameters
  *   Override Parameters
  *   Try-each
  *   Run Sequence
  *   For Each Component

This leaves the majority of commands with NUL arguments. This is actually quite useful for another feature.

We have also discussed the possibility of defining attestation policy within SUIT. This would mean that we need flags to indicate to the parser which measurements should be reported. For example, a Vendor ID, an image digest, or a component offset might need to be reported in the attestation report. Each of these is checked by a condition. Each of those conditions will consume a parameter under this model. Then, the argument can indicate: report a measurement, do not report a measurement, report a measurement only if comparison is successful, or perhaps other attestation-related policies. Bear in mind that attesting a failed condition may be helpful for attesting why a manifest has failed, as we discussed in the hackathon and virtual interim meeting.

If we are making the majority of commands are using parameters instead of arguments, this becomes trivial: the arguments are replaced with attestation policy arguments. This allows us to tell the attestation engine explicitly what to report from the manifest, which allows secure, dynamically updatable attestation policy.

This doesn’t introduce a substantial change to either the parser or the format. If there is some appetite for simplifying the correlation between commands and parameters, I think it might make sense to spend some effort aligning parameter keys with command keys. This could simplify the parser by allowing a generic parameter lookup to be done in one place, rather than by each handler.

Best Regards,
Brendan
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_______________________________________________
Suit mailing list
Suit@ietf.org<mailto:Suit@ietf.org>
https://www.ietf.org/mailman/listinfo/suit

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.