platform_system_sepolicy/public/mediametrics.te
Nick Kralevich 38c12828da Add documentation on neverallow rules
Better document the reasons behind the neverallow for tcp/udp sockets.

Test: policy compiles.
Change-Id: Iee386af3be6fc7495addc9300b5628d0fe61c8e9
2017-02-17 22:37:23 +00:00

35 lines
1.2 KiB
Text

# mediametrics - daemon for collecting media.metrics data
type mediametrics, domain;
type mediametrics_exec, exec_type, file_type;
binder_use(mediametrics)
binder_call(mediametrics, binderservicedomain)
binder_service(mediametrics)
add_service(mediametrics, mediametrics_service)
allow mediametrics system_server:fd use;
r_dir_file(mediametrics, cgroup)
allow mediametrics proc_meminfo:file r_file_perms;
###
### neverallow rules
###
# mediametrics should never execute any executable without a
# domain transition
neverallow mediametrics { file_type fs_type }:file execute_no_trans;
# The goal of the mediaserver split is to place media processing code into
# restrictive sandboxes with limited responsibilities and thus limited
# permissions. Example: Audioserver is only responsible for controlling audio
# hardware and processing audio content. Cameraserver does the same for camera
# hardware/content. Etc.
#
# Media processing code is inherently risky and thus should have limited
# permissions and be isolated from the rest of the system and network.
# Lengthier explanation here:
# https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
neverallow mediametrics domain:{ tcp_socket udp_socket rawip_socket } *;