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