From 5873a528a93f25d440d18ccb5b6e9843c4f3f062 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sun, 25 Apr 2021 17:50:43 +0100 Subject: [PATCH] logging.if: Added interfaces for watching all and audit logs. Signed-off-by: Jonathan Davies --- policy/modules/system/logging.if | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if index 10dee6563..bbeefe0c5 100644 --- a/policy/modules/system/logging.if +++ b/policy/modules/system/logging.if @@ -146,6 +146,25 @@ interface(`logging_read_audit_log',` dontaudit $1 auditd_log_t:file map; ') +######################################## +## +## Watch the audit log. +## +## +## +## Domain allowed access. +## +## +## +# +interface(`logging_watch_audit_log',` + gen_require(` + type auditd_log_t; + ') + + allow $1 auditd_log_t:file watch; +') + ######################################## ## ## Execute auditctl in the auditctl domain. @@ -1072,6 +1091,25 @@ interface(`logging_read_all_logs',` read_files_pattern($1, logfile, logfile) ') +######################################## +## +## Watch all log files. +## +## +## +## Domain allowed access. +## +## +## +# +interface(`logging_watch_all_logs',` + gen_require(` + attribute logfile; + ') + + allow $1 logfile:file watch; +') + ######################################## ## ## Execute all log files in the caller domain.