Skip to contentSkip to conversation

audit: filter userspace audit messages on selinux context

PATCH New Eric Paris 1 participant 1 message Sep 16, 2010 Audit

lore
Share & tools
lore

Eric Paris

author maintainer
#0 lore raw

PATCH 1/1 audit: filter userspace audit messages on selinux context

We have the information, so lets allow userspace audit messages to be filtered based on the SELinux context. In particular this can be useful to shut up the login events generated every time a cron job runs.

---

 kernel/auditfilter.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
kernel/auditfilter.c +9 -0
index 30ccdb9..6e251df 100644
@@ -1252,6 +1252,15 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb,
 		case AUDIT_LOGINUID:
 			result = audit_comparator(cb->loginuid, f->op, f->val);
 			break;
+		case AUDIT_SUBJ_USER:
+		case AUDIT_SUBJ_ROLE:
+		case AUDIT_SUBJ_TYPE:
+		case AUDIT_SUBJ_SEN:
+		case AUDIT_SUBJ_CLR:
+			result = security_audit_rule_match(cb->sid, f->type,
+							   f->op, f->lsm_rule,
+							   NULL);
+			break;
 		}
 
 		if (!result)