Chris PeBenito 4fc915
Chris PeBenito 4fc915
policy_module(devices,1.0)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
########################################
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
# Declarations
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
Chris PeBenito 4fc915
type netutils_t;
Chris PeBenito 4fc915
type netutils_exec_t;
Chris PeBenito c9428d
init_system_domain(netutils_t,netutils_exec_t)
Chris PeBenito 4fc915
role system_r types netutils_t;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
type netutils_tmp_t;
Chris PeBenito c9428d
files_tmp_file(netutils_tmp_t)
Chris PeBenito 4fc915
Chris PeBenito 493d6c
type ping_t;
Chris PeBenito 4fc915
type ping_exec_t;
Chris PeBenito c9428d
init_system_domain(ping_t,ping_exec_t)
Chris PeBenito 4fc915
role system_r types ping_t;
Chris PeBenito 4fc915
Chris PeBenito 493d6c
type traceroute_t;
Chris PeBenito 4fc915
type traceroute_exec_t;
Chris PeBenito c9428d
init_system_domain(traceroute_t,traceroute_exec_t)
Chris PeBenito 4fc915
role system_r types traceroute_t;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
########################################
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
# Netutils local policy
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Perform network administration operations and have raw access to the network.
Chris PeBenito 4fc915
allow netutils_t self:capability { net_admin net_raw setuid setgid };
Chris PeBenito 4fc915
allow netutils_t self:process { sigkill sigstop signull signal };
Chris PeBenito 4fc915
allow netutils_t self:netlink_route_socket { bind create getattr nlmsg_read nlmsg_write read write };
Chris PeBenito dc67f7
allow netutils_t self:packet_socket create_socket_perms;
Chris PeBenito dc67f7
allow netutils_t self:udp_socket create_socket_perms;
Chris PeBenito dc67f7
allow netutils_t self:tcp_socket create_socket_perms;
Chris PeBenito 4fc915
Chris PeBenito dc67f7
allow netutils_t netutils_tmp_t:dir create_dir_perms;
Chris PeBenito dc67f7
allow netutils_t netutils_tmp_t:file create_file_perms;
Chris PeBenito c9428d
files_create_tmp_files(netutils_t, netutils_tmp_t, { file dir })
Chris PeBenito 4fc915
Chris PeBenito b24f35
kernel_search_proc(netutils_t)
Chris PeBenito b24f35
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_if(netutils_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_if(netutils_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_if(netutils_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_nodes(netutils_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_nodes(netutils_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_nodes(netutils_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_ports(netutils_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_ports(netutils_t)
Chris PeBenito 0fd9dc
corenet_tcp_bind_all_nodes(netutils_t)
Chris PeBenito 0fd9dc
corenet_udp_bind_all_nodes(netutils_t)
Chris PeBenito 0fd9dc
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
domain_use_wide_inherit_fd(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito 8fd367
files_read_etc_files(netutils_t)
Chris PeBenito 4fc915
# for nscd
Chris PeBenito c9428d
files_dontaudit_search_var(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito ab940a
init_use_fd(netutils_t)
Chris PeBenito ab940a
init_use_script_pty(netutils_t)
Chris PeBenito ab940a
Chris PeBenito c9428d
libs_use_ld_so(netutils_t)
Chris PeBenito c9428d
libs_use_shared_libs(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
logging_send_syslog_msg(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
miscfiles_read_localization(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito ab940a
userdom_use_all_user_fd(netutils_t)
Chris PeBenito 4fc915
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(netutils_t)
Chris PeBenito ab940a
')
Chris PeBenito 4fc915
Chris PeBenito ab940a
ifdef(`TODO',`
Chris PeBenito 4fc915
ifdef(`gnome-pty-helper.te', `allow netutils_t sysadm_gph_t:fd use;')
Chris PeBenito 4fc915
') dnl end TODO
Chris PeBenito 4fc915
Chris PeBenito 4fc915
########################################
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
# Ping local policy
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow ping_t self:capability setuid;
Chris PeBenito 4fc915
dontaudit ping_t self:capability sys_tty_config;
Chris PeBenito 4fc915
Chris PeBenito dc67f7
allow ping_t self:tcp_socket create_socket_perms;
Chris PeBenito dc67f7
allow ping_t self:udp_socket create_socket_perms;
Chris PeBenito 4fc915
allow ping_t self:rawip_socket { create ioctl read write bind getopt setopt };
Chris PeBenito 4fc915
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_if(ping_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_if(ping_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_if(ping_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_nodes(ping_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_nodes(ping_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_nodes(ping_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_ports(ping_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_ports(ping_t)
Chris PeBenito 0fd9dc
corenet_udp_bind_all_nodes(ping_t)
Chris PeBenito 0fd9dc
corenet_tcp_bind_all_nodes(ping_t)
Chris PeBenito 4fc915
Chris PeBenito 0fd9dc
fs_dontaudit_getattr_xattr_fs(ping_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
domain_use_wide_inherit_fd(ping_t)
Chris PeBenito 4fc915
Chris PeBenito 8fd367
files_read_etc_files(ping_t)
Chris PeBenito c9428d
files_dontaudit_search_var(ping_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
libs_use_ld_so(ping_t)
Chris PeBenito c9428d
libs_use_shared_libs(ping_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
sysnet_read_config(ping_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
logging_send_syslog_msg(ping_t)
Chris PeBenito 4fc915
Chris PeBenito 3eed10
tunable_policy(`user_ping',`
Chris PeBenito 0fd9dc
	term_use_all_user_ttys(ping_t)
Chris PeBenito 0fd9dc
	term_use_all_user_ptys(ping_t)
Chris PeBenito 3eed10
')
Chris PeBenito 4fc915
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(ping_t)
Chris PeBenito ab940a
')
Chris PeBenito 4fc915
Chris PeBenito 493d6c
optional_policy(`nscd.te',`
Chris PeBenito 493d6c
	nscd_use_socket(ping_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito ebdc3b
optional_policy(`sysnetwork.te',`
Chris PeBenito ebdc3b
	optional_policy(`hotplug.te',`
Chris PeBenito ebdc3b
		hotplug_use_fd(ping_t)
Chris PeBenito ebdc3b
	')
Chris PeBenito ebdc3b
')
Chris PeBenito ebdc3b
Chris PeBenito ab940a
ifdef(`TODO',`
Chris PeBenito fd9dee
in_user_role(ping_t)
Chris PeBenito 3eed10
tunable_policy(`user_ping',`
Chris PeBenito 4fc915
	domain_auto_trans(unpriv_userdomain, ping_exec_t, ping_t)
Chris PeBenito 4fc915
	ifdef(`gnome-pty-helper.te', `allow ping_t gphdomain:fd use;')
Chris PeBenito 3eed10
')
Chris PeBenito fd89e1
ifdef(`cardmgr.te',`
Chris PeBenito fd89e1
	allow ping_t cardmgr_t:fd use;
Chris PeBenito fd89e1
')
Chris PeBenito 4fc915
') dnl end TODO
Chris PeBenito 4fc915
Chris PeBenito 4fc915
########################################
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
# Traceroute local policy
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow traceroute_t self:capability { net_admin net_raw setuid setgid };
Chris PeBenito dc67f7
allow traceroute_t self:rawip_socket create_socket_perms;
Chris PeBenito dc67f7
allow traceroute_t self:packet_socket create_socket_perms;
Chris PeBenito 4fc915
allow traceroute_t self:netlink_route_socket { bind create getattr nlmsg_read read write };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
kernel_read_system_state(traceroute_t)
Chris PeBenito 4fc915
kernel_read_network_state(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_if(traceroute_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_if(traceroute_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_if(traceroute_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_nodes(traceroute_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_nodes(traceroute_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_nodes(traceroute_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_ports(traceroute_t)
Chris PeBenito 0fd9dc
corenet_udp_sendrecv_all_ports(traceroute_t)
Chris PeBenito 0fd9dc
corenet_udp_bind_all_nodes(traceroute_t)
Chris PeBenito 0fd9dc
corenet_tcp_bind_all_nodes(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito 0fd9dc
fs_dontaudit_getattr_xattr_fs(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
domain_use_wide_inherit_fd(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito 8fd367
files_read_etc_files(traceroute_t)
Chris PeBenito c9428d
files_dontaudit_search_var(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
libs_use_ld_so(traceroute_t)
Chris PeBenito c9428d
libs_use_shared_libs(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
logging_send_syslog_msg(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
miscfiles_read_localization(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
#rules needed for nmap
Karl MacMillan f0c985
dev_read_rand(traceroute_t)
Karl MacMillan f0c985
dev_read_urand(traceroute_t)
Chris PeBenito c9428d
files_read_usr_files(traceroute_t)
Chris PeBenito 4fc915
Chris PeBenito 3eed10
tunable_policy(`user_ping',`
Chris PeBenito 0fd9dc
	term_use_all_user_ttys(traceroute_t)
Chris PeBenito 0fd9dc
	term_use_all_user_ptys(traceroute_t)
Chris PeBenito 3eed10
')
Chris PeBenito 4fc915
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(traceroute_t)
Chris PeBenito ab940a
')
Chris PeBenito 4fc915
Chris PeBenito 493d6c
optional_policy(`nscd.te',`
Chris PeBenito 493d6c
	nscd_use_socket(traceroute_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito ab940a
ifdef(`TODO',`
Chris PeBenito 4fc915
in_user_role(traceroute_t)
Chris PeBenito 3eed10
tunable_policy(`user_ping',`
Chris PeBenito 4fc915
	domain_auto_trans(unpriv_userdomain, traceroute_exec_t, traceroute_t)
Chris PeBenito 3eed10
')
Chris PeBenito ab940a
ifdef(`gnome-pty-helper.te', `allow traceroute_t sysadm_gph_t:fd use;')
Chris PeBenito 4fc915
#rules needed for nmap
Chris PeBenito 4fc915
dontaudit traceroute_t userdomain:dir search;
Chris PeBenito 4fc915
') dnl end TODO