ima: define a new policy condition based on the filesystem name
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Mon, 15 Jan 2018 16:20:36 +0000 (11:20 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Tue, 22 May 2018 11:33:53 +0000 (07:33 -0400)
commitf1b08bbcbdaf3160fa95ec95a760a49adf312b67
tree8eca8887dda0382e801a69102d6c2cce36616d61
parentfa516b66a1bfce1d72f1620c54bdfebc493000d1
ima: define a new policy condition based on the filesystem name

If/when file data signatures are distributed with the file data, this
patch will not be needed.  In the current environment where only some
files are signed, the ability to differentiate between file systems is
needed.  Some file systems consider the file system magic number
internal to the file system.

This patch defines a new IMA policy condition named "fsname", based on
the superblock's file_system_type (sb->s_type) name. This allows policy
rules to be expressed in terms of the filesystem name.

The following sample rules require file signatures on rootfs files
executed or mmap'ed.

appraise func=BPRM_CHECK fsname=rootfs appraise_type=imasig
appraise func=FILE_MMAP fsname=rootfs appraise_type=imasig

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Documentation/ABI/testing/ima_policy
security/integrity/ima/ima_policy.c