]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ima: Differentiate auditing policy rules from "audit" actions
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Mon, 4 Jun 2018 20:54:55 +0000 (16:54 -0400)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Wed, 18 Jul 2018 11:27:22 +0000 (07:27 -0400)
The AUDIT_INTEGRITY_RULE is used for auditing IMA policy rules and
the IMA "audit" policy action.  This patch defines
AUDIT_INTEGRITY_POLICY_RULE to reflect the IMA policy rules.

Since we defined a new message type we can now also pass the
audit_context and get an associated SYSCALL record. This now produces
the following records when parsing IMA policy's rules:

type=UNKNOWN[1807] msg=audit(1527888965.738:320): action=audit \
  func=MMAP_CHECK mask=MAY_EXEC res=1
type=UNKNOWN[1807] msg=audit(1527888965.738:320): action=audit \
  func=FILE_CHECK mask=MAY_READ res=1
type=SYSCALL msg=audit(1527888965.738:320): arch=c000003e syscall=1 \
  success=yes exit=17 a0=1 a1=55bcfcca9030 a2=11 a3=7fcc1b55fb38 \
  items=0 ppid=1567 pid=1601 auid=0 uid=0 gid=0 euid=0 suid=0 \
  fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty2 ses=2 comm="echo" \
  exe="/usr/bin/echo" \
  subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
include/uapi/linux/audit.h
security/integrity/ima/ima_policy.c

index c35aee9ad4a6f7f7ffc3819f5c69425f42353a7f..cf2bad8d7873a4f0feb0801c1ceb984b6e3fbe1a 100644 (file)
 #define AUDIT_INTEGRITY_PCR        1804 /* PCR invalidation msgs */
 #define AUDIT_INTEGRITY_RULE       1805 /* policy rule */
 #define AUDIT_INTEGRITY_EVM_XATTR   1806 /* New EVM-covered xattr */
+#define AUDIT_INTEGRITY_POLICY_RULE 1807 /* IMA policy rules */
 
 #define AUDIT_KERNEL           2000    /* Asynchronous audit record. NOT A REQUEST. */
 
index 0178bdaa40aacc27d2602e5c3fb0945367eed168..8c9499867c918bb163946679f0e0d7f57fad5dfa 100644 (file)
@@ -681,8 +681,8 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
        bool uid_token;
        int result = 0;
 
-       ab = integrity_audit_log_start(NULL, GFP_KERNEL,
-                                      AUDIT_INTEGRITY_RULE);
+       ab = integrity_audit_log_start(audit_context(), GFP_KERNEL,
+                                      AUDIT_INTEGRITY_POLICY_RULE);
 
        entry->uid = INVALID_UID;
        entry->fowner = INVALID_UID;