|
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 |
4fc915 |
type ping_t; #, nscd_client_domain;
|
|
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 |
4fc915 |
type traceroute_t; #, nscd_client_domain;
|
|
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 |
# Control users use of ping and traceroute
|
|
Chris PeBenito |
4fc915 |
#
|
|
Chris PeBenito |
4fc915 |
bool user_ping false;
|
|
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 |
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 |
init_use_fd(netutils_t)
|
|
Chris PeBenito |
c9428d |
init_use_script_pty(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
c9428d |
domain_use_wide_inherit_fd(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
c9428d |
files_read_generic_etc_files(netutils_t)
|
|
Chris PeBenito |
4fc915 |
# for nscd
|
|
Chris PeBenito |
c9428d |
files_dontaudit_search_var(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
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 |
4fc915 |
ifdef(`TODO',`
|
|
Chris PeBenito |
4fc915 |
role sysadm_r types netutils_t;
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
can_ypbind(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
domain_auto_trans(sysadm_t, netutils_exec_t, netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
# Inherit and use descriptors from init.
|
|
Chris PeBenito |
4fc915 |
allow netutils_t userdomain:fd use;
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
# Access terminals.
|
|
Chris PeBenito |
4fc915 |
allow netutils_t admin_tty_type:chr_file rw_file_perms;
|
|
Chris PeBenito |
4fc915 |
ifdef(`gnome-pty-helper.te', `allow netutils_t sysadm_gph_t:fd use;')
|
|
Chris PeBenito |
4fc915 |
allow netutils_t proc_t:dir search;
|
|
Chris PeBenito |
4fc915 |
|
|
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 |
c9428d |
files_read_generic_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 |
4fc915 |
if (user_ping) {
|
|
Chris PeBenito |
0fd9dc |
term_use_all_user_ttys(ping_t)
|
|
Chris PeBenito |
0fd9dc |
term_use_all_user_ptys(ping_t)
|
|
Chris PeBenito |
4fc915 |
}
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
ifdef(`TODO',`
|
|
Chris PeBenito |
fd9dee |
can_ypbind(ping_t)
|
|
Chris PeBenito |
fd9dee |
|
|
Chris PeBenito |
fd9dee |
domain_auto_trans(sysadm_t, ping_exec_t, ping_t)
|
|
Chris PeBenito |
4fc915 |
role sysadm_r types ping_t;
|
|
Chris PeBenito |
fd9dee |
allow ping_t admin_tty_type:chr_file rw_file_perms;
|
|
Chris PeBenito |
fd9dee |
ifdef(`gnome-pty-helper.te', `allow ping_t sysadm_gph_t:fd use;')
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
fd9dee |
in_user_role(ping_t)
|
|
Chris PeBenito |
4fc915 |
if (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 |
4fc915 |
}
|
|
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 |
c9428d |
files_read_generic_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 |
4fc915 |
if (user_ping) {
|
|
Chris PeBenito |
0fd9dc |
term_use_all_user_ttys(traceroute_t)
|
|
Chris PeBenito |
0fd9dc |
term_use_all_user_ptys(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
}
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
ifdef(`TODO',`
|
|
Chris PeBenito |
4fc915 |
role sysadm_r types traceroute_t;
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
can_ypbind(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
# Transition into this domain when you run this program.
|
|
Chris PeBenito |
4fc915 |
domain_auto_trans(sysadm_t, traceroute_exec_t, traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
# Access the terminal.
|
|
Chris PeBenito |
4fc915 |
allow traceroute_t admin_tty_type:chr_file rw_file_perms;
|
|
Chris PeBenito |
4fc915 |
ifdef(`gnome-pty-helper.te', `allow traceroute_t sysadm_gph_t:fd use;')
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
in_user_role(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
if (user_ping) {
|
|
Chris PeBenito |
4fc915 |
domain_auto_trans(unpriv_userdomain, traceroute_exec_t, traceroute_t)
|
|
Chris PeBenito |
4fc915 |
}
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
#rules needed for nmap
|
|
Chris PeBenito |
4fc915 |
dontaudit traceroute_t userdomain:dir search;
|
|
Chris PeBenito |
4fc915 |
') dnl end TODO
|