All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Petr Vorel <pvorel@suse.cz>, ltp@lists.linux.it
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Ignaz Forster <iforster@suse.de>,
	linux-integrity@vger.kernel.org
Subject: Re: [PATCH v3 3/4] ima/ima_measurements.sh: Require builtin IMA tcb policy
Date: Wed, 12 Jun 2019 11:06:51 -0400	[thread overview]
Message-ID: <1560352011.4578.43.camel@linux.ibm.com> (raw)
In-Reply-To: <20190611193021.17651-4-pvorel@suse.cz>

Hi Petr,

On Tue, 2019-06-11 at 21:30 +0200, Petr Vorel wrote:
> Although custom policy which contains tcb can be loaded via dracut,

^which may contain the equivalent measurement tcb rules

> systemd or later manually from user space, detecting it would require
> IMA_READ_POLICY=y. In order to simplify the check and avoid false
> positives lets ignore this option and require builtin IMA tcb policy.

This test is for adding new measurements to the measurement list.

> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  .../kernel/security/integrity/ima/tests/ima_measurements.sh    | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
> index 328affc43..a3aa24d8a 100755
> --- a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
> +++ b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
> @@ -57,7 +57,8 @@ setup()
>  	[ -z "$DIGEST_INDEX" ] && tst_brk TCONF \
>  		"Cannot find digest index (template: '$template')"
> 
> -	tst_res TINFO "IMA measurement tests assume tcb policy to be loaded (ima_policy=tcb)"
> +	grep -q -e ima_policy=[a-z_]*tcb -e ima_tcb -e ima_appraise_tcb /proc/cmdline || \
> +		tst_brk TCONF "IMA measurement tests require builtin IMA tcb policy (ima_policy=tcb or ima_policy=appraise_tcb kernel parameter)"
>  }
> 

"appraise_tcb" doesn't provide the necessary measurement rules.
"ima_policy=" isn't order specific.  The check would be for "|tcb", "|
tcb", "tcb|", "tcb |", or just "=tcb".  The deprecated "ima_tcb"
option is fine too.

Mimi

>  # TODO: find support for rmd128 rmd256 rmd320 wp256 wp384 tgr128 tgr160



WARNING: multiple messages have this Message-ID (diff)
From: Mimi Zohar <zohar@linux.ibm.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 3/4] ima/ima_measurements.sh: Require builtin IMA tcb policy
Date: Wed, 12 Jun 2019 11:06:51 -0400	[thread overview]
Message-ID: <1560352011.4578.43.camel@linux.ibm.com> (raw)
In-Reply-To: <20190611193021.17651-4-pvorel@suse.cz>

Hi Petr,

On Tue, 2019-06-11 at 21:30 +0200, Petr Vorel wrote:
> Although custom policy which contains tcb can be loaded via dracut,

^which may contain the equivalent measurement tcb rules

> systemd or later manually from user space, detecting it would require
> IMA_READ_POLICY=y. In order to simplify the check and avoid false
> positives lets ignore this option and require builtin IMA tcb policy.

This test is for adding new measurements to the measurement list.

> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  .../kernel/security/integrity/ima/tests/ima_measurements.sh    | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
> index 328affc43..a3aa24d8a 100755
> --- a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
> +++ b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
> @@ -57,7 +57,8 @@ setup()
>  	[ -z "$DIGEST_INDEX" ] && tst_brk TCONF \
>  		"Cannot find digest index (template: '$template')"
> 
> -	tst_res TINFO "IMA measurement tests assume tcb policy to be loaded (ima_policy=tcb)"
> +	grep -q -e ima_policy=[a-z_]*tcb -e ima_tcb -e ima_appraise_tcb /proc/cmdline || \
> +		tst_brk TCONF "IMA measurement tests require builtin IMA tcb policy (ima_policy=tcb or ima_policy=appraise_tcb kernel parameter)"
>  }
> 

"appraise_tcb" doesn't provide the necessary measurement rules.
"ima_policy=" isn't order specific.  The check would be for "|tcb", "|
tcb", "tcb|", "tcb |", or just "=tcb".  The deprecated "ima_tcb"
option is fine too.

Mimi

>  # TODO: find support for rmd128 rmd256 rmd320 wp256 wp384 tgr128 tgr160



  reply	other threads:[~2019-06-12 15:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 19:30 [PATCH v3 0/4] LTP reproducer on broken IMA on overlayfs Petr Vorel
2019-06-11 19:30 ` [LTP] " Petr Vorel
2019-06-11 19:30 ` [PATCH v3 1/4] ima: Call test's cleanup inside ima_setup.sh cleanup Petr Vorel
2019-06-11 19:30   ` [LTP] " Petr Vorel
2019-06-11 19:30 ` [PATCH v3 2/4] shell: Add $TST_DEVICE as default parameter to tst_umount Petr Vorel
2019-06-11 19:30   ` [LTP] " Petr Vorel
2019-06-11 19:30 ` [PATCH v3 3/4] ima/ima_measurements.sh: Require builtin IMA tcb policy Petr Vorel
2019-06-11 19:30   ` [LTP] " Petr Vorel
2019-06-12 15:06   ` Mimi Zohar [this message]
2019-06-12 15:06     ` Mimi Zohar
2019-06-13 16:10     ` Petr Vorel
2019-06-13 16:10       ` [LTP] " Petr Vorel
2019-06-11 19:30 ` [PATCH v3 4/4] ima: Add overlay test + doc Petr Vorel
2019-06-11 19:30   ` [LTP] " 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=1560352011.4578.43.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=iforster@suse.de \
    --cc=linux-integrity@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    --cc=zohar@linux.vnet.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 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.