2021-01-25 14:48:59 +00:00
|
|
|
policy_module(sysnetwork, 1.26.5)
|
2005-04-26 17:00:25 +00:00
|
|
|
|
2005-05-04 13:14:48 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2021-01-27 17:20:35 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Determine whether DHCP client
|
|
|
|
## can manage samba
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
gen_tunable(dhcpc_manage_samba, false)
|
|
|
|
|
2011-08-12 12:12:59 +00:00
|
|
|
attribute_role dhcpc_roles;
|
|
|
|
roleattribute system_r dhcpc_roles;
|
|
|
|
|
2005-05-31 23:02:11 +00:00
|
|
|
# this is shared between dhcpc and dhcpd:
|
2005-10-24 18:40:24 +00:00
|
|
|
type dhcp_etc_t;
|
|
|
|
files_config_file(dhcp_etc_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
|
|
|
# this is shared between dhcpc and dhcpd:
|
|
|
|
type dhcp_state_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(dhcp_state_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2005-05-04 13:14:48 +00:00
|
|
|
type dhcpc_t;
|
|
|
|
type dhcpc_exec_t;
|
2009-06-26 14:40:13 +00:00
|
|
|
init_daemon_domain(dhcpc_t, dhcpc_exec_t)
|
2011-08-12 12:12:59 +00:00
|
|
|
role dhcpc_roles types dhcpc_t;
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2019-09-11 00:05:46 +00:00
|
|
|
type dhcpc_runtime_t alias dhcpc_var_run_t;
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_file(dhcpc_runtime_t)
|
2019-09-11 00:05:46 +00:00
|
|
|
|
2005-05-04 13:14:48 +00:00
|
|
|
type dhcpc_state_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(dhcpc_state_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
type dhcpc_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(dhcpc_tmp_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
type ifconfig_t;
|
|
|
|
type ifconfig_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_system_domain(ifconfig_t, ifconfig_exec_t)
|
2005-05-05 18:30:00 +00:00
|
|
|
role system_r types ifconfig_t;
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2020-04-19 09:43:45 +00:00
|
|
|
type ifconfig_runtime_t;
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_file(ifconfig_runtime_t)
|
2020-04-19 09:43:45 +00:00
|
|
|
|
2019-09-11 00:52:54 +00:00
|
|
|
type net_conf_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(net_conf_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2013-09-26 21:46:32 +00:00
|
|
|
ifdef(`distro_debian',`
|
2020-06-27 21:11:48 +00:00
|
|
|
init_daemon_runtime_file(net_conf_t, dir, "network")
|
2013-09-26 21:46:32 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 13:14:48 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# DHCP client local policy
|
|
|
|
#
|
2017-02-15 23:47:33 +00:00
|
|
|
allow dhcpc_t self:capability { dac_override fsetid net_admin net_bind_service net_raw setpcap sys_nice sys_resource sys_tty_config };
|
|
|
|
dontaudit dhcpc_t self:capability { sys_ptrace sys_tty_config };
|
2005-05-04 13:14:48 +00:00
|
|
|
# for access("/etc/bashrc", X_OK) on Red Hat
|
|
|
|
dontaudit dhcpc_t self:capability { dac_read_search sys_module };
|
2010-03-18 19:40:04 +00:00
|
|
|
allow dhcpc_t self:process { getsched getcap setcap setfscreate ptrace signal_perms };
|
|
|
|
|
|
|
|
allow dhcpc_t self:fifo_file rw_fifo_file_perms;
|
2005-09-22 21:59:50 +00:00
|
|
|
allow dhcpc_t self:tcp_socket create_stream_socket_perms;
|
2005-06-08 21:07:03 +00:00
|
|
|
allow dhcpc_t self:udp_socket create_socket_perms;
|
|
|
|
allow dhcpc_t self:packet_socket create_socket_perms;
|
2017-08-17 06:23:53 +00:00
|
|
|
allow dhcpc_t self:netlink_generic_socket create_socket_perms;
|
2014-10-18 13:30:22 +00:00
|
|
|
allow dhcpc_t self:netlink_route_socket create_netlink_socket_perms;
|
2017-08-17 06:23:53 +00:00
|
|
|
allow dhcpc_t self:rawip_socket create_socket_perms;
|
2020-09-15 02:57:58 +00:00
|
|
|
allow dhcpc_t self:unix_dgram_socket { create_socket_perms sendto };
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow dhcpc_t dhcp_etc_t:dir list_dir_perms;
|
2009-06-26 14:40:13 +00:00
|
|
|
read_lnk_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
|
|
|
|
exec_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2010-03-18 19:40:04 +00:00
|
|
|
allow dhcpc_t dhcp_state_t:file read_file_perms;
|
2009-06-26 14:40:13 +00:00
|
|
|
manage_files_pattern(dhcpc_t, dhcpc_state_t, dhcpc_state_t)
|
|
|
|
filetrans_pattern(dhcpc_t, dhcp_state_t, dhcpc_state_t, file)
|
2019-01-04 07:35:03 +00:00
|
|
|
allow dhcpc_t dhcpc_state_t:file map;
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2005-05-04 13:14:48 +00:00
|
|
|
# create pid file
|
2019-09-08 20:55:02 +00:00
|
|
|
manage_files_pattern(dhcpc_t, dhcpc_runtime_t, dhcpc_runtime_t)
|
2020-09-15 02:57:58 +00:00
|
|
|
manage_sock_files_pattern(dhcpc_t, dhcpc_runtime_t, dhcpc_runtime_t)
|
2019-09-08 20:55:02 +00:00
|
|
|
create_dirs_pattern(dhcpc_t, dhcpc_runtime_t, dhcpc_runtime_t)
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_filetrans(dhcpc_t, dhcpc_runtime_t, { file dir })
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
# Allow read/write to /etc/resolv.conf and /etc/ntp.conf. Note that any files
|
|
|
|
# in /etc created by dhcpcd will be labelled net_conf_t.
|
2010-03-18 19:40:04 +00:00
|
|
|
sysnet_manage_config(dhcpc_t)
|
2009-06-26 14:40:13 +00:00
|
|
|
files_etc_filetrans(dhcpc_t, net_conf_t, file)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
# create temp files
|
2009-06-26 14:40:13 +00:00
|
|
|
manage_dirs_pattern(dhcpc_t, dhcpc_tmp_t, dhcpc_tmp_t)
|
|
|
|
manage_files_pattern(dhcpc_t, dhcpc_tmp_t, dhcpc_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(dhcpc_t, dhcpc_tmp_t, { file dir })
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2005-06-08 21:07:03 +00:00
|
|
|
can_exec(dhcpc_t, dhcpc_exec_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(dhcpc_t)
|
|
|
|
kernel_read_network_state(dhcpc_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
kernel_search_network_sysctl(dhcpc_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(dhcpc_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
kernel_request_load_module(dhcpc_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
kernel_use_fds(dhcpc_t)
|
2011-08-23 11:18:31 +00:00
|
|
|
kernel_rw_net_sysctls(dhcpc_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
|
2009-08-05 14:23:50 +00:00
|
|
|
corecmd_exec_bin(dhcpc_t)
|
|
|
|
corecmd_exec_shell(dhcpc_t)
|
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_netlabel(dhcpc_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(dhcpc_t)
|
|
|
|
corenet_raw_sendrecv_all_if(dhcpc_t)
|
|
|
|
corenet_udp_sendrecv_all_if(dhcpc_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(dhcpc_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(dhcpc_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(dhcpc_t)
|
|
|
|
corenet_tcp_bind_all_nodes(dhcpc_t)
|
|
|
|
corenet_udp_bind_all_nodes(dhcpc_t)
|
2012-10-15 20:55:49 +00:00
|
|
|
corenet_tcp_bind_dhcpc_port(dhcpc_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_udp_bind_dhcpc_port(dhcpc_t)
|
2013-09-27 21:15:02 +00:00
|
|
|
corenet_udp_bind_all_unreserved_ports(dhcpc_t)
|
2005-09-12 21:40:56 +00:00
|
|
|
corenet_tcp_connect_all_ports(dhcpc_t)
|
2006-05-26 18:04:46 +00:00
|
|
|
corenet_sendrecv_dhcpd_client_packets(dhcpc_t)
|
2013-09-27 09:35:41 +00:00
|
|
|
corenet_sendrecv_all_server_packets(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
dev_read_sysfs(dhcpc_t)
|
|
|
|
# for SSP:
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(dhcpc_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
domain_dontaudit_read_all_domains_state(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(dhcpc_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(dhcpc_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
files_read_usr_files(dhcpc_t)
|
2005-06-30 18:54:08 +00:00
|
|
|
files_search_home(dhcpc_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
files_search_var_lib(dhcpc_t)
|
|
|
|
files_dontaudit_search_locks(dhcpc_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
files_getattr_generic_locks(dhcpc_t)
|
2016-08-14 18:51:42 +00:00
|
|
|
files_manage_var_files(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2009-08-05 14:23:50 +00:00
|
|
|
fs_getattr_all_fs(dhcpc_t)
|
|
|
|
fs_search_auto_mountpoints(dhcpc_t)
|
2016-08-14 18:51:42 +00:00
|
|
|
fs_search_cgroup_dirs(dhcpc_t)
|
2009-08-05 14:23:50 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_dontaudit_use_all_ttys(dhcpc_t)
|
|
|
|
term_dontaudit_use_all_ptys(dhcpc_t)
|
2009-08-05 14:23:50 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(dhcpc_t)
|
|
|
|
term_dontaudit_use_generic_ptys(dhcpc_t)
|
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(dhcpc_t)
|
2019-01-05 18:56:15 +00:00
|
|
|
# dhclient reads /etc/ssl
|
|
|
|
miscfiles_read_generic_certs(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2011-08-12 12:12:59 +00:00
|
|
|
sysnet_run_ifconfig(dhcpc_t, dhcpc_roles)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_use_user_terminals(dhcpc_t)
|
|
|
|
userdom_dontaudit_search_user_home_dirs(dhcpc_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
|
2005-05-31 23:02:11 +00:00
|
|
|
ifdef(`distro_redhat', `
|
2005-06-29 14:26:41 +00:00
|
|
|
files_exec_etc_files(dhcpc_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
')
|
|
|
|
|
2008-02-05 18:24:43 +00:00
|
|
|
ifdef(`distro_ubuntu',`
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(dhcpc_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2015-10-20 18:48:38 +00:00
|
|
|
ifdef(`init_systemd',`
|
|
|
|
init_rw_stream_sockets(dhcpc_t)
|
|
|
|
init_read_state(dhcpc_t)
|
|
|
|
init_stream_connect(dhcpc_t)
|
|
|
|
init_get_all_units_status(dhcpc_t)
|
|
|
|
init_search_units(dhcpc_t)
|
|
|
|
')
|
|
|
|
|
2016-12-04 16:34:11 +00:00
|
|
|
optional_policy(`
|
|
|
|
avahi_domtrans(dhcpc_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2011-08-12 12:12:59 +00:00
|
|
|
consoletype_run(dhcpc_t, dhcpc_roles)
|
2005-05-04 13:14:48 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2012-10-05 17:14:30 +00:00
|
|
|
dbus_system_domain(dhcpc_t, dhcpc_exec_t)
|
2005-10-24 12:38:45 +00:00
|
|
|
|
2012-10-05 17:14:30 +00:00
|
|
|
init_dbus_chat_script(dhcpc_t)
|
2005-10-24 12:38:45 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-11-29 21:27:15 +00:00
|
|
|
networkmanager_dbus_chat(dhcpc_t)
|
|
|
|
')
|
2005-10-24 12:38:45 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2011-08-12 12:12:59 +00:00
|
|
|
hostname_run(dhcpc_t, dhcpc_roles)
|
2005-05-04 13:14:48 +00:00
|
|
|
')
|
|
|
|
|
2017-02-18 14:39:01 +00:00
|
|
|
optional_policy(`
|
2017-02-18 21:35:45 +00:00
|
|
|
modutils_run(dhcpc_t, dhcpc_roles)
|
2017-02-18 14:39:01 +00:00
|
|
|
')
|
|
|
|
|
2005-06-30 18:54:08 +00:00
|
|
|
# for the dhcp client to run ping to check IP addresses
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2011-08-12 12:12:59 +00:00
|
|
|
netutils_run_ping(dhcpc_t, dhcpc_roles)
|
|
|
|
netutils_run(dhcpc_t, dhcpc_roles)
|
2005-06-30 18:54:08 +00:00
|
|
|
')
|
|
|
|
|
2013-11-09 09:44:56 +00:00
|
|
|
optional_policy(`
|
|
|
|
networkmanager_domtrans(dhcpc_t)
|
2020-06-27 21:11:48 +00:00
|
|
|
networkmanager_read_runtime_files(dhcpc_t)
|
2013-11-09 09:44:56 +00:00
|
|
|
networkmanager_manage_lib_files(dhcpc_t)
|
|
|
|
networkmanager_stream_connect(dhcpc_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2020-06-27 21:11:48 +00:00
|
|
|
nis_read_ypbind_runtime_files(dhcpc_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-03-18 19:40:04 +00:00
|
|
|
nscd_initrc_domtrans(dhcpc_t)
|
2005-06-13 20:27:32 +00:00
|
|
|
nscd_domtrans(dhcpc_t)
|
2020-06-27 21:11:48 +00:00
|
|
|
nscd_read_runtime_files(dhcpc_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2010-03-18 19:40:04 +00:00
|
|
|
ntp_initrc_domtrans(dhcpc_t)
|
2013-11-09 09:45:03 +00:00
|
|
|
ntp_read_drift_files(dhcpc_t)
|
2016-08-14 18:51:42 +00:00
|
|
|
ntp_read_conf_files(dhcpc_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
')
|
|
|
|
|
2017-02-25 16:20:19 +00:00
|
|
|
optional_policy(`
|
2021-01-28 16:30:40 +00:00
|
|
|
tunable_policy(`dhcpc_manage_samba',`
|
|
|
|
samba_manage_config(dhcpc_t)
|
|
|
|
samba_manage_var_files(dhcpc_t)
|
|
|
|
init_exec_script_files(dhcpc_t)
|
|
|
|
init_get_system_status(dhcpc_t)
|
|
|
|
samba_stop(dhcpc_t)
|
|
|
|
samba_start(dhcpc_t)
|
|
|
|
samba_reload(dhcpc_t)
|
|
|
|
samba_status(dhcpc_t)
|
|
|
|
')
|
2017-02-25 16:20:19 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-29 14:26:41 +00:00
|
|
|
seutil_sigchld_newrole(dhcpc_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
seutil_dontaudit_search_config(dhcpc_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_use_all_users_fds(dhcpc_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2010-03-18 19:40:04 +00:00
|
|
|
optional_policy(`
|
|
|
|
vmware_append_log(dhcpc_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-05-19 14:02:24 +00:00
|
|
|
kernel_read_xen_state(dhcpc_t)
|
|
|
|
kernel_write_xen_state(dhcpc_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
xen_append_log(dhcpc_t)
|
2006-04-26 15:22:33 +00:00
|
|
|
xen_dontaudit_rw_unix_stream_sockets(dhcpc_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 13:14:48 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Ifconfig local policy
|
|
|
|
#
|
|
|
|
|
2017-02-15 23:47:33 +00:00
|
|
|
allow ifconfig_t self:capability { net_admin net_raw sys_admin sys_tty_config };
|
2016-08-14 18:52:07 +00:00
|
|
|
dontaudit ifconfig_t self:capability sys_module;
|
2017-08-13 20:21:44 +00:00
|
|
|
allow ifconfig_t self:process { transition signal_perms getsched setsched getsession getpgid setpgid getcap setcap share getattr noatsecure siginh rlimitinh dyntransition setkeycreate setsockcreate getrlimit };
|
2005-05-04 13:14:48 +00:00
|
|
|
allow ifconfig_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow ifconfig_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow ifconfig_t self:sock_file read_sock_file_perms;
|
2005-10-26 21:03:19 +00:00
|
|
|
allow ifconfig_t self:socket create_socket_perms;
|
2005-06-08 21:07:03 +00:00
|
|
|
allow ifconfig_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow ifconfig_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-04 13:14:48 +00:00
|
|
|
allow ifconfig_t self:unix_dgram_socket sendto;
|
|
|
|
allow ifconfig_t self:unix_stream_socket connectto;
|
2005-06-08 21:07:03 +00:00
|
|
|
allow ifconfig_t self:shm create_shm_perms;
|
|
|
|
allow ifconfig_t self:sem create_sem_perms;
|
|
|
|
allow ifconfig_t self:msgq create_msgq_perms;
|
2005-05-04 13:14:48 +00:00
|
|
|
allow ifconfig_t self:msg { send receive };
|
|
|
|
# Create UDP sockets, necessary when called from dhcpc
|
2005-06-08 21:07:03 +00:00
|
|
|
allow ifconfig_t self:udp_socket create_socket_perms;
|
2005-05-04 13:14:48 +00:00
|
|
|
# for /sbin/ip
|
2005-09-12 21:40:56 +00:00
|
|
|
allow ifconfig_t self:packet_socket create_socket_perms;
|
2014-10-23 12:50:18 +00:00
|
|
|
# generic netlink socket for iw
|
|
|
|
# socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_GENERIC) = 3
|
Allow iw to create generic netlink sockets
iw uses generic netlink socket to configure WiFi properties. For
example, "strace iw dev wlan0 set power_save on" outputs:
socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_GENERIC) = 3
setsockopt(3, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0
setsockopt(3, SOL_SOCKET, SO_RCVBUF, [32768], 4) = 0
bind(3, {sa_family=AF_NETLINK, pid=7836, groups=00000000}, 12) = 0
Some AVC denials are reported in audit.log:
type=AVC msg=audit(1408829044.820:486): avc: denied { create } for
pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
permissive=1
type=AVC msg=audit(1408829044.820:487): avc: denied { setopt } for
pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
permissive=1
type=AVC msg=audit(1408829044.820:488): avc: denied { bind } for
pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
permissive=1
type=AVC msg=audit(1408829044.820:489): avc: denied { getattr }
for pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
permissive=1
type=AVC msg=audit(1408829044.820:490): avc: denied { write } for
pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
permissive=1
Allowing ifconfig_t to create generic netlink sockets fixes this.
(On a side note, the AVC denials were caused by TLP, a tool which
applies "laptop configuration" when switching between AC and battery
with the help of a udev script)
2014-10-18 13:30:21 +00:00
|
|
|
allow ifconfig_t self:netlink_socket create_socket_perms;
|
2015-05-21 17:38:09 +00:00
|
|
|
allow ifconfig_t self:netlink_generic_socket create_socket_perms;
|
2005-06-08 21:07:03 +00:00
|
|
|
allow ifconfig_t self:netlink_route_socket create_netlink_socket_perms;
|
2014-10-18 13:30:22 +00:00
|
|
|
allow ifconfig_t self:netlink_xfrm_socket create_netlink_socket_perms;
|
2005-05-04 13:14:48 +00:00
|
|
|
allow ifconfig_t self:tcp_socket { create ioctl };
|
|
|
|
|
2020-04-19 09:43:45 +00:00
|
|
|
# Allow "ip netns" to remount /var/run/netns and to mount network namespace files on /var/run/netns/$NSNAME
|
|
|
|
allow ifconfig_t ifconfig_runtime_t:dir mounton;
|
|
|
|
allow ifconfig_t ifconfig_runtime_t:file mounton;
|
|
|
|
manage_files_pattern(ifconfig_t, ifconfig_runtime_t, ifconfig_runtime_t)
|
|
|
|
create_dirs_pattern(ifconfig_t, ifconfig_runtime_t, ifconfig_runtime_t)
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_filetrans(ifconfig_t, ifconfig_runtime_t, dir)
|
2020-04-19 09:43:45 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
kernel_use_fds(ifconfig_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
kernel_read_system_state(ifconfig_t)
|
|
|
|
kernel_read_network_state(ifconfig_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
kernel_request_load_module(ifconfig_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
kernel_search_network_sysctl(ifconfig_t)
|
2006-05-03 19:58:01 +00:00
|
|
|
kernel_rw_net_sysctls(ifconfig_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2006-02-16 21:33:18 +00:00
|
|
|
corenet_rw_tun_tap_dev(ifconfig_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
|
2005-09-12 21:40:56 +00:00
|
|
|
dev_read_sysfs(ifconfig_t)
|
2006-05-17 14:50:31 +00:00
|
|
|
# for IPSEC setup:
|
|
|
|
dev_read_urand(ifconfig_t)
|
2005-09-12 21:40:56 +00:00
|
|
|
|
2009-08-05 14:23:50 +00:00
|
|
|
domain_use_interactive_fds(ifconfig_t)
|
|
|
|
|
|
|
|
files_read_etc_files(ifconfig_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
files_read_etc_runtime_files(ifconfig_t)
|
2009-08-05 14:23:50 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(ifconfig_t)
|
2020-04-19 09:43:45 +00:00
|
|
|
fs_read_nsfs_files(ifconfig_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(ifconfig_t)
|
2020-04-19 09:43:45 +00:00
|
|
|
fs_unmount_nsfs(ifconfig_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2010-03-18 19:40:04 +00:00
|
|
|
selinux_dontaudit_getattr_fs(ifconfig_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_console(ifconfig_t)
|
2010-02-11 19:20:10 +00:00
|
|
|
term_dontaudit_use_all_ttys(ifconfig_t)
|
|
|
|
term_dontaudit_use_all_ptys(ifconfig_t)
|
2010-03-18 19:40:04 +00:00
|
|
|
term_dontaudit_use_ptmx(ifconfig_t)
|
|
|
|
term_dontaudit_use_generic_ptys(ifconfig_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(ifconfig_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(ifconfig_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(ifconfig_t)
|
2005-05-18 16:03:54 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(ifconfig_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(ifconfig_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
seutil_use_runinit_fds(ifconfig_t)
|
2005-05-18 16:03:54 +00:00
|
|
|
|
2013-09-27 09:35:41 +00:00
|
|
|
sysnet_dontaudit_rw_dhcpc_udp_sockets(ifconfig_t)
|
|
|
|
|
2020-04-19 09:43:45 +00:00
|
|
|
# For "ip netns identify $$"
|
|
|
|
userdom_read_all_users_state(ifconfig_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_use_user_terminals(ifconfig_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_use_all_users_fds(ifconfig_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2013-11-09 09:44:49 +00:00
|
|
|
ifdef(`distro_debian',`
|
|
|
|
term_dontaudit_use_unallocated_ttys(ifconfig_t)
|
|
|
|
')
|
|
|
|
|
2008-02-05 18:24:43 +00:00
|
|
|
ifdef(`distro_ubuntu',`
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(ifconfig_t)
|
|
|
|
')
|
|
|
|
')
|
2008-10-17 15:52:39 +00:00
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
ifdef(`hide_broken_symptoms',`
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-07-15 15:17:57 +00:00
|
|
|
dev_dontaudit_rw_cardmgr(ifconfig_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
udev_dontaudit_rw_dgram_sockets(ifconfig_t)
|
2005-07-15 15:17:57 +00:00
|
|
|
')
|
2005-07-11 19:02:50 +00:00
|
|
|
')
|
|
|
|
|
2013-09-24 13:39:30 +00:00
|
|
|
optional_policy(`
|
2020-06-27 21:11:48 +00:00
|
|
|
devicekit_read_runtime_files(ifconfig_t)
|
2019-01-28 08:48:40 +00:00
|
|
|
devicekit_append_inherited_log_files(ifconfig_t)
|
2013-09-24 13:39:30 +00:00
|
|
|
')
|
|
|
|
|
2008-08-11 14:03:36 +00:00
|
|
|
optional_policy(`
|
2020-06-27 21:11:48 +00:00
|
|
|
ipsec_write_runtime_files(ifconfig_t)
|
2011-03-21 13:48:05 +00:00
|
|
|
ipsec_setcontext_default_spd(ifconfig_t)
|
2008-08-11 14:03:36 +00:00
|
|
|
')
|
|
|
|
|
2017-02-18 14:39:01 +00:00
|
|
|
optional_policy(`
|
2017-02-18 21:35:45 +00:00
|
|
|
modutils_domtrans(ifconfig_t)
|
2017-02-18 14:39:01 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(ifconfig_t)
|
2005-05-04 13:14:48 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
ppp_use_fds(ifconfig_t)
|
2005-11-07 20:09:28 +00:00
|
|
|
')
|
2006-03-23 19:19:38 +00:00
|
|
|
|
2010-03-18 19:40:04 +00:00
|
|
|
optional_policy(`
|
|
|
|
unconfined_dontaudit_rw_pipes(ifconfig_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
vmware_append_log(ifconfig_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-05-19 14:02:24 +00:00
|
|
|
kernel_read_xen_state(ifconfig_t)
|
|
|
|
kernel_write_xen_state(ifconfig_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
xen_append_log(ifconfig_t)
|
2006-04-26 15:22:33 +00:00
|
|
|
xen_dontaudit_rw_unix_stream_sockets(ifconfig_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
')
|