xref: /aosp_15_r20/system/sepolicy/prebuilts/api/31.0/public/dnsmasq.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# DNS, DHCP services
2*e4a36f41SAndroid Build Coastguard Workertype dnsmasq, domain;
3*e4a36f41SAndroid Build Coastguard Workertype dnsmasq_exec, system_file_type, exec_type, file_type;
4*e4a36f41SAndroid Build Coastguard Worker
5*e4a36f41SAndroid Build Coastguard Workernet_domain(dnsmasq)
6*e4a36f41SAndroid Build Coastguard Workerallowxperm dnsmasq self:udp_socket ioctl priv_sock_ioctls;
7*e4a36f41SAndroid Build Coastguard Worker
8*e4a36f41SAndroid Build Coastguard Worker# TODO:  Run with dhcp group to avoid need for dac_override.
9*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq self:global_capability_class_set { dac_override dac_read_search };
10*e4a36f41SAndroid Build Coastguard Worker
11*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq self:global_capability_class_set { net_admin net_raw net_bind_service setgid setuid };
12*e4a36f41SAndroid Build Coastguard Worker
13*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq dhcp_data_file:dir w_dir_perms;
14*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq dhcp_data_file:file create_file_perms;
15*e4a36f41SAndroid Build Coastguard Worker
16*e4a36f41SAndroid Build Coastguard Worker# Inherit and use open files from netd.
17*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:fd use;
18*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:fifo_file { getattr read write };
19*e4a36f41SAndroid Build Coastguard Worker# TODO: Investigate whether these inherited sockets should be closed on exec.
20*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:netlink_kobject_uevent_socket { read write };
21*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:netlink_nflog_socket { read write };
22*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:netlink_route_socket { read write };
23*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:unix_stream_socket { getattr read write };
24*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:unix_dgram_socket { read write };
25*e4a36f41SAndroid Build Coastguard Workerallow dnsmasq netd:udp_socket { read write };
26*e4a36f41SAndroid Build Coastguard Worker
27*e4a36f41SAndroid Build Coastguard Worker# sometimes a network device vanishes and we try to load module netdev-{devicename}
28*e4a36f41SAndroid Build Coastguard Workerdontaudit dnsmasq kernel:system module_request;
29