Chris PeBenito 31b7c0
#DESC LRRD - network-wide load graphing
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author:  Erich Schubert <erich@debian.org>
Chris PeBenito 31b7c0
# X-Debian-Packages: lrrd-client, lrrd-server
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the lrrd_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# lrrd_exec_t is the type of the lrrd executable.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
daemon_domain(lrrd)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow lrrd_t lrrd_var_run_t:sock_file create_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
etcdir_domain(lrrd)
Chris PeBenito 31b7c0
type lrrd_var_lib_t, file_type, sysadmfile;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
log_domain(lrrd)
Chris PeBenito 31b7c0
tmp_domain(lrrd)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# has cron jobs
Chris PeBenito 31b7c0
system_crond_entry(lrrd_exec_t, lrrd_t)
Chris PeBenito 31b7c0
allow crond_t lrrd_var_lib_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# init script
Chris PeBenito 31b7c0
allow initrc_t lrrd_log_t:file { write append setattr ioctl };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# allow to drop privileges and renice
Chris PeBenito 31b7c0
allow lrrd_t self:capability { setgid setuid };
Chris PeBenito 31b7c0
allow lrrd_t self:process { getsched setsched };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow lrrd_t urandom_device_t:chr_file { getattr read };
Chris PeBenito 31b7c0
allow lrrd_t proc_t:file { getattr read };
Chris PeBenito 31b7c0
allow lrrd_t usr_t:file { read ioctl };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_exec(lrrd_t, bin_t)
Chris PeBenito 31b7c0
allow lrrd_t bin_t:dir search;
Chris PeBenito 31b7c0
allow lrrd_t usr_t:lnk_file read;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Allow access to the lrrd databases
Chris PeBenito 31b7c0
create_dir_file(lrrd_t, lrrd_var_lib_t)
Chris PeBenito 31b7c0
allow lrrd_t var_lib_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# read config files
Chris PeBenito 31b7c0
r_dir_file(initrc_t, lrrd_etc_t)
Chris PeBenito 31b7c0
allow lrrd_t { etc_t etc_runtime_t }:{ file lnk_file } { read getattr };
Chris PeBenito 31b7c0
# for accessing the output directory
Chris PeBenito 31b7c0
ifdef(`apache.te', `
Chris PeBenito 31b7c0
allow lrrd_t httpd_sys_content_t:dir search;
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow lrrd_t etc_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_unix_connect(sysadm_t, lrrd_t)
Chris PeBenito 31b7c0
can_unix_connect(lrrd_t, lrrd_t)
Chris PeBenito 31b7c0
can_unix_send(lrrd_t, lrrd_t)
Chris PeBenito 31b7c0
can_network_server(lrrd_t)
Chris PeBenito 31b7c0
can_ypbind(lrrd_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`logrotate.te', `
Chris PeBenito 31b7c0
r_dir_file(logrotate_t, lrrd_etc_t)
Chris PeBenito 31b7c0
allow logrotate_t lrrd_var_lib_t:dir search;
Chris PeBenito 31b7c0
allow logrotate_t lrrd_var_run_t:dir search;
Chris PeBenito 31b7c0
allow logrotate_t lrrd_var_run_t:sock_file write;
Chris PeBenito 31b7c0
can_unix_connect(logrotate_t, lrrd_t)
Chris PeBenito 31b7c0
')