public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
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 v2 7/8] ima_violations.sh: Check for a required policy
Date: Mon, 30 Dec 2024 22:42:20 -0500	[thread overview]
Message-ID: <d4fd124d03bc2e13d62abe97febeb34c2ffe1603.camel@linux.ibm.com> (raw)
In-Reply-To: <20241213222014.1580991-8-pvorel@suse.cz>

Hi Petr,

On Fri, 2024-12-13 at 23:20 +0100, Petr Vorel wrote:
> Add check for ^func=FILE_CHECK'
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  .../kernel/security/integrity/ima/tests/ima_violations.sh    | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
> index 0f710dea2e..73b9fe6f30 100755
> --- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
> +++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
> @@ -1,7 +1,7 @@
>  #!/bin/sh
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  # Copyright (c) 2009 IBM Corporation
> -# Copyright (c) 2018-2020 Petr Vorel <pvorel@suse.cz>
> +# Copyright (c) 2018-2024 Petr Vorel <pvorel@suse.cz>
>  # Author: Mimi Zohar <zohar@linux.ibm.com>
>  #
>  # Test whether ToMToU and open_writer violations invalidatethe PCR and are logged.
> @@ -9,6 +9,7 @@
>  TST_SETUP="setup"
>  TST_CLEANUP="cleanup"
>  TST_CNT=3
> +REQUIRED_POLICY='^func=FILE_CHECK'

The first field of an IMA policy rule is the 'action', followed by the
condition. Use "func=FILE_CHECK" instead.

thanks,

Mimi

>  
>  setup()
>  {
> @@ -17,6 +18,8 @@ setup()
>  	LOG="/var/log/messages"
>  	PRINTK_RATE_LIMIT=
>  
> +	require_ima_policy_content_if_readable "$REQUIRED_POLICY"
> +
>  	if status_daemon auditd; then
>  		LOG="/var/log/audit/audit.log"
>  	elif tst_check_cmds sysctl; then


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-12-31  3:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 22:20 [LTP] [PATCH v2 0/8] LTP tests: load predefined policy, enhancements Petr Vorel
2024-12-13 22:20 ` [LTP] [PATCH v2 1/8] IMA: Add TCB policy as an example for ima_measurements.sh Petr Vorel
2024-12-31 16:01   ` Mimi Zohar
2025-01-03 11:57     ` Petr Vorel
2024-12-13 22:20 ` [LTP] [PATCH v2 2/8] ima_setup.sh: Allow to load predefined policy Petr Vorel
2024-12-30 20:43   ` Mimi Zohar
2024-12-31 10:00     ` Petr Vorel
2024-12-31 14:54       ` Mimi Zohar
2025-01-03 12:09         ` Petr Vorel
2025-01-03 12:18         ` Petr Vorel
2025-01-03 15:31           ` Mimi Zohar
2024-12-13 22:20 ` [LTP] [PATCH v2 3/8] tst_test.sh: IMA: Allow to disable LSM warnings and use it for IMA Petr Vorel
2024-12-13 22:20 ` [LTP] [PATCH v2 4/8] ima_setup: Print warning when policy not readable Petr Vorel
2024-12-13 22:20 ` [LTP] [PATCH v2 5/8] ima_kexec.sh: Move checking policy if readable to ima_setup.sh Petr Vorel
2024-12-13 22:20 ` [LTP] [PATCH v2 6/8] IMA: Add example policy for ima_violations.sh Petr Vorel
2024-12-31  3:43   ` Mimi Zohar
2024-12-31 10:40     ` Petr Vorel
2024-12-31 12:23     ` Petr Vorel
2024-12-31 15:34       ` Mimi Zohar
2025-01-03 19:02         ` Petr Vorel
2025-01-07 18:29           ` Mimi Zohar
2024-12-13 22:20 ` [LTP] [PATCH v2 7/8] ima_violations.sh: Check for a required policy Petr Vorel
2024-12-31  3:42   ` Mimi Zohar [this message]
2024-12-13 22:20 ` [LTP] [PATCH v2 8/8] [RFC] ima_kexec.sh: Relax result on unreadable policy to TCONF Petr Vorel

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=d4fd124d03bc2e13d62abe97febeb34c2ffe1603.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox