selinux-refpolicy/policy/modules/admin/netutils.te

228 lines
5.7 KiB
Plaintext
Raw Normal View History

2005-05-05 17:44:36 +00:00
2006-10-18 19:25:27 +00:00
policy_module(netutils,1.2.0)
2005-05-05 17:44:36 +00:00
########################################
#
# Declarations
#
type netutils_t;
type netutils_exec_t;
2005-06-13 17:35:46 +00:00
init_system_domain(netutils_t,netutils_exec_t)
2005-05-05 17:44:36 +00:00
role system_r types netutils_t;
type netutils_tmp_t;
2005-06-13 17:35:46 +00:00
files_tmp_file(netutils_tmp_t)
2005-05-05 17:44:36 +00:00
2005-07-13 20:48:51 +00:00
type ping_t;
2005-05-05 17:44:36 +00:00
type ping_exec_t;
2005-06-13 17:35:46 +00:00
init_system_domain(ping_t,ping_exec_t)
2005-05-05 17:44:36 +00:00
role system_r types ping_t;
2005-07-13 20:48:51 +00:00
type traceroute_t;
2005-05-05 17:44:36 +00:00
type traceroute_exec_t;
2005-06-13 17:35:46 +00:00
init_system_domain(traceroute_t,traceroute_exec_t)
2005-05-05 17:44:36 +00:00
role system_r types traceroute_t;
########################################
#
# Netutils local policy
#
# Perform network administration operations and have raw access to the network.
allow netutils_t self:capability { net_admin net_raw setuid setgid };
allow netutils_t self:process { sigkill sigstop signull signal };
allow netutils_t self:netlink_route_socket { bind create getattr nlmsg_read nlmsg_write read write };
2005-06-09 17:21:52 +00:00
allow netutils_t self:packet_socket create_socket_perms;
allow netutils_t self:udp_socket create_socket_perms;
2005-11-10 21:37:54 +00:00
allow netutils_t self:tcp_socket create_stream_socket_perms;
2005-05-05 17:44:36 +00:00
2005-06-09 17:21:52 +00:00
allow netutils_t netutils_tmp_t:dir create_dir_perms;
allow netutils_t netutils_tmp_t:file create_file_perms;
2006-02-21 18:40:44 +00:00
files_tmp_filetrans(netutils_t, netutils_tmp_t, { file dir })
2005-05-05 17:44:36 +00:00
2005-07-12 20:34:24 +00:00
kernel_search_proc(netutils_t)
2006-05-29 19:53:43 +00:00
corenet_non_ipsec_sendrecv(netutils_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_sendrecv_all_if(netutils_t)
corenet_raw_sendrecv_all_if(netutils_t)
corenet_udp_sendrecv_all_if(netutils_t)
corenet_tcp_sendrecv_all_nodes(netutils_t)
corenet_raw_sendrecv_all_nodes(netutils_t)
corenet_udp_sendrecv_all_nodes(netutils_t)
corenet_tcp_sendrecv_all_ports(netutils_t)
corenet_udp_sendrecv_all_ports(netutils_t)
2005-09-13 13:06:07 +00:00
corenet_tcp_connect_all_ports(netutils_t)
2006-05-29 19:53:43 +00:00
corenet_sendrecv_all_client_packets(netutils_t)
corenet_udp_bind_generic_node(netutils_t)
2005-06-10 01:01:13 +00:00
fs_getattr_xattr_fs(netutils_t)
2005-05-05 17:44:36 +00:00
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(netutils_t)
2005-05-05 17:44:36 +00:00
files_read_etc_files(netutils_t)
2005-05-05 17:44:36 +00:00
# for nscd
2005-06-13 17:35:46 +00:00
files_dontaudit_search_var(netutils_t)
2005-05-05 17:44:36 +00:00
init_use_fds(netutils_t)
2006-02-02 21:08:12 +00:00
init_use_script_ptys(netutils_t)
2005-06-27 16:30:55 +00:00
2005-06-13 17:35:46 +00:00
libs_use_ld_so(netutils_t)
libs_use_shared_libs(netutils_t)
2005-05-05 17:44:36 +00:00
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(netutils_t)
2005-05-05 17:44:36 +00:00
miscfiles_read_localization(netutils_t)
2005-10-26 18:07:20 +00:00
sysnet_read_config(netutils_t)
2006-02-20 21:33:25 +00:00
userdom_use_all_users_fds(netutils_t)
2005-05-05 17:44:36 +00:00
2005-10-26 18:07:20 +00:00
ifdef(`targeted_policy',`
2006-02-02 21:08:12 +00:00
term_use_generic_ptys(netutils_t)
term_use_unallocated_ttys(netutils_t)
2005-10-26 18:07:20 +00:00
')
optional_policy(`
2005-06-27 16:30:55 +00:00
nis_use_ypbind(netutils_t)
')
2005-05-05 17:44:36 +00:00
########################################
#
# Ping local policy
#
allow ping_t self:capability { setuid net_raw };
2005-05-05 17:44:36 +00:00
dontaudit ping_t self:capability sys_tty_config;
2005-06-09 17:21:52 +00:00
allow ping_t self:tcp_socket create_socket_perms;
2005-05-05 17:44:36 +00:00
allow ping_t self:rawip_socket { create ioctl read write bind getopt setopt };
allow ping_t self:packet_socket { create ioctl read write bind getopt setopt };
2005-05-05 17:44:36 +00:00
2006-05-29 19:53:43 +00:00
corenet_non_ipsec_sendrecv(ping_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_sendrecv_all_if(ping_t)
corenet_raw_sendrecv_all_if(ping_t)
corenet_raw_sendrecv_all_nodes(ping_t)
corenet_tcp_sendrecv_all_nodes(ping_t)
corenet_tcp_sendrecv_all_ports(ping_t)
2005-05-05 17:44:36 +00:00
2005-06-10 01:01:13 +00:00
fs_dontaudit_getattr_xattr_fs(ping_t)
2005-05-05 17:44:36 +00:00
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(ping_t)
2005-05-05 17:44:36 +00:00
files_read_etc_files(ping_t)
2005-06-13 17:35:46 +00:00
files_dontaudit_search_var(ping_t)
2005-05-05 17:44:36 +00:00
2005-06-13 17:35:46 +00:00
libs_use_ld_so(ping_t)
libs_use_shared_libs(ping_t)
2005-05-05 17:44:36 +00:00
2005-06-13 17:35:46 +00:00
sysnet_read_config(ping_t)
2005-09-15 21:03:29 +00:00
sysnet_dns_name_resolve(ping_t)
2005-05-05 17:44:36 +00:00
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(ping_t)
2005-05-05 17:44:36 +00:00
2005-09-16 21:20:37 +00:00
ifdef(`hide_broken_symptoms',`
init_dontaudit_use_fds(ping_t)
2005-09-16 21:20:37 +00:00
')
ifdef(`targeted_policy',`
2006-02-02 21:08:12 +00:00
term_use_unallocated_ttys(ping_t)
term_use_generic_ptys(ping_t)
2005-06-10 01:01:13 +00:00
term_use_all_user_ttys(ping_t)
term_use_all_user_ptys(ping_t)
2005-09-16 21:20:37 +00:00
',`
tunable_policy(`user_ping',`
term_use_all_user_ttys(ping_t)
term_use_all_user_ptys(ping_t)
')
')
2005-05-05 17:44:36 +00:00
optional_policy(`
2005-06-27 16:30:55 +00:00
nis_use_ypbind(ping_t)
')
2005-05-05 17:44:36 +00:00
optional_policy(`
2006-02-02 21:08:12 +00:00
nscd_socket_use(ping_t)
2005-07-13 20:48:51 +00:00
')
optional_policy(`
2006-02-20 21:33:25 +00:00
pcmcia_use_cardmgr_fds(ping_t)
2005-09-16 21:20:37 +00:00
')
optional_policy(`
hotplug_use_fds(ping_t)
2005-06-29 20:53:53 +00:00
')
2005-05-05 17:44:36 +00:00
########################################
#
# Traceroute local policy
#
allow traceroute_t self:capability { net_admin net_raw setuid setgid };
2005-06-09 17:21:52 +00:00
allow traceroute_t self:rawip_socket create_socket_perms;
allow traceroute_t self:packet_socket create_socket_perms;
2005-05-05 17:44:36 +00:00
allow traceroute_t self:netlink_route_socket { bind create getattr nlmsg_read read write };
allow traceroute_t self:udp_socket create_socket_perms;
2005-05-05 17:44:36 +00:00
kernel_read_system_state(traceroute_t)
kernel_read_network_state(traceroute_t)
2006-05-29 19:53:43 +00:00
corenet_non_ipsec_sendrecv(traceroute_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_sendrecv_all_if(traceroute_t)
corenet_udp_sendrecv_all_if(traceroute_t)
corenet_raw_sendrecv_all_if(traceroute_t)
corenet_tcp_sendrecv_all_nodes(traceroute_t)
corenet_udp_sendrecv_all_nodes(traceroute_t)
2006-05-29 19:53:43 +00:00
corenet_raw_sendrecv_all_nodes(traceroute_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_sendrecv_all_ports(traceroute_t)
corenet_udp_sendrecv_all_ports(traceroute_t)
corenet_udp_bind_all_nodes(traceroute_t)
corenet_tcp_bind_all_nodes(traceroute_t)
# traceroute needs this but not tracepath
corenet_raw_bind_all_nodes(traceroute_t)
corenet_udp_bind_traceroute_port(traceroute_t)
corenet_tcp_connect_all_ports(traceroute_t)
2006-05-29 19:53:43 +00:00
corenet_sendrecv_all_client_packets(traceroute_t)
corenet_sendrecv_traceroute_server_packets(traceroute_t)
2005-05-05 17:44:36 +00:00
2005-06-10 01:01:13 +00:00
fs_dontaudit_getattr_xattr_fs(traceroute_t)
2005-05-05 17:44:36 +00:00
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(traceroute_t)
2005-05-05 17:44:36 +00:00
files_read_etc_files(traceroute_t)
2005-06-13 17:35:46 +00:00
files_dontaudit_search_var(traceroute_t)
2005-05-05 17:44:36 +00:00
init_use_fds(traceroute_t)
2005-06-13 17:35:46 +00:00
libs_use_ld_so(traceroute_t)
libs_use_shared_libs(traceroute_t)
2005-05-05 17:44:36 +00:00
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(traceroute_t)
2005-05-05 17:44:36 +00:00
miscfiles_read_localization(traceroute_t)
#rules needed for nmap
2005-06-13 16:22:32 +00:00
dev_read_rand(traceroute_t)
dev_read_urand(traceroute_t)
2005-06-13 17:35:46 +00:00
files_read_usr_files(traceroute_t)
2005-05-05 17:44:36 +00:00
sysnet_read_config(traceroute_t)
ifdef(`targeted_policy',`
2006-02-02 21:08:12 +00:00
term_use_unallocated_ttys(traceroute_t)
term_use_generic_ptys(traceroute_t)
',`
tunable_policy(`user_ping',`
term_use_all_user_ttys(traceroute_t)
term_use_all_user_ptys(traceroute_t)
')
')
2005-05-05 17:44:36 +00:00
optional_policy(`
2005-06-27 16:30:55 +00:00
nis_use_ypbind(traceroute_t)
')
2005-05-05 17:44:36 +00:00
optional_policy(`
2006-02-02 21:08:12 +00:00
nscd_socket_use(traceroute_t)
2005-07-13 20:48:51 +00:00
')