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