Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1755060ybl; Tue, 3 Dec 2019 12:08:17 -0800 (PST) X-Google-Smtp-Source: APXvYqyJlZefMTtCu+4pBvoxCqgj96CtQy2IFK6l4xr7KaRgUyvZ+lbxPQdjuMI8rLOJkMklOnsD X-Received: by 2002:a9d:6f0a:: with SMTP id n10mr4883660otq.54.1575403697083; Tue, 03 Dec 2019 12:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575403697; cv=none; d=google.com; s=arc-20160816; b=bMGKwg09zkTyCbVfGhuojmo8/woRkPuQ8Fe3WqOEPrvwxQ00oSKunWducsauywzHCA PXygygg7s6yvAqOuZ5myUvc6syHA5LJuSjtQMHBwinbpWsNKOpiqllpFuhuqlYimQpJV WRS/C+6vytE3m98QV4D6OIc8GaiZKYifIlFYcAgOPl4/lqoTnciLvfvv2TLj84slBIzp AG789zU4JIttgAL80yjrDCXDWN/Rxz4rrjEd6Nhr8FtMY7/tZDPdNBBas/Ys3uVT3Oe9 tpWCcT8yAvGZpMOveu7/D/u/IAlrsuJAlRYEdiDJ8ZEWdZgA+YHpUSEtGrMypVDXN6GW si2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=Wrywg5OBeiXq6ACVmHlxoh5D/W+qKuFNUF4oNRnulBg=; b=ZLYMzGb6iL4JcCHOidI1AhTe/7c+HiCwwXWPHSNm/HfNvA62AdAONomsN9rnAIzJ6Z WDzPMuxNaUmLbTt19J2hjNJU561Vx87yd6XIeu/32i3uL4CjBHb0LMCwsUOHjKsCp68R mGcK8n8ZDTx4kd/4ysDLJJWQRuDcDkU+iTXxAS0yGhtq/N2yWQzkocCmV3EzP4vDEY+E 3sbE+tj7qUAICI3fOhoo3to/n2Sdyib8J5tl+kaiH3z4P81WoLeYHa0KNoWTgCByx/rf mnvqwX1Q8WCwZ7WGC7aOf8B6rgwhfdYthouqJx9TYGYI+X8huDr4H624nBvi2GtdfTnW Ix2w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13si1810387otp.27.2019.12.03.12.08.04; Tue, 03 Dec 2019 12:08:17 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727048AbfLCUHH (ORCPT + 99 others); Tue, 3 Dec 2019 15:07:07 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38724 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbfLCUHH (ORCPT ); Tue, 3 Dec 2019 15:07:07 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB3JbGg1137232 for ; Tue, 3 Dec 2019 15:07:04 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wnehynnnu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Dec 2019 15:07:04 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Dec 2019 20:07:02 -0000 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 3 Dec 2019 20:06:59 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xB3K6HcB40567262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Dec 2019 20:06:17 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24DF1A4053; Tue, 3 Dec 2019 20:06:58 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 161CFA4055; Tue, 3 Dec 2019 20:06:57 +0000 (GMT) Received: from dhcp-9-31-103-87.watson.ibm.com (unknown [9.31.103.87]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 3 Dec 2019 20:06:56 +0000 (GMT) Subject: Re: [PATCH v9 5/6] IMA: Add support to limit measuring keys From: Mimi Zohar To: Lakshmi Ramasubramanian , linux-integrity@vger.kernel.org Cc: eric.snowberg@oracle.com, dhowells@redhat.com, matthewgarrett@google.com, sashal@kernel.org, jamorris@linux.microsoft.com, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org Date: Tue, 03 Dec 2019 15:06:56 -0500 In-Reply-To: <2d20ce36-e24e-e238-4a82-286db9eeab97@linux.microsoft.com> References: <20191127015654.3744-1-nramas@linux.microsoft.com> <20191127015654.3744-6-nramas@linux.microsoft.com> <1575375945.5241.16.camel@linux.ibm.com> <2d20ce36-e24e-e238-4a82-286db9eeab97@linux.microsoft.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19120320-4275-0000-0000-0000038AAE63 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19120320-4276-0000-0000-0000389E4DE6 Message-Id: <1575403616.5241.76.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-03_06:2019-12-02,2019-12-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=3 impostorscore=0 mlxlogscore=853 priorityscore=1501 mlxscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912030144 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-12-03 at 11:45 -0800, Lakshmi Ramasubramanian wrote: > Hi Mimi, > > On 12/3/2019 4:25 AM, Mimi Zohar wrote: > > > > > A keyring can be created by any user with any keyring name, other than > >  ones dot prefixed, which are limited to the trusted builtin keyrings. > >  With a policy of "func=KEY_CHECK template=ima-buf keyrings=foo", for > > example, keys loaded onto any keyring named "foo" will be measured. > >  For files, the IMA policy may be constrained to a particular uid/gid. > >  An additional method of identifying or constraining keyring names > > needs to be defined. > > > > Mimi > > > > Are you expecting a functionality like the following? > > => Measure keys added to keyring "foo", but exclude certain keys > (based on some key identifier) > > Sample policy might look like below: > > action=MEASURE func=KEY_CHECK keyrings=foo|bar > action=DONT_MEASURE key_magic=blah > > So a key with key_magic "blah" will not be measured even though it is > added to the keyring "foo". But any other key added to "foo" will be > measured. > > What would the constraining field in the key may be - Can it be SHA256 > hash of the public key? Or, some other unique identifier? > > Could you please clarify? Suppose both root and uid 1000 define a keyring named "foo".  The current "keyrings=foo" will measure all keys added to either keyring named "foo".  There needs to be a way to limit measuring keys to a particular keyring named "foo". Mimi