Tri Vo | bc8dc3a | 2019-05-26 13:17:08 -0700 | [diff] [blame^] | 1 | ## Network types |
| 2 | type node, node_type; |
| 3 | type netif, netif_type; |
| 4 | type port, port_type; |
| 5 | |
| 6 | ### |
| 7 | ### Domain with network access |
| 8 | ### |
| 9 | |
| 10 | # Use network sockets. |
| 11 | allow netdomain self:tcp_socket create_stream_socket_perms; |
| 12 | allow netdomain self:{ icmp_socket udp_socket rawip_socket } create_socket_perms; |
| 13 | |
| 14 | # Connect to ports. |
| 15 | allow netdomain port_type:tcp_socket name_connect; |
| 16 | # Bind to ports. |
| 17 | allow {netdomain -ephemeral_app} node_type:{ icmp_socket rawip_socket tcp_socket udp_socket } node_bind; |
| 18 | allow {netdomain -ephemeral_app} port_type:udp_socket name_bind; |
| 19 | allow {netdomain -ephemeral_app} port_type:tcp_socket name_bind; |
| 20 | # See changes to the routing table. |
| 21 | allow netdomain self:netlink_route_socket { create read getattr write setattr lock append bind connect getopt setopt shutdown nlmsg_read }; |
| 22 | |
| 23 | # Talks to netd via dnsproxyd socket. |
| 24 | unix_socket_connect(netdomain, dnsproxyd, netd) |
| 25 | |
| 26 | # Talks to netd via fwmarkd socket. |
| 27 | unix_socket_connect(netdomain, fwmarkd, netd) |
| 28 | |
| 29 | # Connect to mdnsd via mdnsd socket. |
| 30 | unix_socket_connect(netdomain, mdnsd, mdnsd) |