summaryrefslogtreecommitdiffstats
path: root/common/ipacm.te
blob: 000bfa5eb47abe46363300cb5611bc2ce068bc85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# General definitions
type ipacm, domain, domain_deprecated;
type ipacm-diag, domain, domain_deprecated;
type ipacm_exec, exec_type, file_type;
type ipacm-diag_exec, exec_type, file_type;
init_daemon_domain(ipacm)
init_daemon_domain(ipacm-diag)

# associate netdomain to use for accessing internet sockets
net_domain(ipacm)

userdebug_or_eng(`
  # Allow using the logging file between ipacm and ipacm-diag
  unix_socket_send(ipacm, ipacm, ipacm-diag)
  diag_use(ipacm-diag)
')

# Allow capabilities to create netfilter_socket
allow ipacm self:netlink_netfilter_socket create_socket_perms;

# Allow capabilities to perform network operations and interactions with network interfaces
allow ipacm ipacm:capability net_admin;

# Allow operations with /dev/ipa, /dev/wwan_ioctl and /dev/ipaNatTable
allow ipacm ipa_dev:chr_file rw_file_perms;

# Allow receiving NETLINK messages
allow ipacm ipacm:{
    netlink_route_socket
    netlink_socket
    # Allow querying the network stack via IOCTLs
    udp_socket
    netlink_generic_socket
} create_socket_perms;

# Allow creating and modifying the PID file
allow ipacm ipacm_data_file:dir w_dir_perms;
allow ipacm ipacm_data_file:file create_file_perms;