platform_system_sepolicy/private/ot_daemon.te
Tony Zhou 4ed6a0d834 Add sepolicy to allow OT daemon to write to statsd
Bug: 230565248

Test: push data to statsd_testdrive and it works now

Change-Id: I48c3affdd1fbd62df5b8eaff9908c5f3bbeda4d8
2023-10-26 05:47:01 +00:00

34 lines
1.1 KiB
Text

#
# ot_daemon is the native Thread network stack on the host (Android) side.
# Refer to https://www.threadgroup.org for Thread network knowledge.
#
# ot_daemon
type ot_daemon, domain, coredomain;
type ot_daemon_exec, exec_type, file_type, system_file_type;
# Allow init ot_daemon
init_daemon_domain(ot_daemon)
# Allow the ot_daemon to use the net domain.
net_domain(ot_daemon)
# Allow the ot_daemon to access the folder "/data/misc/threadnetwork".
allow ot_daemon threadnetwork_data_file:dir rw_dir_perms;
allow ot_daemon threadnetwork_data_file:file create_file_perms;
allow ot_daemon threadnetwork_data_file:sock_file {create unlink};
# Allow OT daemon to read/write the Thread tunnel interface
allow ot_daemon tun_device:chr_file {read write};
# Allow OT daemon to read/write on the socket created by System Server
allow ot_daemon system_server:rawip_socket rw_socket_perms_no_ioctl;
hal_client_domain(ot_daemon, hal_threadnetwork)
# Only ot_daemon can publish the binder service
binder_use(ot_daemon)
add_service(ot_daemon, ot_daemon_service)
binder_call(ot_daemon, system_server)
# Allow OT daemon to write to statsd
unix_socket_send(ot_daemon, statsdw, statsd)