Chris PeBenito 0fbfa5
#DESC Klogd - Kernel log daemon
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser  
Chris PeBenito 0fbfa5
# X-Debian-Packages: klogd
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#################################
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Rules for the klogd_t domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0907bd
daemon_domain(klogd, `, privmem, privkmsg, mlsfileread')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
tmp_domain(klogd)
Chris PeBenito 0fbfa5
allow klogd_t proc_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow klogd_t proc_t:lnk_file r_file_perms;
Chris PeBenito 0fbfa5
allow klogd_t proc_t:file { getattr read };
Chris PeBenito 0fbfa5
allow klogd_t self:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow klogd_t self:lnk_file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# read /etc/nsswitch.conf
Chris PeBenito 0fbfa5
allow klogd_t etc_t:lnk_file read;
Chris PeBenito 0fbfa5
allow klogd_t etc_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_locale(klogd_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow klogd_t etc_runtime_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Create unix sockets
Chris PeBenito 0fbfa5
allow klogd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Use the sys_admin and sys_rawio capabilities.
Chris PeBenito 0fbfa5
allow klogd_t self:capability { sys_admin sys_rawio };
Chris PeBenito 0fbfa5
dontaudit klogd_t self:capability sys_resource;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Read /proc/kmsg and /dev/mem.
Chris PeBenito 0fbfa5
allow klogd_t proc_kmsg_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow klogd_t memory_device_t:chr_file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Control syslog and console logging
Chris PeBenito 0fbfa5
allow klogd_t kernel_t:system { syslog_mod syslog_console };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Read /boot/System.map*
Chris PeBenito 0fbfa5
allow klogd_t system_map_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow klogd_t boot_t:dir r_dir_perms;
Chris PeBenito 5493c2
ifdef(`targeted_policy', `
Chris PeBenito 5493c2
allow klogd_t unconfined_t:system syslog_mod;
Chris PeBenito 5493c2
')