From: Mimi Zohar <zohar@linux.ibm.com>
To: Petr Vorel <pvorel@suse.cz>, ltp@lists.linux.it
Cc: linux-integrity@vger.kernel.org
Subject: Re: [PATCH v3 02/10] IMA: Add TCB policy as an example for ima_measurements.sh
Date: Thu, 23 Jan 2025 12:38:12 -0500 [thread overview]
Message-ID: <52d6a8c168215e6dafe567b37bf5ac65e3b300eb.camel@linux.ibm.com> (raw)
In-Reply-To: <20250114112915.610297-3-pvorel@suse.cz>
Hi Petr,
On Tue, 2025-01-14 at 12:29 +0100, Petr Vorel wrote:
> Taken from IMA docs [1], removed dont_measure fsmagic=0x1021994 (tmpfs)
> as suggested by Mimi.
I backtracked on my original suggestion. Instead of removing the tmpfs rule, qualify
it as you did below.
-> qualified the "dont_measure fsmagic=0x1021994" (tmpfs) rule to the file open hook
[2].
>
> [1] https://ima-doc.readthedocs.io/en/latest/ima-policy.html#ima-tcb
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
[2] Kernel commit 7eef7c8bac9a ("ima: limit the builtin 'tcb' dont_measure tmpfs
policy rule")
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
> ---
> .../security/integrity/ima/datafiles/Makefile | 4 ++--
> .../ima/datafiles/ima_measurements/Makefile | 11 ++++++++++
> .../ima/datafiles/ima_measurements/tcb.policy | 20 +++++++++++++++++++
> 3 files changed, 33 insertions(+), 2 deletions(-)
> create mode 100644
> testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> create mode 100644
> testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
>
> diff --git a/testcases/kernel/security/integrity/ima/datafiles/Makefile
> b/testcases/kernel/security/integrity/ima/datafiles/Makefile
> index 200fd3f4d3..0f2b4fdb11 100644
> --- a/testcases/kernel/security/integrity/ima/datafiles/Makefile
> +++ b/testcases/kernel/security/integrity/ima/datafiles/Makefile
> @@ -1,5 +1,5 @@
> # SPDX-License-Identifier: GPL-2.0-or-later
> -# Copyright (c) Linux Test Project, 2019-2020
> +# Copyright (c) Linux Test Project, 2019-2025
> # Copyright (c) 2020 Microsoft Corporation
> # Copyright (C) 2009, Cisco Systems Inc.
> # Ngie Cooper, July 2009
> @@ -8,6 +8,6 @@ top_srcdir ?= ../../../../../..
>
> include $(top_srcdir)/include/mk/env_pre.mk
>
> -SUBDIRS := ima_kexec ima_keys ima_policy ima_selinux
> +SUBDIRS := ima_kexec ima_keys ima_measurements ima_policy ima_selinux
>
> include $(top_srcdir)/include/mk/generic_trunk_target.mk
> diff --git
> a/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> new file mode 100644
> index 0000000000..6317f2bf85
> --- /dev/null
> +++ b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> @@ -0,0 +1,11 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) Linux Test Project, 2025
> +
> +top_srcdir ?= ../../../../../../..
> +
> +include $(top_srcdir)/include/mk/env_pre.mk
> +
> +INSTALL_DIR := testcases/data/ima_measurements
> +INSTALL_TARGETS := *.policy
> +
> +include $(top_srcdir)/include/mk/generic_leaf_target.mk
> diff --git
> a/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
> b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
> new file mode 100644
> index 0000000000..1e4a932bf0
> --- /dev/null
> +++ b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
> @@ -0,0 +1,20 @@
> +dont_measure fsmagic=0x9fa0
> +dont_measure fsmagic=0x62656572
> +dont_measure fsmagic=0x64626720
> +dont_measure fsmagic=0x1021994 func=FILE_CHECK
> +dont_measure fsmagic=0x1cd1
> +dont_measure fsmagic=0x42494e4d
> +dont_measure fsmagic=0x73636673
> +dont_measure fsmagic=0xf97cff8c
> +dont_measure fsmagic=0x43415d53
> +dont_measure fsmagic=0x27e0eb
> +dont_measure fsmagic=0x63677270
> +dont_measure fsmagic=0x6e736673
> +dont_measure fsmagic=0xde5e81e4
> +measure func=MMAP_CHECK mask=MAY_EXEC
> +measure func=BPRM_CHECK mask=MAY_EXEC
> +measure func=FILE_CHECK mask=^MAY_READ euid=0
> +measure func=FILE_CHECK mask=^MAY_READ uid=0
> +measure func=MODULE_CHECK
> +measure func=FIRMWARE_CHECK
> +measure func=POLICY_CHECK
WARNING: multiple messages have this Message-ID (diff)
From: Mimi Zohar <zohar@linux.ibm.com>
To: Petr Vorel <pvorel@suse.cz>, ltp@lists.linux.it
Cc: linux-integrity@vger.kernel.org
Subject: Re: [LTP] [PATCH v3 02/10] IMA: Add TCB policy as an example for ima_measurements.sh
Date: Thu, 23 Jan 2025 12:38:12 -0500 [thread overview]
Message-ID: <52d6a8c168215e6dafe567b37bf5ac65e3b300eb.camel@linux.ibm.com> (raw)
In-Reply-To: <20250114112915.610297-3-pvorel@suse.cz>
Hi Petr,
On Tue, 2025-01-14 at 12:29 +0100, Petr Vorel wrote:
> Taken from IMA docs [1], removed dont_measure fsmagic=0x1021994 (tmpfs)
> as suggested by Mimi.
I backtracked on my original suggestion. Instead of removing the tmpfs rule, qualify
it as you did below.
-> qualified the "dont_measure fsmagic=0x1021994" (tmpfs) rule to the file open hook
[2].
>
> [1] https://ima-doc.readthedocs.io/en/latest/ima-policy.html#ima-tcb
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
[2] Kernel commit 7eef7c8bac9a ("ima: limit the builtin 'tcb' dont_measure tmpfs
policy rule")
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
> ---
> .../security/integrity/ima/datafiles/Makefile | 4 ++--
> .../ima/datafiles/ima_measurements/Makefile | 11 ++++++++++
> .../ima/datafiles/ima_measurements/tcb.policy | 20 +++++++++++++++++++
> 3 files changed, 33 insertions(+), 2 deletions(-)
> create mode 100644
> testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> create mode 100644
> testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
>
> diff --git a/testcases/kernel/security/integrity/ima/datafiles/Makefile
> b/testcases/kernel/security/integrity/ima/datafiles/Makefile
> index 200fd3f4d3..0f2b4fdb11 100644
> --- a/testcases/kernel/security/integrity/ima/datafiles/Makefile
> +++ b/testcases/kernel/security/integrity/ima/datafiles/Makefile
> @@ -1,5 +1,5 @@
> # SPDX-License-Identifier: GPL-2.0-or-later
> -# Copyright (c) Linux Test Project, 2019-2020
> +# Copyright (c) Linux Test Project, 2019-2025
> # Copyright (c) 2020 Microsoft Corporation
> # Copyright (C) 2009, Cisco Systems Inc.
> # Ngie Cooper, July 2009
> @@ -8,6 +8,6 @@ top_srcdir ?= ../../../../../..
>
> include $(top_srcdir)/include/mk/env_pre.mk
>
> -SUBDIRS := ima_kexec ima_keys ima_policy ima_selinux
> +SUBDIRS := ima_kexec ima_keys ima_measurements ima_policy ima_selinux
>
> include $(top_srcdir)/include/mk/generic_trunk_target.mk
> diff --git
> a/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> new file mode 100644
> index 0000000000..6317f2bf85
> --- /dev/null
> +++ b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/Makefile
> @@ -0,0 +1,11 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) Linux Test Project, 2025
> +
> +top_srcdir ?= ../../../../../../..
> +
> +include $(top_srcdir)/include/mk/env_pre.mk
> +
> +INSTALL_DIR := testcases/data/ima_measurements
> +INSTALL_TARGETS := *.policy
> +
> +include $(top_srcdir)/include/mk/generic_leaf_target.mk
> diff --git
> a/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
> b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
> new file mode 100644
> index 0000000000..1e4a932bf0
> --- /dev/null
> +++ b/testcases/kernel/security/integrity/ima/datafiles/ima_measurements/tcb.policy
> @@ -0,0 +1,20 @@
> +dont_measure fsmagic=0x9fa0
> +dont_measure fsmagic=0x62656572
> +dont_measure fsmagic=0x64626720
> +dont_measure fsmagic=0x1021994 func=FILE_CHECK
> +dont_measure fsmagic=0x1cd1
> +dont_measure fsmagic=0x42494e4d
> +dont_measure fsmagic=0x73636673
> +dont_measure fsmagic=0xf97cff8c
> +dont_measure fsmagic=0x43415d53
> +dont_measure fsmagic=0x27e0eb
> +dont_measure fsmagic=0x63677270
> +dont_measure fsmagic=0x6e736673
> +dont_measure fsmagic=0xde5e81e4
> +measure func=MMAP_CHECK mask=MAY_EXEC
> +measure func=BPRM_CHECK mask=MAY_EXEC
> +measure func=FILE_CHECK mask=^MAY_READ euid=0
> +measure func=FILE_CHECK mask=^MAY_READ uid=0
> +measure func=MODULE_CHECK
> +measure func=FIRMWARE_CHECK
> +measure func=POLICY_CHECK
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-23 17:38 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 11:29 [PATCH v3 00/10] LTP tests: load predefined policy, enhancements Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-14 11:29 ` [PATCH v3 01/10] ima_violations.sh: Fix log detection Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:37 ` Mimi Zohar
2025-01-23 17:37 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 02/10] IMA: Add TCB policy as an example for ima_measurements.sh Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:38 ` Mimi Zohar [this message]
2025-01-23 17:38 ` Mimi Zohar
2025-02-03 15:46 ` Mimi Zohar
2025-02-03 15:46 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 03/10] IMA: Move requirement check to ima_setup.sh Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:38 ` Mimi Zohar
2025-01-23 17:38 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 04/10] IMA: Add example policy for ima_violations.sh Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-02-03 15:51 ` Mimi Zohar
2025-02-03 15:51 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 05/10] IMA: Read required policy from file Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:39 ` Mimi Zohar
2025-01-23 17:39 ` [LTP] " Mimi Zohar
2025-02-04 11:17 ` Petr Vorel
2025-02-04 11:17 ` [LTP] " Petr Vorel
2025-01-14 11:29 ` [PATCH v3 06/10] ima_violations.sh: Declare tcb builtin policy Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:45 ` Mimi Zohar
2025-01-23 17:45 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 07/10] ima_setup.sh: Add digest index detection for ima-buf format Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-02-03 16:00 ` Mimi Zohar
2025-02-03 16:00 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 08/10] ima_setup.sh: Allow to load predefined policy Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-02-03 16:31 ` Mimi Zohar
2025-02-03 16:31 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 09/10] ima_measurements.sh: Check policy for test3 Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:39 ` Mimi Zohar
2025-01-23 17:39 ` [LTP] " Mimi Zohar
2025-01-14 11:29 ` [PATCH v3 10/10] tst_test.sh: IMA: Allow to disable LSM warnings and use it for IMA Petr Vorel
2025-01-14 11:29 ` [LTP] " Petr Vorel
2025-01-23 17:39 ` Mimi Zohar
2025-01-23 17:39 ` [LTP] " Mimi Zohar
2025-01-31 9:26 ` Cyril Hrubis
2025-01-31 9:26 ` Cyril Hrubis
2025-01-31 12:09 ` Petr Vorel
2025-01-31 12:09 ` Petr Vorel
2025-01-23 17:37 ` [PATCH v3 00/10] LTP tests: load predefined policy, enhancements Mimi Zohar
2025-01-23 17:37 ` [LTP] " Mimi Zohar
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=52d6a8c168215e6dafe567b37bf5ac65e3b300eb.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=linux-integrity@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.