lkml.org 
[lkml]   [2013]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/6] ima: With appraise_type=optional, audit log some messages as info
Date
Currently, if there integrity status is not INTEGRITY_PASS, it is
logged in audit log (as non info). This is fine because we always
deny access to file for anything other than INTEGRITY_PASS.

But with appraise_type=optional, we will allow access to file even
if appraisal status is not INTEGRITY_PASS. For example, in the case
of INTEGRITY_IMA_NOLABEL. And on this system we don't want to log
each and every executed file which is not signed.

In a typical system we are anticipating that only 1-2 files will
be signed.

So don't flood the audit logs if appraise_type=optional and no
IMA label is present. These messages will still show up if somebody
chooses to enable audit info messages.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
security/integrity/ima/ima_appraise.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c
index af39a08..ddeadc7 100644
--- a/security/integrity/ima/ima_appraise.c
+++ b/security/integrity/ima/ima_appraise.c
@@ -124,7 +124,7 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint,
enum integrity_status status = INTEGRITY_UNKNOWN;
const char *op = "appraise_data";
char *cause = "unknown";
- int rc;
+ int rc, audit_info = 0;

if (!ima_appraise)
return 0;
@@ -199,8 +199,16 @@ out:
if (!ima_fix_xattr(dentry, iint))
status = INTEGRITY_PASS;
}
+
+ /*
+ * If appraisal is optional, and if no label is present,
+ * log it is info. Don't flood audit logs.
+ */
+ if ((iint->flags & IMA_APPRAISAL_OPT) &&
+ status == INTEGRITY_IMA_NOLABEL)
+ audit_info = 1;
integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode, filename,
- op, cause, rc, 0);
+ op, cause, rc, audit_info);
} else {
ima_cache_flags(iint, func);
}
--
1.7.7.6


\
 
 \ /
  Last update: 2013-02-14 21:43    [W:0.158 / U:1.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site