Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1532336ybx; Thu, 7 Nov 2019 13:14:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxbFp1Hwrqr6Zxvt9A9auO8vwKJ7/0T73Q6BsjBnKF6b1xdXpxohkTg8zlqttC/griuAuv5 X-Received: by 2002:a17:906:da1d:: with SMTP id fi29mr4430058ejb.26.1573161288747; Thu, 07 Nov 2019 13:14:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573161288; cv=none; d=google.com; s=arc-20160816; b=anUGGaQ1v2ArsFnr6njODh+qXUesl3aDNzBLBLRgg0+M+55LuhG03RE9AJ96bc30m7 Jij4osLXR1O4kJOiMveMw+YRCl2F62Wf1c7zxEj6Qm8cz1Krww136TyBLH+YXQEpruJj OsFBAChnfTXDzo16mWANZatIqFariJqKQTFbI0Bk5gpph2LPqORgL2Yq0pp2ntC8EO3A OtNuNOapPOTHEgXP5ftRKxTt4iPqPg/or0ylY3lJ4/e4W4vfyQM/uLy04twpGHj7HwhS BOBaEnXZIYnX7XUe//GjxqZXqkjqEEPJooEO0e9X8ADcFAUHPlFH5yNGJugcAT9nhVOP bP2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature:dkim-filter; bh=Dq/RMVhen0d8e7vLNzh46Ixy8AtVy3mHTdjNkp6DDic=; b=dkW5qBrR/mtKwq9xlMoa9zbc/dXcd8BV0ims6NapH6zstbqMHxzqx2w+IlOMErIWCn g0b7qy7pAUaaAjbCsWP0cfrEHmW1OidM7CxiE+NFoTnuNW2c+a945uw61uCw+zv8tUQe FT6yJ/qFYFsgcpAFLuWFXhxA1TgeAnXaSiC/rjtufazwfxiJ8DrCcoUhzAGNLHoJZUYj 3IUAYasJAR6mqoPOKb0+73ImmmW+YOHkzQ4zbPC5FJqJNcGdy3a7TBHpC7TX3/MGiTH/ j2t1csL5FskdkhgkjmVT/eTTZo7uHfKsXBu7axCcZpHws4hSbOgawchVMNs1ob4A6MOz 2eZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=RsCmziqV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jz21si2236165ejb.422.2019.11.07.13.14.24; Thu, 07 Nov 2019 13:14:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=RsCmziqV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727666AbfKGVMd (ORCPT + 99 others); Thu, 7 Nov 2019 16:12:33 -0500 Received: from linux.microsoft.com ([13.77.154.182]:51254 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbfKGVMc (ORCPT ); Thu, 7 Nov 2019 16:12:32 -0500 Received: from [10.137.112.108] (unknown [131.107.174.108]) by linux.microsoft.com (Postfix) with ESMTPSA id D7C8820B7192; Thu, 7 Nov 2019 13:12:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D7C8820B7192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1573161151; bh=Dq/RMVhen0d8e7vLNzh46Ixy8AtVy3mHTdjNkp6DDic=; h=Subject:To:References:From:Date:In-Reply-To:From; b=RsCmziqVUticNS68QSUKws2DrO/UoBxa18Xihwt7iTe2TWPIwRFs2LZFzAuuc81rf TgtkRW1ijozgN/gAv2RBqRE4lX95WRbLSiduik0gDhQnofP8Qw2TL36s8p3AloT1bt cHuoPTE1ia1FG49S/gVjrWY+89+JmgV+BNKG4WRs= Subject: Re: [PATCH v4 01/10] IMA: Defined an IMA hook to measure keys on key create or update To: Mimi Zohar , dhowells@redhat.com, matthewgarrett@google.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191106190116.2578-1-nramas@linux.microsoft.com> <20191106190116.2578-2-nramas@linux.microsoft.com> <1573080189.5028.313.camel@linux.ibm.com> <1573098037.5028.325.camel@linux.ibm.com> <7ce84aa0-729e-c58e-f16a-25490b4e336d@linux.microsoft.com> <1573159988.5028.400.camel@linux.ibm.com> From: Lakshmi Ramasubramanian Message-ID: Date: Thu, 7 Nov 2019 13:12:31 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1573159988.5028.400.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/19 12:53 PM, Mimi Zohar wrote: >> >> The measurement decision is not based on whether the keyring is a >> trusted one or an untrusted one. As long as the IMA policy allows >> (through the "keyrings=" option) the key will be measured. > > We should be able to measure all keys being loaded onto any keyring or > onto a specific "keyring=".   This shouldn't be any different than any > other policy rule.  Once you have this basic feature working, you > would address loading keys during early boot. Perfect - that's exactly how I have implemented it right now. Will continue to test it. >> Do you want only trusted keyrings to be allowed in the measurement? >> In my opinion, that decision should be deferred to whoever is setting up >> the IMA policy. > > Right, but it shouldn't be limited to just "trusted" keyrings.  This > way you can first test loading keys onto any keyring. Thank you. > Queuing the keys should be independent of measuring the keys. >  Initially you would start with just measuring the key.  From a high > level it would look like: > > ima_post_key_create_or_update(...) > { >    "measure key based on > policy(key, keyring, ...)" > } > > This requires the IMA "keyring=" policy option support be defined > first. > > Subsequently you would add key queuing support, and then update > ima_post_key_create_or_update().  It would look like: > > ima_post_key_create_or_update(...) > { > if (custom policy is loaded) >    "measure key based on policy(key, keyring, ...)" > else > "queue key(key, keyring)" > } > > Mimi Yes - I have the above change working. Will continue testing. thanks, -lakshmi