Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4394690ybi; Mon, 3 Jun 2019 10:07:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgT+9PdRRtzIXb6qzWCRfp0eyo19/oOrvoRnM0lys+xXKb4v+hBtnsFxdlRqeq58XVr+8L X-Received: by 2002:a62:bd11:: with SMTP id a17mr24861037pff.126.1559581675721; Mon, 03 Jun 2019 10:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559581675; cv=none; d=google.com; s=arc-20160816; b=p1v3mj2s8offomZaTpiGIn+TeLnF3dceevuPvi/AsXeYc9eXElj17qVrFaPlGTN3lF HIEM2Lw2fVcVb6WpOcHND2z3weAE4zgII5a8Mo9wNtzK9ZSHjDcRtWLR3sk5Z3C8ntX8 jD2osaGrCsb4yTBBvvkN7g5Y/CfGTShwm2oIdUlUVV+u8E4A8xKSGH87kcu7DFMA5kVn 0t8p75QyRypf+AFQkglYzhKjVXz861pO3NzdX8sxAqOxZpL2UnqYM8EyFMWlDHo5rerr /yAvxk9vagwCWwNwkwpVjovr5xPvZz0hgzgqMq5PUwkeVCxxwbX7WosrvTndxZ0+XXYt 7UYw== 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:cc:to:subject; bh=IJ9Qy/7KCnrV63mWPic+NZMETnSJc65J83BhRBuwYyg=; b=hJB9bF/cwP5rnld8xERWxCoOltdXy5uS1+9sFd7jDU0dpC5/zj9Ieswd9QU/0axXUR AqrSZMKEYwHx/wChW+9PH2Uv9mFOGM1mhVaBezbGVd6k0f6Ob+3n9/HrYLPJ/oAuKdwJ VMhoofl9GoHvSnLBaCvkt+Muk1RUrvvhokEQNonYzItC+vLb/Bz5gd2YyLEtO3QBBJuO M5+U+B6BL3ni9qseA19CxNCfh1+ZeudDxkffCj+EQ0Du44kKVmJfwkB30D7kjci7C2jw 6A1cK0ZQ39mskVBvpBNwTf+xahC0mgmV4VGcB1iM2/g7JpbFQd+IquQ0S9xHhIboFP1T X3rA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si9834295pjw.16.2019.06.03.10.07.37; Mon, 03 Jun 2019 10:07:55 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729054AbfFCO3o (ORCPT + 99 others); Mon, 3 Jun 2019 10:29:44 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:32979 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727650AbfFCO3o (ORCPT ); Mon, 3 Jun 2019 10:29:44 -0400 Received: from LHREML712-CAH.china.huawei.com (unknown [172.18.7.106]) by Forcepoint Email with ESMTP id CB7DE93869A09C872220; Mon, 3 Jun 2019 15:29:41 +0100 (IST) Received: from [10.220.96.108] (10.220.96.108) by smtpsuk.huawei.com (10.201.108.35) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Jun 2019 15:29:33 +0100 Subject: Re: [PATCH v2 2/3] ima: don't ignore INTEGRITY_UNKNOWN EVM status To: James Bottomley , Mimi Zohar , , CC: , , , , , References: <20190529133035.28724-1-roberto.sassu@huawei.com> <20190529133035.28724-3-roberto.sassu@huawei.com> <1559217621.4008.7.camel@linux.ibm.com> <1559569401.5052.17.camel@HansenPartnership.com> From: Roberto Sassu Message-ID: <3667fbd4-b6ed-6a76-9ff4-84ec3c2dda12@huawei.com> Date: Mon, 3 Jun 2019 16:29:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1559569401.5052.17.camel@HansenPartnership.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.220.96.108] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/3/2019 3:43 PM, James Bottomley wrote: > On Mon, 2019-06-03 at 11:25 +0200, Roberto Sassu wrote: >> On 5/30/2019 2:00 PM, Mimi Zohar wrote: >>> On Wed, 2019-05-29 at 15:30 +0200, Roberto Sassu wrote: >>>> Currently, ima_appraise_measurement() ignores the EVM status when >>>> evm_verifyxattr() returns INTEGRITY_UNKNOWN. If a file has a >>>> valid security.ima xattr with type IMA_XATTR_DIGEST or >>>> IMA_XATTR_DIGEST_NG, ima_appraise_measurement() returns >>>> INTEGRITY_PASS regardless of the EVM status. The problem is that >>>> the EVM status is overwritten with the appraisal statu >>> >>> Roberto, your framing of this problem is harsh and misleading. IMA >>> and EVM are intentionally independent of each other and can be >>> configured independently of each other. The intersection of the >>> two is the call to evm_verifyxattr(). INTEGRITY_UNKNOWN is >>> returned for a number of reasons - when EVM is not configured, the >>> EVM hmac key has not yet been loaded, the protected security >>> attribute is unknown, or the file is not in policy. >>> >>> This patch does not differentiate between any of the above cases, >>> requiring mutable files to always be protected by EVM, when >>> specified as an "ima_appraise=" option on the boot command line. >>> >>> IMA could be extended to require EVM on a per IMA policy rule >>> basis. Instead of framing allowing IMA file hashes without EVM as a >>> bug that has existed from the very beginning, now that IMA/EVM have >>> matured and is being used, you could frame it as extending IMA >>> or hardening. >> >> I'm seeing it from the perspective of an administrator that manages >> an already hardened system, and expects that the system only grants >> access to files with a valid signature/HMAC. That system would not >> enforce this behavior if EVM keys are removed and the digest in >> security.ima is set to the actual file digest. >> >> Framing it as a bug rather than an extension would in my opinion help >> to convince people about the necessity to switch to the safe mode, if >> their system is already hardened. > > I have a use case for IMA where I use it to enforce immutability of > containers. In this use case, the cluster admin places hashes on > executables as the image is unpacked so that if an executable file is > changed, IMA will cause an execution failure. For this use case, I > don't care about the EVM, in fact we don't use it, because the only > object is to fail execution if a binary is mutated. How would you prevent root in the container from updating security.ima? Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI