From: Kees Cook <keescook@chromium.org>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: "Paul Moore" <paul@paul-moore.com>,
"James Morris" <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
"Dmitry Kasatkin" <dmitry.kasatkin@gmail.com>,
"Mickaël Salaün" <mic@digikod.net>, "Petr Vorel" <pvorel@suse.cz>,
"Borislav Petkov" <bp@suse.de>, "Takashi Iwai" <tiwai@suse.de>,
"Jonathan McDowell" <noodles@fb.com>,
linux-security-module@vger.kernel.org,
linux-integrity@vger.kernel.org, "KP Singh" <kpsingh@kernel.org>,
"Casey Schaufler" <casey@schaufler-ca.com>,
"John Johansen" <john.johansen@canonical.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 2/9] security: Move trivial IMA hooks into LSM
Date: Wed, 19 Oct 2022 16:41:24 -0700 [thread overview]
Message-ID: <202210191639.58F18F1AA@keescook> (raw)
In-Reply-To: <ffa58bb09df15a9debc45aaf0ed51f2b34f5c225.camel@linux.ibm.com>
On Wed, Oct 19, 2022 at 04:45:41PM -0400, Mimi Zohar wrote:
> On Wed, 2022-10-19 at 11:59 -0700, Kees Cook wrote:
> > On Wed, Oct 19, 2022 at 10:34:48AM -0400, Mimi Zohar wrote:
> > > On Thu, 2022-10-13 at 15:36 -0700, Kees Cook wrote:
> > > > This moves the trivial hard-coded stacking of IMA LSM hooks into the
> > > > existing LSM infrastructure.
> > >
> > > The only thing trivial about making IMA and EVM LSMs is moving them to
> > > LSM hooks. Although static files may be signed and the signatures
> > > distributed with the file data through the normal distribution
> > > mechanisms (e.g. RPM), other files cannot be signed remotely (e.g.
> > > configuration files). For these files, both IMA and EVM may be
> > > configured to maintain persistent file state stored as security xattrs
> > > in the form of security.ima file hashes or security.evm HMACs. The LSM
> > > flexibility of enabling/disabling IMA or EVM on a per boot basis breaks
> > > this usage, potentially preventing subsequent boots.
> >
> > I'm not suggesting IMA and EVM don't have specific behaviors that need to
> > be correctly integrated into the LSM infrastructure. In fact, I spent a
> > lot of time designing that infrastructure to be flexible enough to deal
> > with these kinds of things. (e.g. plumbing "enablement", etc.) As I
> > mentioned, this was more of trying to provide a head-start on the
> > conversion. I don't intend to drive this -- please take whatever is
> > useful from this example and use it. :) I'm happy to help construct any
> > missing infrastructure needed (e.g. LSM_ORDER_LAST, etc).
> >
> > As for preventing subsequent boots, this is already true with other LSMs
> > that save state that affects system behavior (like SELinux tags, AppArmor
> > policy). IMA and EVM are not special in that regard conceptually.
>
> > Besides, it also looks like it's already possible to boot with IMA or EVM
> > disabled ("ima_appraise=off", or "evm=fix"), so there's no regression
> > conceptually for having "integrity" get dropped from the lsm= list at
> > boot. And if you want it not to be silent disabling, that's fine --
> > just panic during initialization if "integrity" is disabled, as is
> > already happening.
>
> Being able to specify "ima_appraise=" on the boot command line requires
> IMA_APPRAISE_BOOTPARAM to be configured. Even when specified, if the
> system is booted with secure-boot mode enabled, it also cannot be
> modified. With the ability of randomly enabling/disabling LSMs, these
> protections are useless.
Sure, so let's get lsm= added to the lockdown list, etc. My point is for
us to work through each of these concerns and address them. I am not an
IMA/EVM expert, but I do understand the LSM infrastructure deeply, so
I'd like to help you get these changes made.
--
Kees Cook
next prev parent reply other threads:[~2022-10-19 23:41 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 22:36 [PATCH 0/9] integrity: Move hooks into LSM Kees Cook
2022-10-13 22:36 ` [PATCH 1/9] integrity: Prepare for having "ima" and "evm" available in "integrity" LSM Kees Cook
2022-10-14 14:40 ` Mickaël Salaün
2022-10-14 17:59 ` Kees Cook
2022-10-17 9:26 ` Mickaël Salaün
2022-10-17 18:11 ` Kees Cook
2022-10-19 18:33 ` Kees Cook
2022-10-19 19:13 ` Mimi Zohar
2022-10-19 22:37 ` Kees Cook
2022-10-19 14:34 ` Mimi Zohar
2022-10-19 18:28 ` Kees Cook
2022-10-13 22:36 ` [PATCH 2/9] security: Move trivial IMA hooks into LSM Kees Cook
2022-10-19 14:34 ` Mimi Zohar
2022-10-19 18:59 ` Kees Cook
2022-10-19 20:45 ` Mimi Zohar
2022-10-19 23:41 ` Kees Cook [this message]
2022-10-20 12:17 ` Mimi Zohar
2022-10-21 14:53 ` Dr. Greg
2022-10-21 15:09 ` Casey Schaufler
2022-10-13 22:36 ` [PATCH 3/9] ima: Move xattr " Kees Cook
2022-10-18 15:07 ` Christian Brauner
2022-10-19 13:24 ` Mimi Zohar
2022-10-13 22:36 ` [PATCH 4/9] ima: Move ima_file_free() " Kees Cook
2022-10-18 15:02 ` Christian Brauner
2022-10-18 15:32 ` Roberto Sassu
2022-10-18 18:29 ` Kees Cook
2022-10-19 6:55 ` Roberto Sassu
2022-10-20 15:47 ` Paul Moore
2022-10-13 22:36 ` [PATCH 5/9] LSM: Introduce inode_post_setattr hook Kees Cook
2022-10-17 10:16 ` kernel test robot
2022-10-17 11:27 ` kernel test robot
2022-10-18 14:50 ` Christian Brauner
2022-10-13 22:36 ` [PATCH 6/9] fs: Introduce file_to_perms() helper Kees Cook
2022-10-18 14:10 ` Christian Brauner
2022-10-18 18:25 ` Kees Cook
2022-10-20 17:29 ` Casey Schaufler
2022-10-20 23:04 ` Kees Cook
2022-10-13 22:36 ` [PATCH 7/9] ima: Move ima_file_check() into LSM Kees Cook
2022-10-13 22:36 ` [PATCH 8/9] integrity: Move trivial hooks " Kees Cook
2022-10-13 22:36 ` [PATCH 9/9] integrity: Move integrity_inode_get() out of global header Kees Cook
2022-10-13 22:47 ` [PATCH 0/9] integrity: Move hooks into LSM Paul Moore
2022-10-14 1:16 ` Mimi Zohar
2022-10-18 15:31 ` Mickaël Salaün
2022-10-18 15:38 ` Roberto Sassu
2022-10-18 18:31 ` Kees Cook
2022-10-20 17:36 ` Casey Schaufler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202210191639.58F18F1AA@keescook \
--to=keescook@chromium.org \
--cc=bp@suse.de \
--cc=casey@schaufler-ca.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=kpsingh@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=noodles@fb.com \
--cc=paul@paul-moore.com \
--cc=pvorel@suse.cz \
--cc=serge@hallyn.com \
--cc=tiwai@suse.de \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox