Skip to content

Commit

Permalink
Merge pull request SELinuxProject#368 from jpds/admin-log-watch
Browse files Browse the repository at this point in the history
  • Loading branch information
pebenito committed Apr 26, 2021
2 parents 37d6892 + 431f03f commit 149ee62
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions policy/modules/roles/secadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ init_exec(secadm_t)
logging_read_audit_log(secadm_t)
logging_read_generic_logs(secadm_t)
logging_read_audit_config(secadm_t)
logging_watch_audit_log(secadm_t)

optional_policy(`
aide_run(secadm_t, secadm_r)
Expand Down
3 changes: 3 additions & 0 deletions policy/modules/roles/sysadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ corenet_ib_manage_subnet_unlabeled_endports(sysadm_t)

dev_read_kmsg(sysadm_t)

logging_watch_all_logs(sysadm_t)
logging_watch_audit_log(sysadm_t)

mls_process_read_all_levels(sysadm_t)

selinux_read_policy(sysadm_t)
Expand Down
38 changes: 38 additions & 0 deletions policy/modules/system/logging.if
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,25 @@ interface(`logging_read_audit_log',`
dontaudit $1 auditd_log_t:file map;
')

########################################
## <summary>
## Watch the audit log.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`logging_watch_audit_log',`
gen_require(`
type auditd_log_t;
')

allow $1 auditd_log_t:file watch;
')

########################################
## <summary>
## Execute auditctl in the auditctl domain.
Expand Down Expand Up @@ -1072,6 +1091,25 @@ interface(`logging_read_all_logs',`
read_files_pattern($1, logfile, logfile)
')

########################################
## <summary>
## Watch all log files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`logging_watch_all_logs',`
gen_require(`
attribute logfile;
')

allow $1 logfile:file watch;
')

########################################
## <summary>
## Execute all log files in the caller domain.
Expand Down

0 comments on commit 149ee62

Please sign in to comment.