Chris PeBenito 17de1b
Chris PeBenito a52b4d
policy_module(oav,1.1.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type oav_update_t;
Chris PeBenito 17de1b
type oav_update_exec_t;
Chris PeBenito 17de1b
domain_type(oav_update_t)
Chris PeBenito 17de1b
domain_entry_file(oav_update_t,oav_update_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# cjp: may be collapsable to etc_t
Chris PeBenito 17de1b
type oav_update_etc_t;
Chris PeBenito 17de1b
files_type(oav_update_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type oav_update_var_lib_t;
Chris PeBenito 17de1b
files_type(oav_update_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type scannerdaemon_t;
Chris PeBenito 17de1b
type scannerdaemon_exec_t;
Chris PeBenito 17de1b
init_daemon_domain(scannerdaemon_t,scannerdaemon_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type scannerdaemon_etc_t;
Chris PeBenito 17de1b
files_type(scannerdaemon_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type scannerdaemon_log_t;
Chris PeBenito 17de1b
logging_log_file(scannerdaemon_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type scannerdaemon_var_run_t;
Chris PeBenito 17de1b
files_pid_file(scannerdaemon_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# OAV update local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow oav_update_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow oav_update_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Can read /etc/oav-update/* files
Chris PeBenito 17de1b
allow oav_update_t oav_update_etc_t:dir r_dir_perms;
Chris PeBenito 17de1b
allow oav_update_t oav_update_etc_t:file r_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Can read /var/lib/oav-update/current
Chris PeBenito 17de1b
allow oav_update_t oav_update_var_lib_t:dir manage_dir_perms;
Chris PeBenito 17de1b
allow oav_update_t oav_update_var_lib_t:file manage_file_perms;
Chris PeBenito 17de1b
allow oav_update_t oav_update_var_lib_t:lnk_file r_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_all_executables(oav_update_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(oav_update_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(oav_update_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(oav_update_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(oav_update_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(oav_update_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(oav_update_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(oav_update_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_exec_etc_files(oav_update_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(oav_update_t)
Chris PeBenito 17de1b
libs_use_shared_libs(oav_update_t)
Chris PeBenito 17de1b
libs_exec_ld_so(oav_update_t)
Chris PeBenito 17de1b
libs_exec_lib_files(oav_update_t)
Chris PeBenito 17de1b
libs_use_ld_so(oav_update_t)
Chris PeBenito 17de1b
libs_use_shared_libs(oav_update_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(oav_update_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(oav_update_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	cron_system_entry(oav_update_t,oav_update_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Scannerdaemon local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dontaudit scannerdaemon_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow scannerdaemon_t self:process signal_perms;
Chris PeBenito 17de1b
allow scannerdaemon_t self:fifo_file { read write };
Chris PeBenito 17de1b
allow scannerdaemon_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow scannerdaemon_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow scannerdaemon_t oav_update_var_lib_t:dir r_dir_perms;
Chris PeBenito 17de1b
allow scannerdaemon_t oav_update_var_lib_t:file r_file_perms;
Chris PeBenito 17de1b
files_search_var_lib(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow scannerdaemon_t scannerdaemon_etc_t:file r_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow scannerdaemon_t scannerdaemon_log_t:file create_file_perms;
Chris PeBenito 17de1b
logging_log_filetrans(scannerdaemon_t,scannerdaemon_log_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow scannerdaemon_t scannerdaemon_var_run_t:file create_file_perms;
Chris PeBenito 17de1b
allow scannerdaemon_t scannerdaemon_var_run_t:dir rw_dir_perms;
Chris PeBenito 17de1b
files_pid_filetrans(scannerdaemon_t,scannerdaemon_var_run_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(scannerdaemon_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Can run kaffe
Chris PeBenito 17de1b
corecmd_exec_all_executables(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(scannerdaemon_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(scannerdaemon_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(scannerdaemon_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(scannerdaemon_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(scannerdaemon_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(scannerdaemon_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(scannerdaemon_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(scannerdaemon_t)
Chris PeBenito 17de1b
# Can run kaffe
Chris PeBenito 17de1b
files_exec_etc_files(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(scannerdaemon_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_console(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_dontaudit_read_shadow(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(scannerdaemon_t)
Chris PeBenito 17de1b
init_use_script_ptys(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(scannerdaemon_t)
Chris PeBenito 17de1b
libs_use_shared_libs(scannerdaemon_t)
Chris PeBenito 17de1b
# Can run kaffe
Chris PeBenito 17de1b
libs_use_ld_so(scannerdaemon_t)
Chris PeBenito 17de1b
libs_use_shared_libs(scannerdaemon_t)
Chris PeBenito 17de1b
libs_exec_ld_so(scannerdaemon_t)
Chris PeBenito 17de1b
libs_exec_lib_files(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(scannerdaemon_t)
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(scannerdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	term_dontaudit_use_unallocated_ttys(scannerdaemon_t)
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(scannerdaemon_t)
Chris PeBenito 17de1b
	files_dontaudit_read_root_files(scannerdaemon_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(scannerdaemon_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(scannerdaemon_t)
Chris PeBenito 17de1b
')