Chris PeBenito 0fbfa5
#DESC Acct - BSD process accounting
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito 0fbfa5
# X-Debian-Packages: acct
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#################################
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Rules for the acct_t domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# acct_exec_t is the type of the acct executable.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
daemon_base_domain(acct)
Chris PeBenito 0fbfa5
ifdef(`crond.te', `
Chris PeBenito 0fbfa5
system_crond_entry(acct_exec_t, acct_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for monthly cron job
Chris PeBenito 0fbfa5
file_type_auto_trans(acct_t, var_log_t, wtmp_t, file)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for SSP
Chris PeBenito 0fbfa5
allow acct_t urandom_device_t:chr_file read;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
type acct_data_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t self:capability sys_pacct;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# gzip needs chown capability for some reason
Chris PeBenito 0fbfa5
allow acct_t self:capability chown;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t var_t:dir { getattr search };
Chris PeBenito 0fbfa5
rw_dir_create_file(acct_t, acct_data_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
can_exec(acct_t, { shell_exec_t bin_t initrc_exec_t acct_exec_t })
Chris PeBenito 0fbfa5
allow acct_t { bin_t sbin_t }:dir search;
Chris PeBenito 0fbfa5
allow acct_t bin_t:lnk_file read;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_locale(acct_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t self:capability fsetid;
Chris PeBenito 0fbfa5
allow acct_t fs_t:filesystem getattr;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t self:fifo_file { read write getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t proc_t:file { read getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_sysctl(acct_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
dontaudit acct_t sysadm_home_dir_t:dir { getattr search };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for nscd
Chris PeBenito 0fbfa5
dontaudit acct_t var_run_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# not sure why we need this, the command "last" is reported as using it
Chris PeBenito 0fbfa5
dontaudit acct_t self:capability kill;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t devtty_t:chr_file { read write };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow acct_t { etc_t etc_runtime_t }:file { read getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`logrotate.te', `
Chris PeBenito 0fbfa5
domain_auto_trans(logrotate_t, acct_exec_t, acct_t)
Chris PeBenito 0fbfa5
rw_dir_create_file(logrotate_t, acct_data_t)
Chris PeBenito 0fbfa5
can_exec(logrotate_t, acct_data_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5