linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Ken Goldman <kgold@linux.ibm.com>
Cc: Tushar Sugandhi <tusharsu@linux.microsoft.com>,
	Sush Shringarputale <sushring@linux.microsoft.com>,
	linux-integrity@vger.kernel.org, zohar@linux.ibm.com,
	peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca,
	bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com,
	kexec@lists.infradead.org, jmorris@namei.org, serge@hallyn.com,
	code@tyhicks.com, nramas@linux.microsoft.com,
	linux-security-module@vger.kernel.org
Subject: Re: [RFC] IMA Log Snapshotting Design Proposal - aggregate
Date: Thu, 7 Sep 2023 17:02:55 -0400	[thread overview]
Message-ID: <CAHC9VhRG1SgNz2RFe8gEYxT=5RK6EutFuNt0YRtwA0bp6PsRog@mail.gmail.com> (raw)
In-Reply-To: <0cfdad7c-8cb9-20d3-7986-c1d3d58a33db@linux.ibm.com>

On Wed, Sep 6, 2023 at 4:49 PM Ken Goldman <kgold@linux.ibm.com> wrote:
> On 9/1/2023 6:06 PM, Tushar Sugandhi wrote:
> > On 8/30/23 11:12, Ken Goldman wrote:
> >> On 8/1/2023 3:12 PM, Sush Shringarputale wrote:
> >>> - A user-mode process will trigger the snapshot by opening a file in
> >>> SysFS
> >>>    say /sys/kernel/security/ima/snapshot (referred to as
> >>> sysk_ima_snapshot_file
> >>>    here onwards).
> >>> - The Kernel will get the current TPM PCR values and PCR update
> >>> counter [2]
> >>>    and store them as template data in a new IMA event
> >>> "snapshot_aggregate".
> >>
> >> If this is relying on a user-mode process, is there a concern that the
> >> process doesn't run. Might it be safer to have the kernel trigger the
> >> snapshot.
> >>
> > The UM process here would be typically an attestation client
> > which passes on the IMA log to the remote service for attestation.
> > If the process doesn't run, the client will operate the same way as it
> > does currently.
>
> I see.
>
> 1. Ensure that the attestation client stores the snapshot in a
> well-known and widely readable location.  There can be more than one
> attestation client, and all need access to the snapshot.

A few points:

* There is no requirement for an admin or solution provider to support
or otherwise use the IMA measurement log snapshotting functionality,
even if enabled in the kernel it is opt-in at runtime (i.e. simply
don't trigger the snapshot).  If the deployment in question is using
an attestation solution which is not compatible with the snapshot
concept then there is no need to perform a snapshot, the system will
behave just as it would today; nothing gained, but nothing lost.

* One of the benefits of initiating the snapshot in userspace is that
it affords solution providers a tremendous amount of flexibility with
respect to how to manage the IMA measurement log.  Not only can
different, and potentially more complex, logic be used to determine
the appropriate time to trigger the snapshot, but the trimmed/old log
can be processed any way the admin sees fit; writing and supporting
userspace code is many orders of magnitude easier than kernel code.

> There is a privacy concern around making the snapshot world-read.

See the above points.  If security requirements can not be satisfied
by any of the various solutions designed to protect the integrity of
system configuration and log data, the snapshotting functionality can
always be blocked at runtime by another collection of access control
solutions.

> 2. Is there a concern that, if the client doesn't run, it doesn't solve
> the kernel memory issue?

Yes, the design relies on a userspace process to initiate, and
complete the snapshotting process.  The good news is that if the
userspace process fails the system is no worse off than it is today,
but modern init-systems, e.g. systemd, should help ensure the
reliability of the userspace snapshot process/daemon.

> Is this relying on a UM process to solve a  kernel issue?

The ultimate problem is that we have an unbounded memory buffer that
we can't enforce limits on in the traditional sense.  The design here
proposes a checkpoint system which allows us to mitigate the
uncontrolled growth of this buffer while preserving the ability to
remotely attest the system (although perhaps with different, or
modified attestation tools).

I have not seen any other options for a viable, kernel driven solution
in any of the discussions thus far, but if you have any suggestions I
think we would all be very interested :)  The tmpfs based solution
doesn't solve the problem of system-wide memory pressure as tmpfs is
still a memory-backed filesystem.  Passing a fd to the kernel is still
a userspace initiated action, with the added problem of requiring the
kernel do the I/O itself.

-- 
paul-moore.com

  reply	other threads:[~2023-09-07 21:03 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 19:12 [RFC] IMA Log Snapshotting Design Proposal Sush Shringarputale
2023-08-01 21:21 ` James Bottomley
2023-08-07 22:49   ` Stefan Berger
2023-08-08 12:35     ` James Bottomley
2023-08-08 13:31       ` Stefan Berger
2023-08-08 18:26         ` James Bottomley
2023-08-08 20:09           ` Stefan Berger
2023-08-08 21:41             ` James Bottomley
2023-08-10  4:43               ` Tushar Sugandhi
2023-08-10 11:43                 ` James Bottomley
2023-08-11 15:48                   ` Tushar Sugandhi
2023-08-10  4:31           ` Tushar Sugandhi
2023-08-10  4:29         ` Tushar Sugandhi
2023-08-10  1:23       ` Tushar Sugandhi
2023-08-10  1:15     ` Tushar Sugandhi
2023-08-10 14:12       ` Stefan Berger
2023-08-11 15:57         ` Tushar Sugandhi
2023-08-11 18:16           ` Stefan Berger
2023-08-10  1:03   ` Tushar Sugandhi
2023-08-11 13:14 ` Mimi Zohar
2023-08-14 21:42   ` Sush Shringarputale
2023-08-14 22:02     ` Mimi Zohar
2023-08-21 22:05       ` Sush Shringarputale
2023-08-21 23:07         ` Mimi Zohar
2023-08-29 19:34           ` Paul Moore
2023-08-29 21:03             ` Mimi Zohar
2023-08-29 21:30               ` Paul Moore
2023-08-29 21:54                 ` Mimi Zohar
2023-08-29 23:15                   ` Paul Moore
2023-08-30 20:25                     ` Mimi Zohar
2023-08-30 20:47                       ` Paul Moore
2023-08-30 21:50                         ` Mimi Zohar
2023-08-30 22:21                           ` Paul Moore
2023-08-30 22:23                             ` Paul Moore
2023-08-30 23:06                               ` Mimi Zohar
2023-08-30 23:22                                 ` Paul Moore
2023-08-31 14:01                                   ` Mimi Zohar
2023-08-31 14:43                                     ` Paul Moore
2023-08-31 16:46                                   ` Dr. Greg
2023-08-31 17:56                                     ` Paul Moore
2023-08-30 18:06 ` [RFC] IMA Log Snapshotting Design Proposal - network bandwidth Ken Goldman
2023-09-01 21:20   ` Tushar Sugandhi
2023-09-06 20:20     ` Ken Goldman
2023-09-07 20:40       ` Paul Moore
2023-08-30 18:12 ` [RFC] IMA Log Snapshotting Design Proposal - aggregate Ken Goldman
2023-09-01 22:06   ` Tushar Sugandhi
2023-09-06 20:49     ` Ken Goldman
2023-09-07 21:02       ` Paul Moore [this message]
2023-08-30 19:12 ` [RFC] IMA Log Snapshotting Design Proposal - unseal Ken Goldman
2023-08-31 15:54   ` Dr. Greg
2023-09-01 21:22   ` Tushar Sugandhi
2023-09-06 20:13     ` Ken Goldman

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='CAHC9VhRG1SgNz2RFe8gEYxT=5RK6EutFuNt0YRtwA0bp6PsRog@mail.gmail.com' \
    --to=paul@paul-moore.com \
    --cc=bhe@redhat.com \
    --cc=code@tyhicks.com \
    --cc=dyoung@redhat.com \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=kexec@lists.infradead.org \
    --cc=kgold@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=nramas@linux.microsoft.com \
    --cc=peterhuewe@gmx.de \
    --cc=serge@hallyn.com \
    --cc=sushring@linux.microsoft.com \
    --cc=tusharsu@linux.microsoft.com \
    --cc=vgoyal@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).