Chris PeBenito fee486
policy_module(snort, 1.9.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type snort_t;
Chris PeBenito 17de1b
type snort_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(snort_t, snort_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type snort_etc_t;
Chris PeBenito 06099d
files_config_file(snort_etc_t)
Chris PeBenito 06099d
Chris PeBenito 06099d
type snort_initrc_exec_t;
Chris PeBenito 06099d
init_script_file(snort_initrc_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type snort_log_t;
Chris PeBenito 17de1b
logging_log_file(snort_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type snort_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(snort_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type snort_var_run_t;
Chris PeBenito 17de1b
files_pid_file(snort_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow snort_t self:capability { setgid setuid net_admin net_raw dac_override };
Chris PeBenito 17de1b
dontaudit snort_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow snort_t self:process signal_perms;
Dominick Grift 7d1f56
allow snort_t self:netlink_route_socket create_netlink_socket_perms;
Chris PeBenito 17de1b
allow snort_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow snort_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
allow snort_t self:packet_socket create_socket_perms;
Jeremy Solt a49a82
allow snort_t self:socket create_socket_perms;
Chris PeBenito 06099d
# Snort IPS node. unverified.
Dominick Grift 7d1f56
allow snort_t self:netlink_firewall_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow snort_t snort_etc_t:dir list_dir_perms;
Chris PeBenito c0868a
allow snort_t snort_etc_t:file read_file_perms;
Dominick Grift 7d1f56
allow snort_t snort_etc_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(snort_t, snort_log_t, snort_log_t)
Chris PeBenito 0bfccd
create_dirs_pattern(snort_t, snort_log_t, snort_log_t)
Chris PeBenito 0bfccd
logging_log_filetrans(snort_t, snort_log_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(snort_t, snort_tmp_t, snort_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(snort_t, snort_tmp_t, snort_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(snort_t, snort_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(snort_t, snort_var_run_t, snort_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(snort_t, snort_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(snort_t)
Chris PeBenito ebf3ec
kernel_read_sysctl(snort_t)
Chris PeBenito 17de1b
kernel_list_proc(snort_t)
Chris PeBenito 17de1b
kernel_read_proc_symlinks(snort_t)
Jeremy Solt a49a82
kernel_request_load_module(snort_t)
Chris PeBenito 17de1b
kernel_dontaudit_read_system_state(snort_t)
Jeremy Solt dc7cc4
kernel_read_network_state(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(snort_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(snort_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(snort_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(snort_t)
Chris PeBenito 17de1b
corenet_raw_sendrecv_generic_if(snort_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(snort_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(snort_t)
Chris PeBenito c12621
corenet_raw_sendrecv_generic_node(snort_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(snort_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(snort_t)
Chris PeBenito ebf3ec
corenet_tcp_connect_prelude_port(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(snort_t)
Chris PeBenito 06099d
dev_read_rand(snort_t)
Chris PeBenito 06099d
dev_read_urand(snort_t)
Jeremy Solt dc7cc4
dev_read_usbmon_dev(snort_t)
Jeremy Solt a49a82
# Red Hat bug 559861: Snort wants read, write, and ioctl on /dev/usbmon
Jeremy Solt a49a82
# Snort uses libpcap, which can also monitor USB traffic. Maybe this is a side effect?
Jeremy Solt a49a82
dev_rw_generic_usb_dev(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(snort_t)
Chris PeBenito 17de1b
files_dontaudit_read_etc_runtime_files(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(snort_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 06099d
init_read_utmp(snort_t)
Chris PeBenito 06099d
Chris PeBenito 17de1b
logging_send_syslog_msg(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(snort_t)
Chris PeBenito ebf3ec
# snorts must be able to resolve dns in case it wants to relay to a remote prelude-manager
Chris PeBenito ebf3ec
sysnet_dns_name_resolve(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(snort_t)
Chris PeBenito 296273
userdom_dontaudit_search_user_home_dirs(snort_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito ebf3ec
	prelude_manage_spool(snort_t)
Chris PeBenito ebf3ec
')
Chris PeBenito ebf3ec
Chris PeBenito ebf3ec
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(snort_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(snort_t)
Chris PeBenito 17de1b
')