Chris PeBenito 31b7c0
#DESC Watchdog - Software watchdog daemon
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito 31b7c0
# X-Debian-Packages: watchdog
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the watchdog_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
daemon_domain(watchdog, `, privmail')
Chris PeBenito 31b7c0
type watchdog_device_t, device_type, dev_fs;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow watchdog_t self:process setsched;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
log_domain(watchdog)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow watchdog_t etc_t:file r_file_perms;
Chris PeBenito 31b7c0
allow watchdog_t etc_t:lnk_file read;
Chris PeBenito 31b7c0
allow watchdog_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow watchdog_t proc_t:file r_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow watchdog_t self:capability { ipc_lock sys_pacct sys_nice sys_resource };
Chris PeBenito 31b7c0
allow watchdog_t self:fifo_file rw_file_perms;
Chris PeBenito 31b7c0
allow watchdog_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 31b7c0
can_network(watchdog_t)
Chris PeBenito 31b7c0
allow watchdog_t port_type:tcp_socket name_connect;
Chris PeBenito 31b7c0
can_ypbind(watchdog_t)
Chris PeBenito 31b7c0
allow watchdog_t bin_t:dir search;
Chris PeBenito 31b7c0
allow watchdog_t bin_t:lnk_file read;
Chris PeBenito 31b7c0
allow watchdog_t init_t:process signal;
Chris PeBenito 31b7c0
allow watchdog_t kernel_t:process sigstop;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow watchdog_t watchdog_device_t:chr_file { getattr write };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for orderly shutdown
Chris PeBenito 31b7c0
can_exec(watchdog_t, shell_exec_t)
Chris PeBenito 31b7c0
allow watchdog_t domain:process { signal_perms getsession };
Chris PeBenito 31b7c0
allow watchdog_t self:capability kill;
Chris PeBenito 31b7c0
allow watchdog_t sbin_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for updating mtab on umount
Chris PeBenito 31b7c0
file_type_auto_trans(watchdog_t, etc_t, etc_runtime_t, file)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow watchdog_t self:capability { sys_admin net_admin sys_boot };
Chris PeBenito 31b7c0
allow watchdog_t fixed_disk_device_t:blk_file swapon;
Chris PeBenito 31b7c0
allow watchdog_t { proc_t fs_t }:filesystem unmount;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# record the fact that we are going down
Chris PeBenito 31b7c0
allow watchdog_t wtmp_t:file append;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# do not care about saving the random seed
Chris PeBenito 31b7c0
dontaudit watchdog_t { urandom_device_t random_device_t }:chr_file read;