blob: 9675a99c74fcd70aac52f490f95ff976b222f18d [file] [log] [blame]
Bjoern Johansson127395f2017-02-09 22:28:47 -08001# Network namespace transitions
Bjoern Johansson760871c2017-08-31 12:57:18 -07002type execns, domain;
3type execns_exec, exec_type, vendor_file_type, file_type;
Bjoern Johansson127395f2017-02-09 22:28:47 -08004
5init_daemon_domain(execns)
6
7allow execns varrun_file:dir search;
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -07008allow execns varrun_file:file r_file_perms;
Bjoern Johansson127395f2017-02-09 22:28:47 -08009allow execns self:capability sys_admin;
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -070010allow execns nsfs:file { open read };
Bjoern Johansson127395f2017-02-09 22:28:47 -080011
12#Allow execns itself to be run by init in its own domain
13domain_auto_trans(init, execns_exec, execns);
14
Bjoern Johansson3c4b3422017-07-06 15:52:57 -070015# Allow dhcpclient to be run by execns in its own domain
16domain_auto_trans(execns, dhcpclient_exec, dhcpclient);
17
18# Allow dhcpserver to be run by execns in its own domain
19domain_auto_trans(execns, dhcpserver_exec, dhcpserver);
20
Bjoern Johanssonca5bfb12018-03-19 11:14:30 -070021# Rules to allow execution of hostapd and allow it to run
22allow execns hal_wifi_hostapd_default_exec:file { execute_no_trans };
23allow execns self:capability { net_admin net_raw };
24allow execns self:netlink_generic_socket { bind create getattr read setopt write };
25allow execns self:netlink_route_socket { bind create read write nlmsg_write };
26allow execns execns:udp_socket { create ioctl };
27allow execns self:packet_socket { create setopt };
28allow execns sysfs_net:dir { search };
29allowxperm execns self:udp_socket ioctl priv_sock_ioctls;
30
31# Allow execns to read createns proc file to get the namespace file
32allow execns createns:file read;
33allow execns createns:dir search;
34allow execns createns:lnk_file read;