mediametrics.te 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # mediametrics - daemon for collecting media.metrics data
  2. type mediametrics, domain;
  3. type mediametrics_exec, system_file_type, exec_type, file_type;
  4. binder_use(mediametrics)
  5. binder_call(mediametrics, binderservicedomain)
  6. binder_service(mediametrics)
  7. add_service(mediametrics, mediametrics_service)
  8. allow mediametrics system_server:fd use;
  9. r_dir_file(mediametrics, cgroup)
  10. allow mediametrics proc_meminfo:file r_file_perms;
  11. # allows interactions with dumpsys to GMScore
  12. allow mediametrics { app_data_file privapp_data_file }:file write;
  13. # allow access to package manager for uid->apk mapping
  14. allow mediametrics package_native_service:service_manager find;
  15. # Allow metrics service to send information to statsd socket.
  16. unix_socket_send(mediametrics, statsdw, statsd)
  17. ###
  18. ### neverallow rules
  19. ###
  20. # mediametrics should never execute any executable without a
  21. # domain transition
  22. neverallow mediametrics { file_type fs_type }:file execute_no_trans;
  23. # The goal of the mediaserver split is to place media processing code into
  24. # restrictive sandboxes with limited responsibilities and thus limited
  25. # permissions. Example: Audioserver is only responsible for controlling audio
  26. # hardware and processing audio content. Cameraserver does the same for camera
  27. # hardware/content. Etc.
  28. #
  29. # Media processing code is inherently risky and thus should have limited
  30. # permissions and be isolated from the rest of the system and network.
  31. # Lengthier explanation here:
  32. # https://android-developers.googleblog.com/2016/05/hardening-media-stack.html
  33. neverallow mediametrics domain:{ tcp_socket udp_socket rawip_socket } *;