Chris PeBenito 0fbfa5
#DESC Scannerdaemon - Virus scanner daemon
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Author:  Brian May <bam@snoopy.apana.org.au>
Chris PeBenito 0fbfa5
# X-Debian-Packages:
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#################################
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Rules for the scannerdaemon_t domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
type scannerdaemon_etc_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#networking
Chris PeBenito 0fbfa5
daemon_domain(scannerdaemon)
Chris PeBenito 0fbfa5
can_network_server(scannerdaemon_t)
Chris PeBenito 0fbfa5
ifdef(`postfix.te',
Chris PeBenito 0fbfa5
`can_tcp_connect(postfix_bounce_t,scannerdaemon_t);')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for testing
Chris PeBenito 0fbfa5
can_tcp_connect(sysadm_t,scannerdaemon_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Can create unix sockets
Chris PeBenito 0fbfa5
allow scannerdaemon_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access config files (libc6).
Chris PeBenito 0fbfa5
allow scannerdaemon_t etc_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow scannerdaemon_t etc_t:lnk_file r_file_perms;
Chris PeBenito 0fbfa5
allow scannerdaemon_t proc_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow scannerdaemon_t etc_runtime_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access config files (scannerdaemon).
Chris PeBenito 0fbfa5
allow scannerdaemon_t scannerdaemon_etc_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access signature files.
Chris PeBenito 0fbfa5
ifdef(`oav-update.te',`
Chris PeBenito 0fbfa5
allow scannerdaemon_t oav_update_var_lib_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow scannerdaemon_t oav_update_var_lib_t:file r_file_perms;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
log_domain(scannerdaemon)
Chris PeBenito 0fbfa5
ifdef(`logrotate.te', `
Chris PeBenito 0fbfa5
allow logrotate_t scannerdaemon_log_t:file create_file_perms;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Can run kaffe
Chris PeBenito 0fbfa5
# Run helper programs.
Chris PeBenito 0fbfa5
can_exec_any(scannerdaemon_t)
Chris PeBenito 0fbfa5
allow scannerdaemon_t var_lib_t:dir search;
Chris PeBenito 0fbfa5
allow scannerdaemon_t { sbin_t bin_t }:dir search;
Chris PeBenito 0fbfa5
allow scannerdaemon_t bin_t:lnk_file read;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# unknown stuff
Chris PeBenito 0fbfa5
allow scannerdaemon_t self:fifo_file { read write };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# broken stuff
Chris PeBenito 0fbfa5
dontaudit scannerdaemon_t sysadm_home_dir_t:dir search;
Chris PeBenito 0fbfa5
dontaudit scannerdaemon_t devtty_t:chr_file { read write };
Chris PeBenito 0fbfa5
dontaudit scannerdaemon_t shadow_t:file { read getattr };