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