Chris PeBenito e55160
Chris PeBenito e55160
policy_module(snort,1.0.0)
Chris PeBenito e55160
Chris PeBenito e55160
########################################
Chris PeBenito e55160
#
Chris PeBenito e55160
# Declarations
Chris PeBenito e55160
#
Chris PeBenito e55160
Chris PeBenito e55160
type snort_t;
Chris PeBenito e55160
type snort_exec_t;
Chris PeBenito e55160
init_daemon_domain(snort_t,snort_exec_t)
Chris PeBenito e55160
Chris PeBenito e55160
type snort_etc_t;
Chris PeBenito e55160
files_type(snort_etc_t)
Chris PeBenito e55160
Chris PeBenito e55160
type snort_log_t;
Chris PeBenito e55160
logging_log_file(snort_log_t)
Chris PeBenito e55160
Chris PeBenito e55160
type snort_tmp_t;
Chris PeBenito e55160
files_tmp_file(snort_tmp_t)
Chris PeBenito e55160
Chris PeBenito e55160
type snort_var_run_t;
Chris PeBenito e55160
files_pid_file(snort_var_run_t)
Chris PeBenito e55160
Chris PeBenito e55160
########################################
Chris PeBenito e55160
#
Chris PeBenito e55160
# Local policy
Chris PeBenito e55160
#
Chris PeBenito e55160
Chris PeBenito e55160
allow snort_t self:capability { setgid setuid net_admin net_raw dac_override };
Chris PeBenito e55160
dontaudit snort_t self:capability sys_tty_config;
Chris PeBenito e55160
allow snort_t self:process signal_perms;
Chris PeBenito e55160
allow snort_t self:netlink_route_socket { bind create getattr nlmsg_read read write };
Chris PeBenito e55160
allow snort_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito e55160
allow snort_t self:udp_socket create_socket_perms;
Chris PeBenito e55160
allow snort_t self:packet_socket create_socket_perms;
Chris PeBenito e55160
Chris PeBenito e55160
allow snort_t snort_etc_t:dir r_dir_perms;
Chris PeBenito e55160
allow snort_t snort_etc_t:file r_file_perms;
Chris PeBenito e55160
allow snort_t snort_etc_t:lnk_file { getattr read };
Chris PeBenito e55160
Chris PeBenito e55160
allow snort_t snort_log_t:file create_file_perms;
Chris PeBenito e55160
allow snort_t snort_log_t:dir { create rw_dir_perms };
Chris PeBenito e55160
logging_log_filetrans(snort_t,snort_log_t,{ file dir })
Chris PeBenito e55160
Chris PeBenito e55160
allow snort_t snort_tmp_t:dir create_dir_perms;
Chris PeBenito e55160
allow snort_t snort_tmp_t:file create_file_perms;
Chris PeBenito e55160
files_tmp_filetrans(snort_t, snort_tmp_t, { file dir })
Chris PeBenito e55160
Chris PeBenito e55160
allow snort_t snort_var_run_t:file create_file_perms;
Chris PeBenito e55160
allow snort_t snort_var_run_t:dir rw_dir_perms;
Chris PeBenito e55160
files_pid_filetrans(snort_t,snort_var_run_t,file)
Chris PeBenito e55160
Chris PeBenito e55160
kernel_read_kernel_sysctls(snort_t)
Chris PeBenito e55160
kernel_list_proc(snort_t)
Chris PeBenito e55160
kernel_read_proc_symlinks(snort_t)
Chris PeBenito e55160
kernel_dontaudit_read_system_state(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
corenet_non_ipsec_sendrecv(snort_t)
Chris PeBenito e55160
corenet_tcp_sendrecv_generic_if(snort_t)
Chris PeBenito e55160
corenet_udp_sendrecv_generic_if(snort_t)
Chris PeBenito e55160
corenet_raw_sendrecv_generic_if(snort_t)
Chris PeBenito e55160
corenet_tcp_sendrecv_all_nodes(snort_t)
Chris PeBenito e55160
corenet_udp_sendrecv_all_nodes(snort_t)
Chris PeBenito e55160
corenet_raw_sendrecv_all_nodes(snort_t)
Chris PeBenito e55160
corenet_tcp_sendrecv_all_ports(snort_t)
Chris PeBenito e55160
corenet_udp_sendrecv_all_ports(snort_t)
Chris PeBenito e55160
corenet_tcp_bind_all_nodes(snort_t)
Chris PeBenito e55160
corenet_udp_bind_all_nodes(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
dev_read_sysfs(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
domain_use_interactive_fds(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
files_read_etc_files(snort_t)
Chris PeBenito e55160
files_dontaudit_read_etc_runtime_files(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
fs_getattr_all_fs(snort_t)
Chris PeBenito e55160
fs_search_auto_mountpoints(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
term_dontaudit_use_console(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
init_use_fds(snort_t)
Chris PeBenito e55160
init_use_script_ptys(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
libs_use_ld_so(snort_t)
Chris PeBenito e55160
libs_use_shared_libs(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
logging_send_syslog_msg(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
miscfiles_read_localization(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
sysnet_read_config(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
userdom_dontaudit_use_unpriv_user_fds(snort_t)
Chris PeBenito e55160
userdom_dontaudit_search_sysadm_home_dirs(snort_t)
Chris PeBenito e55160
Chris PeBenito e55160
ifdef(`targeted_policy',`
Chris PeBenito e55160
	term_dontaudit_use_unallocated_ttys(snort_t)
Chris PeBenito e55160
	term_dontaudit_use_generic_ptys(snort_t)
Chris PeBenito e55160
	files_dontaudit_read_root_files(snort_t)
Chris PeBenito e55160
')
Chris PeBenito e55160
Chris PeBenito e55160
optional_policy(`
Chris PeBenito e55160
	seutil_sigchld_newrole(snort_t)
Chris PeBenito e55160
')
Chris PeBenito e55160
Chris PeBenito e55160
optional_policy(`
Chris PeBenito e55160
	udev_read_db(snort_t)
Chris PeBenito e55160
')