ima: add appraise action keywords and default rules
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 10 Mar 2011 03:25:48 +0000 (22:25 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Fri, 7 Sep 2012 18:57:45 +0000 (14:57 -0400)
commit07f6a79415d7d502ee0c7d02ace6594a7be7429a
treeaf2a9b3bb84ab621cbf11ab609dd8cc3566f2b12
parent2fe5d6def1672ae6635dd71867bf36dcfaa7434b
ima: add appraise action keywords and default rules

Unlike the IMA measurement policy, the appraise policy can not be dependent
on runtime process information, such as the task uid, as the 'security.ima'
xattr is written on file close and must be updated each time the file changes,
regardless of the current task uid.

This patch extends the policy language with 'fowner', defines an appraise
policy, which appraises all files owned by root, and defines 'ima_appraise_tcb',
a new boot command line option, to enable the appraise policy.

Changelog v3:
- separate the measure from the appraise rules in order to support measuring
  without appraising and appraising without measuring.
- change appraisal default for filesystems without xattr support to fail
- update default appraise policy for cgroups

Changelog v1:
- don't appraise RAMFS (Dmitry Kasatkin)
- merged rest of "ima: ima_must_appraise_or_measure API change" commit
  (Dmtiry Kasatkin)

  ima_must_appraise_or_measure() called ima_match_policy twice, which
  searched the policy for a matching rule.  Once for a matching measurement
  rule and subsequently for an appraisal rule. Searching the policy twice
  is unnecessary overhead, which could be noticeable with a large policy.

  The new version of ima_must_appraise_or_measure() does everything in a
  single iteration using a new version of ima_match_policy().  It returns
  IMA_MEASURE, IMA_APPRAISE mask.

  With the use of action mask only one efficient matching function
  is enough.  Removed other specific versions of matching functions.

Changelog:
- change 'owner' to 'fowner' to conform to the new LSM conditions posted by
  Roberto Sassu.
- fix calls to ima_log_string()

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Documentation/ABI/testing/ima_policy
Documentation/kernel-parameters.txt
security/integrity/ima/ima_appraise.c
security/integrity/ima/ima_policy.c
This page took 0.026057 seconds and 5 git commands to generate.