Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3194444pxa; Tue, 18 Aug 2020 08:55:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+FSt5I/g2o/XKfbk2AP0fzpQj0SIM4qnCM3cuGEdmBMebdRCN6MJ6b4X5thSXRpABwGeO X-Received: by 2002:a05:6402:2069:: with SMTP id bd9mr20086792edb.127.1597766123534; Tue, 18 Aug 2020 08:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597766123; cv=none; d=google.com; s=arc-20160816; b=Z2RvvUerI5g0FDmE9DubOuHCjQokT20mdwUo+faIJE+5+hM5xD+7PQViwqBA4JHdXg g/3ZVMLE2ML6sQi3pKw576bsW7lOutyKmNeDXjXg1iZTTYFYv5rgevG+L6+AlO12wy3r 9VthJ2Yw7Fl+CMoiUdq/hzG8TO8D9a1PMqbzanoMaP9pCY2iIKvbn9ntHrYkN5Y5cPwL +rq0TutjaaQ0zuMVYoLV3N9+unyvrbQnZHUqI952eXGlU6O4sYdtEr6PyJK2xPgiz6bo Ur622ja+MWNIh4pJ02UmVt6FNmW64CeuXTukz6VjwWFRlZxFOPcjn6i/gT8zJ4V2CMPO ZjDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9eb8GSJaT6x1wy3iSx9sdWPwGO+Cfju1Eetu5oM8scg=; b=KJ8+6OfICKY/OU7Vk0h+gtRc6ElwkYQckJnlniC003KWDLRlxo+fwGUcuS8Ws2Ef2y k5BwPxo4hYBDwDPFTuWeiLn5gfd0vjUaHvzgbkrzX5Ay5dL8CLp8epa7RKWOxp0YhoVW xrAl7y5o02cLGcD7odVoP8fDUgN/CZWBDuZPDMBNzqSlEhSwEjZ58rkYfvImZkMAxgnD W09R51RBrdri9AcMgAoC4luXUj2zyXxnugcMbpbGdfkDrMaMjeTr4cBXPgPyPevaHO7D qIyMqT6olsAwYl6v/vtc1BiBDp9DsG3NiLh1Y+QaMT/al/+NTZfnlXVmnzSZWQz570QO 04lQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si13413934edr.202.2020.08.18.08.54.59; Tue, 18 Aug 2020 08:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728310AbgHRPyY (ORCPT + 99 others); Tue, 18 Aug 2020 11:54:24 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:49103 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbgHRPyD (ORCPT ); Tue, 18 Aug 2020 11:54:03 -0400 Received: from ip5f5af70b.dynamic.kabel-deutschland.de ([95.90.247.11] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k83vr-0003fb-1J; Tue, 18 Aug 2020 15:53:51 +0000 Date: Tue, 18 Aug 2020 17:53:50 +0200 From: Christian Brauner To: krzysztof.struczynski@huawei.com Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, zohar@linux.ibm.com, stefanb@linux.vnet.ibm.com, sunyuqiong1988@gmail.com, mkayaalp@cs.binghamton.edu, dmitry.kasatkin@gmail.com, serge@hallyn.com, jmorris@namei.org, christian@brauner.io, silviu.vlasceanu@huawei.com, roberto.sassu@huawei.com Subject: Re: [RFC PATCH 00/30] ima: Introduce IMA namespace Message-ID: <20200818155350.oy3axodt3vj5k7ij@wittgenstein> References: <20200818152037.11869-1-krzysztof.struczynski@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200818152037.11869-1-krzysztof.struczynski@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 05:20:07PM +0200, krzysztof.struczynski@huawei.com wrote: > From: Krzysztof Struczynski > > IMA has not been designed to work with containers. It handles every > process in the same way, and it cannot distinguish if a process belongs to > a container or not. > > Containers use namespaces to make it appear to the processes in the > containers that they have their own isolated instance of the global > resource. For IMA as well, it is desirable to let processes in the > containers have IMA functionality independent from other containers: > separate policy rules, measurement list, additional appraisal keys to > verify the container image, separate audit logs. > > As previous work done in this area, this patch series introduces the IMA > namespace, which is a separate instance of IMA to handle a subset of > processes that belong to a container. > > The IMA namespace is created using clone3() or unshare() system calls. It > is important to configure the namespace before any process appears in it, > so that the new policy rules apply to the very first process in the > namespace. To achieve that, the intermediate namespace ima_ns_for_children > is used. It stores the configuration and becomes active on the next fork > or when the first process enters it using the setns() system call. The > similar process is used for the time namespace. > > The IMA namespace can be configured using the new securityfs directory > entries that allow the user to set the policy rules, x509 certificate for > appraisal and pass IMA configuration parameters normally included in the > kernel command line parameters. It is intended to extend the clone_args to > allow configuration from clone3() syscall. Not to be the downer right away but just as an fyi, if this patchset makes it, clone3() will not allow to be extended with any real second-level pointers. That will see a hard NAK from me and several other maintainers. Christian