|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
5ea24b |
policy_module(netutils,1.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 |
2e0a88 |
allow netutils_t self:tcp_socket create_stream_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 |
103fe2 |
files_tmp_filetrans(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 |
bd7037 |
corenet_non_ipsec_sendrecv(netutils_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_bind_all_nodes(netutils_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_bind_all_nodes(netutils_t)
|
|
Chris PeBenito |
0907bd |
corenet_tcp_connect_all_ports(netutils_t)
|
|
Chris PeBenito |
0fd9dc |
|
|
Chris PeBenito |
0fd9dc |
fs_getattr_xattr_fs(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
15722e |
domain_use_interactive_fds(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 |
1c1ac6 |
init_use_fds(netutils_t)
|
|
Chris PeBenito |
1815ba |
init_use_script_ptys(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 |
d1b9d9 |
sysnet_read_config(netutils_t)
|
|
Chris PeBenito |
d1b9d9 |
|
|
Chris PeBenito |
15722e |
userdom_use_all_users_fds(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
d1b9d9 |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
1815ba |
term_use_generic_ptys(netutils_t)
|
|
Chris PeBenito |
1815ba |
term_use_unallocated_ttys(netutils_t)
|
|
Chris PeBenito |
d1b9d9 |
')
|
|
Chris PeBenito |
d1b9d9 |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
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 |
|
|
Don Miner |
8f882f |
allow ping_t self:capability { setuid net_raw };
|
|
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 |
bd7037 |
corenet_non_ipsec_sendrecv(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 |
15722e |
domain_use_interactive_fds(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 |
98a8ea |
sysnet_dns_name_resolve(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
c9428d |
logging_send_syslog_msg(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
cf6a7d |
ifdef(`hide_broken_symptoms',`
|
|
Chris PeBenito |
1c1ac6 |
init_dontaudit_use_fds(ping_t)
|
|
Chris PeBenito |
cf6a7d |
')
|
|
Chris PeBenito |
cf6a7d |
|
|
Chris PeBenito |
cf6a7d |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
1815ba |
term_use_unallocated_ttys(ping_t)
|
|
Chris PeBenito |
1815ba |
term_use_generic_ptys(ping_t)
|
|
Chris PeBenito |
0fd9dc |
term_use_all_user_ttys(ping_t)
|
|
Chris PeBenito |
0fd9dc |
term_use_all_user_ptys(ping_t)
|
|
Chris PeBenito |
cf6a7d |
',`
|
|
Chris PeBenito |
cf6a7d |
tunable_policy(`user_ping',`
|
|
Chris PeBenito |
cf6a7d |
term_use_all_user_ttys(ping_t)
|
|
Chris PeBenito |
cf6a7d |
term_use_all_user_ptys(ping_t)
|
|
Chris PeBenito |
cf6a7d |
')
|
|
Chris PeBenito |
3eed10 |
')
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
ab940a |
nis_use_ypbind(ping_t)
|
|
Chris PeBenito |
ab940a |
')
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
1815ba |
nscd_socket_use(ping_t)
|
|
Chris PeBenito |
493d6c |
')
|
|
Chris PeBenito |
493d6c |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
15722e |
pcmcia_use_cardmgr_fds(ping_t)
|
|
Chris PeBenito |
cf6a7d |
')
|
|
Chris PeBenito |
cf6a7d |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
1c1ac6 |
hotplug_use_fds(ping_t)
|
|
Chris PeBenito |
ebdc3b |
')
|
|
Chris PeBenito |
ebdc3b |
|
|
Chris PeBenito |
ab940a |
ifdef(`TODO',`
|
|
Chris PeBenito |
1f91e1 |
if(user_ping) {
|
|
Chris PeBenito |
4fc915 |
ifdef(`gnome-pty-helper.te', `allow ping_t gphdomain:fd use;')
|
|
Chris PeBenito |
1f91e1 |
}
|
|
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 };
|
|
Don Miner |
8f882f |
allow traceroute_t self:udp_socket create_socket_perms;
|
|
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 |
bd7037 |
corenet_non_ipsec_sendrecv(traceroute_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_udp_bind_all_nodes(traceroute_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_bind_all_nodes(traceroute_t)
|
|
Don Miner |
8f882f |
# traceroute needs this but not tracepath
|
|
Don Miner |
8f882f |
corenet_raw_bind_all_nodes(traceroute_t)
|
|
Chris PeBenito |
2705f9 |
corenet_tcp_connect_all_ports(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
0fd9dc |
fs_dontaudit_getattr_xattr_fs(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
15722e |
domain_use_interactive_fds(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 |
|
|
Don Miner |
8f882f |
sysnet_read_config(traceroute_t)
|
|
Don Miner |
8f882f |
|
|
Don Miner |
8f882f |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
1815ba |
term_use_unallocated_ttys(traceroute_t)
|
|
Chris PeBenito |
1815ba |
term_use_generic_ptys(traceroute_t)
|
|
Don Miner |
8f882f |
')
|
|
Don Miner |
8f882f |
|
|
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 |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
ab940a |
nis_use_ypbind(traceroute_t)
|
|
Chris PeBenito |
ab940a |
')
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
bb7170 |
optional_policy(`
|
|
Chris PeBenito |
1815ba |
nscd_socket_use(traceroute_t)
|
|
Chris PeBenito |
493d6c |
')
|
|
Chris PeBenito |
493d6c |
|
|
Chris PeBenito |
ab940a |
ifdef(`TODO',`
|
|
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
|