Chris PeBenito 0fbfa5
#DESC auditd - System auditing daemon
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Authors: Colin Walters <walters@verbum.org>
Chris PeBenito 0fbfa5
#
Chris PeBenito 605ba2
# Some fixes by Paul Moore <paul.moore@hp.com>
Chris PeBenito 605ba2
# 
Chris PeBenito 605ba2
define(`audit_manager_domain', `
Chris PeBenito 605ba2
allow $1 auditd_etc_t:file rw_file_perms;
Chris PeBenito 605ba2
create_dir_file($1, auditd_log_t)
Chris PeBenito 605ba2
domain_auto_trans($1, auditctl_exec_t, auditctl_t)
Chris PeBenito 605ba2
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
daemon_domain(auditd)
Chris PeBenito 605ba2
Chris PeBenito 605ba2
allow auditd_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay nlmsg_readpriv };
Chris PeBenito 0fbfa5
allow auditd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 605ba2
allow auditd_t self:capability { audit_write audit_control sys_nice sys_resource };
Chris PeBenito 605ba2
allow auditd_t self:process setsched;
Chris PeBenito 605ba2
allow auditd_t self:file { getattr read write };
Chris PeBenito 0fbfa5
allow auditd_t etc_t:file { getattr read };
Chris PeBenito 605ba2
Chris PeBenito 605ba2
# Do not use logdir_domain since this is a security file
Chris PeBenito 605ba2
type auditd_log_t, file_type, secure_file_type;
Chris PeBenito 605ba2
allow auditd_t var_log_t:dir search;
Chris PeBenito 605ba2
rw_dir_create_file(auditd_t, auditd_log_t)
Chris PeBenito 605ba2
Chris PeBenito 605ba2
can_exec(auditd_t, init_exec_t)
Chris PeBenito 605ba2
allow auditd_t initctl_t:fifo_file write;
Chris PeBenito 605ba2
Chris PeBenito 605ba2
ifdef(`targeted_policy', `
Chris PeBenito 605ba2
dontaudit auditd_t unconfined_t:fifo_file read;
Chris PeBenito 605ba2
')
Chris PeBenito 605ba2
Chris PeBenito 605ba2
type auditctl_t, domain, privlog;
Chris PeBenito 605ba2
type auditctl_exec_t, file_type, exec_type, sysadmfile;
Chris PeBenito 605ba2
uses_shlib(auditctl_t)
Chris PeBenito 605ba2
allow auditctl_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay nlmsg_readpriv };
Chris PeBenito 605ba2
allow auditctl_t self:capability { audit_write audit_control };
Chris PeBenito 605ba2
allow auditctl_t etc_t:file { getattr read };
Chris PeBenito 605ba2
allow auditctl_t admin_tty_type:chr_file rw_file_perms;
Chris PeBenito 605ba2
Chris PeBenito 605ba2
type auditd_etc_t, file_type, secure_file_type;
Chris PeBenito 605ba2
allow { auditd_t auditctl_t } auditd_etc_t:file r_file_perms;
Chris PeBenito 605ba2
allow initrc_t auditd_etc_t:file r_file_perms;
Chris PeBenito 605ba2
Chris PeBenito 605ba2
role secadm_r types auditctl_t;
Chris PeBenito 605ba2
role sysadm_r types auditctl_t;
Chris PeBenito 605ba2
audit_manager_domain(secadm_t)
Chris PeBenito 605ba2
Chris PeBenito 605ba2
ifdef(`targeted_policy', `', `
Chris PeBenito 605ba2
ifdef(`separate_secadm', `', `
Chris PeBenito 605ba2
audit_manager_domain(sysadm_t)
Chris PeBenito 605ba2
') 
Chris PeBenito 605ba2
')
Chris PeBenito 605ba2
Chris PeBenito 605ba2
role system_r types auditctl_t;
Chris PeBenito 605ba2
domain_auto_trans(initrc_t, auditctl_exec_t, auditctl_t)
Chris PeBenito 605ba2
Chris PeBenito 605ba2
dontaudit auditctl_t local_login_t:fd use;
Chris PeBenito 605ba2
allow auditctl_t proc_t:dir search;
Chris PeBenito 605ba2
allow auditctl_t sysctl_kernel_t:dir search;
Chris PeBenito 605ba2
allow auditctl_t sysctl_kernel_t:file { getattr read };
Chris PeBenito 605ba2
dontaudit auditctl_t init_t:fd use; 
Chris PeBenito 605ba2
allow auditctl_t initrc_devpts_t:chr_file { read write };
Chris PeBenito 605ba2
allow auditctl_t privfd:fd use;
Chris PeBenito 605ba2
Chris PeBenito 605ba2
Chris PeBenito 77f6e2
allow auditd_t sbin_t:dir search;
Chris PeBenito 77f6e2
can_exec(auditd_t, sbin_t)