diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2018-06-04 16:54:55 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2018-07-18 07:27:22 -0400 |
commit | dba31ee759417ef1a952e929524b0cca1751c036 (patch) | |
tree | 99727ecda782f1856c8c5391fc0db9276384600e | |
parent | 2afd020aaeeefacb7711b47e3afb0cfb50db3f13 (diff) |
ima: Differentiate auditing policy rules from "audit" actions
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>
-rw-r--r-- | include/uapi/linux/audit.h | 1 | ||||
-rw-r--r-- | security/integrity/ima/ima_policy.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index c35aee9ad4a6..cf2bad8d7873 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h | |||
@@ -148,6 +148,7 @@ | |||
148 | #define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */ | 148 | #define AUDIT_INTEGRITY_PCR 1804 /* PCR invalidation msgs */ |
149 | #define AUDIT_INTEGRITY_RULE 1805 /* policy rule */ | 149 | #define AUDIT_INTEGRITY_RULE 1805 /* policy rule */ |
150 | #define AUDIT_INTEGRITY_EVM_XATTR 1806 /* New EVM-covered xattr */ | 150 | #define AUDIT_INTEGRITY_EVM_XATTR 1806 /* New EVM-covered xattr */ |
151 | #define AUDIT_INTEGRITY_POLICY_RULE 1807 /* IMA policy rules */ | ||
151 | 152 | ||
152 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | 153 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ |
153 | 154 | ||
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 0178bdaa40aa..8c9499867c91 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c | |||
@@ -681,8 +681,8 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) | |||
681 | bool uid_token; | 681 | bool uid_token; |
682 | int result = 0; | 682 | int result = 0; |
683 | 683 | ||
684 | ab = integrity_audit_log_start(NULL, GFP_KERNEL, | 684 | ab = integrity_audit_log_start(audit_context(), GFP_KERNEL, |
685 | AUDIT_INTEGRITY_RULE); | 685 | AUDIT_INTEGRITY_POLICY_RULE); |
686 | 686 | ||
687 | entry->uid = INVALID_UID; | 687 | entry->uid = INVALID_UID; |
688 | entry->fowner = INVALID_UID; | 688 | entry->fowner = INVALID_UID; |