Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame^] | 1 | type stats, domain; |
| 2 | typeattribute stats coredomain; |
| 3 | type stats_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | # switch to stats domain for stats command |
| 6 | domain_auto_trans(shell, stats_exec, stats) |
| 7 | |
| 8 | # allow stats access to stdout from its parent shell. |
| 9 | allow stats shell:fd use; |
| 10 | |
| 11 | # allow stats to communicate use, read and write over the adb |
| 12 | # connection. |
| 13 | allow stats adbd:fd use; |
| 14 | allow stats adbd:unix_stream_socket { read write }; |
| 15 | |
| 16 | # allow adbd to reap stats |
| 17 | allow stats adbd:process { sigchld }; |
| 18 | |
| 19 | # Allow the stats command to talk to the statsd over the binder, and get |
| 20 | # back the stats report data from a ParcelFileDescriptor. |
| 21 | binder_use(stats) |
| 22 | allow stats stats_service:service_manager find; |
| 23 | binder_call(stats, statsd) |
| 24 | allow stats statsd:fifo_file write; |
| 25 | |
| 26 | # Only statsd can publish the binder service. |
| 27 | add_service(statsd, stats_service) |
| 28 | |
| 29 | # Allow pipes from (and only from) stats. |
| 30 | allow statsd stats:fd use; |
| 31 | allow statsd stats:fifo_file write; |
| 32 | |
| 33 | # Allow statsd to call back to stats with status updates. |
| 34 | binder_call(statsd, stats) |
| 35 | |
| 36 | ### |
| 37 | ### neverallow rules |
| 38 | ### |
| 39 | |
| 40 | neverallow { |
| 41 | domain |
| 42 | -dumpstate |
| 43 | -gmscore_app |
| 44 | -gpuservice |
| 45 | -incidentd |
| 46 | -keystore |
| 47 | -mediametrics |
| 48 | -platform_app |
| 49 | -priv_app |
| 50 | -shell |
| 51 | -stats |
| 52 | -statsd |
| 53 | -surfaceflinger |
| 54 | -system_app |
| 55 | -system_server |
| 56 | -traceur_app |
| 57 | } stats_service:service_manager find; |