|
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 |
ff3138 |
init_make_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 |
38e24a |
files_make_temporary_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 |
ff3138 |
init_make_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 |
ff3138 |
init_make_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 |
4fc915 |
allow netutils_t self:packet_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
|
|
Chris PeBenito |
4fc915 |
allow netutils_t self:udp_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
|
|
Chris PeBenito |
4fc915 |
allow netutils_t self:tcp_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
allow netutils_t netutils_tmp_t:dir { create read getattr lock setattr ioctl link unlink rename search add_name remove_name reparent write rmdir };
|
|
Chris PeBenito |
4fc915 |
allow netutils_t netutils_tmp_t:file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
Chris PeBenito |
4fc915 |
files_create_private_tmp_data(netutils_t, netutils_tmp_t, { file dir })
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_interfaces(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_raw_on_all_interfaces(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_interfaces(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_nodes(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_raw_on_all_nodes(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_nodes(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_ports(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_ports(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_bind_tcp_on_all_nodes(netutils_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_bind_udp_on_all_nodes(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
filesystem_get_persistent_filesystem_attributes(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
init_use_file_descriptors(netutils_t)
|
|
Chris PeBenito |
4fc915 |
init_script_use_pseudoterminal(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
domain_use_widely_inheritable_file_descriptors(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
files_read_general_system_config(netutils_t)
|
|
Chris PeBenito |
4fc915 |
# for nscd
|
|
Chris PeBenito |
4fc915 |
files_ignore_search_system_state_data_directory(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
libraries_use_dynamic_loader(netutils_t)
|
|
Chris PeBenito |
dd14d0 |
libraries_use_shared_libraries(netutils_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
logging_send_system_log_message(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 |
4fc915 |
allow ping_t self:tcp_socket { create connect ioctl read getattr write setattr append bind getopt setopt shutdown };
|
|
Chris PeBenito |
4fc915 |
allow ping_t self:udp_socket { create connect ioctl read getattr write setattr append bind getopt setopt shutdown };
|
|
Chris PeBenito |
4fc915 |
allow ping_t self:rawip_socket { create ioctl read write bind getopt setopt };
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_interfaces(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_interfaces(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_raw_on_all_interfaces(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_raw_on_all_nodes(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_nodes(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_nodes(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_ports(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_ports(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_bind_udp_on_all_nodes(ping_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_bind_tcp_on_all_nodes(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
filesystem_ignore_get_persistent_filesystem_attributes(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
domain_use_widely_inheritable_file_descriptors(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
files_read_general_system_config(ping_t)
|
|
Chris PeBenito |
fd9dee |
files_ignore_search_system_state_data_directory(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
libraries_use_dynamic_loader(ping_t)
|
|
Chris PeBenito |
dd14d0 |
libraries_use_shared_libraries(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
sysnetwork_read_network_config(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
logging_send_system_log_message(ping_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
if (user_ping) {
|
|
Chris PeBenito |
b16c6b |
terminal_use_all_private_physical_terminals(ping_t)
|
|
Chris PeBenito |
b16c6b |
terminal_use_all_private_pseudoterminals(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 |
4fc915 |
allow traceroute_t self:rawip_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
|
|
Chris PeBenito |
4fc915 |
allow traceroute_t self:packet_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
|
|
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 |
4fc915 |
corenetwork_network_tcp_on_all_interfaces(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_interfaces(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_raw_on_all_interfaces(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_raw_on_all_nodes(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_nodes(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_nodes(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_tcp_on_all_ports(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_network_udp_on_all_ports(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_bind_udp_on_all_nodes(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
corenetwork_bind_tcp_on_all_nodes(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
filesystem_ignore_get_persistent_filesystem_attributes(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
domain_use_widely_inheritable_file_descriptors(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
files_read_general_system_config(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
files_ignore_search_system_state_data_directory(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
libraries_use_dynamic_loader(traceroute_t)
|
|
Chris PeBenito |
dd14d0 |
libraries_use_shared_libraries(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
logging_send_system_log_message(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
miscfiles_read_localization(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
#rules needed for nmap
|
|
Chris PeBenito |
4fc915 |
devices_get_random_data(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
devices_get_pseudorandom_data(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
files_read_general_application_resources(traceroute_t)
|
|
Chris PeBenito |
4fc915 |
|
|
Chris PeBenito |
4fc915 |
if (user_ping) {
|
|
Chris PeBenito |
b16c6b |
terminal_use_all_private_physical_terminals(traceroute_t)
|
|
Chris PeBenito |
b16c6b |
terminal_use_all_private_pseudoterminals(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
|