Skip to contentSkip to conversation

watchdog policy

DISCUSSION Russell Coker 1 participant 1 message Sep 11, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

I've attached a final version of my watchdog policy which should work fully and not cause your machine to lock during the reboot process.

Previous versions tended to lock machines and force a hardware reset (doing exactly what the watchdog is designed to prevent).

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

#DESC Watchdog - Software watchdog daemon
#
# Author: Russell Coker <[email protected]>
# X-Debian-Packages: watchdog
#

#################################
#
# Rules for the watchdog_t domain.
#

daemon_domain(watchdog, `, privmail')
type watchdog_device_t, file_type;

log_domain(watchdog)

allow watchdog_t { etc_t }:file r_file_perms; allow watchdog_t etc_t:lnk_file read;
allow watchdog_t self:unix_dgram_socket create_socket_perms;

allow watchdog_t proc_t:file r_file_perms;

allow watchdog_t self:capability { ipc_lock sys_nice }; allow watchdog_t self:fifo_file rw_file_perms; allow watchdog_t self:unix_stream_socket create_socket_perms; can_network(watchdog_t)
allow watchdog_t resolv_conf_t:file { getattr read }; allow watchdog_t self:udp_socket create_socket_perms; allow watchdog_t bin_t:dir search;
allow watchdog_t bin_t:lnk_file read;
allow watchdog_t init_t:process signal;
allow watchdog_t kernel_t:process sigstop;

allow watchdog_t watchdog_device_t:chr_file { getattr write };

# for orderly shutdown
can_exec(watchdog_t, shell_exec_t)
allow watchdog_t domain:process { signal_perms getsession };
allow watchdog_t watchdog_t:capability { kill };
allow watchdog_t sbin_t:dir search;
# for updating mtab on umount
file_type_auto_trans(watchdog_t, etc_t, etc_runtime_t, file)

allow watchdog_t self:capability { sys_admin net_admin sys_boot }; allow watchdog_t fixed_disk_device_t:blk_file swapon; allow watchdog_t { proc_t fs_t }:filesystem unmount;

# record the fact that we are going down
allow watchdog_t wtmp_t:file append;
# do not care about saving the random seed
dontaudit watchdog_t random_device_t:chr_file read;