Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 1 | ### |
| 2 | ### Apps signed with the platform key. |
| 3 | ### |
| 4 | |
Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 5 | typeattribute platform_app coredomain; |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 6 | |
Nick Kralevich | b56e6ef | 2016-12-09 20:14:31 -0800 | [diff] [blame] | 7 | app_domain(platform_app) |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 8 | |
| 9 | # Access the network. |
| 10 | net_domain(platform_app) |
| 11 | # Access bluetooth. |
| 12 | bluetooth_domain(platform_app) |
| 13 | # Read from /data/local/tmp or /data/data/com.android.shell. |
| 14 | allow platform_app shell_data_file:dir search; |
| 15 | allow platform_app shell_data_file:file { open getattr read }; |
| 16 | allow platform_app icon_file:file { open getattr read }; |
Chad Brubaker | 4c40d73 | 2017-01-25 14:55:56 -0800 | [diff] [blame] | 17 | # Populate /data/app/vmdl*.tmp, /data/app-private/vmdl*.tmp files |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 18 | # created by system server. |
Chad Brubaker | 4c40d73 | 2017-01-25 14:55:56 -0800 | [diff] [blame] | 19 | allow platform_app { apk_tmp_file apk_private_tmp_file }:dir rw_dir_perms; |
| 20 | allow platform_app { apk_tmp_file apk_private_tmp_file }:file rw_file_perms; |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 21 | allow platform_app apk_private_data_file:dir search; |
| 22 | # ASEC |
| 23 | allow platform_app asec_apk_file:dir create_dir_perms; |
| 24 | allow platform_app asec_apk_file:file create_file_perms; |
| 25 | |
| 26 | # Access to /data/media. |
| 27 | allow platform_app media_rw_data_file:dir create_dir_perms; |
| 28 | allow platform_app media_rw_data_file:file create_file_perms; |
| 29 | |
| 30 | # Write to /cache. |
| 31 | allow platform_app cache_file:dir create_dir_perms; |
| 32 | allow platform_app cache_file:file create_file_perms; |
| 33 | |
| 34 | # Direct access to vold-mounted storage under /mnt/media_rw |
| 35 | # This is a performance optimization that allows platform apps to bypass the FUSE layer |
| 36 | allow platform_app mnt_media_rw_file:dir r_dir_perms; |
| 37 | allow platform_app vfat:dir create_dir_perms; |
| 38 | allow platform_app vfat:file create_file_perms; |
| 39 | |
Jeff Vander Stoep | a12aad4 | 2017-07-10 20:39:50 -0700 | [diff] [blame] | 40 | # com.android.systemui |
| 41 | allow platform_app rootfs:dir getattr; |
| 42 | |
Jeff Vander Stoep | c15d54e | 2017-07-25 16:43:49 -0700 | [diff] [blame] | 43 | # com.android.captiveportallogin reads /proc/vmstat |
Tri Vo | 06d7dca | 2018-01-10 12:51:51 -0800 | [diff] [blame] | 44 | allow platform_app { |
| 45 | proc_vmstat |
| 46 | }:file r_file_perms; |
Jeff Vander Stoep | c15d54e | 2017-07-25 16:43:49 -0700 | [diff] [blame] | 47 | |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 48 | allow platform_app audioserver_service:service_manager find; |
| 49 | allow platform_app cameraserver_service:service_manager find; |
| 50 | allow platform_app drmserver_service:service_manager find; |
| 51 | allow platform_app mediaserver_service:service_manager find; |
Ray Essick | 3918540 | 2017-01-24 12:53:45 -0800 | [diff] [blame] | 52 | allow platform_app mediametrics_service:service_manager find; |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 53 | allow platform_app mediaextractor_service:service_manager find; |
| 54 | allow platform_app mediacodec_service:service_manager find; |
| 55 | allow platform_app mediadrmserver_service:service_manager find; |
| 56 | allow platform_app persistent_data_block_service:service_manager find; |
| 57 | allow platform_app radio_service:service_manager find; |
Todd Poynor | bbc692c | 2017-07-12 18:12:52 -0700 | [diff] [blame] | 58 | allow platform_app thermal_service:service_manager find; |
Neil Fuller | ca595e1 | 2017-01-11 16:27:02 +0000 | [diff] [blame] | 59 | allow platform_app timezone_service:service_manager find; |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 60 | allow platform_app app_api_service:service_manager find; |
| 61 | allow platform_app system_api_service:service_manager find; |
| 62 | allow platform_app vr_manager_service:service_manager find; |
| 63 | |
| 64 | # Access to /data/preloads |
| 65 | allow platform_app preloads_data_file:file r_file_perms; |
| 66 | allow platform_app preloads_data_file:dir r_dir_perms; |
Fyodor Kupolov | b238fe6 | 2017-03-14 11:42:03 -0700 | [diff] [blame] | 67 | allow platform_app preloads_media_file:file r_file_perms; |
| 68 | allow platform_app preloads_media_file:dir r_dir_perms; |
Alex Klyubin | c42d134 | 2017-01-09 14:52:59 -0800 | [diff] [blame] | 69 | |
Mark Salyzyn | d33a9a1 | 2016-11-07 15:11:39 -0800 | [diff] [blame] | 70 | read_runtime_log_tags(platform_app) |
Nick Kralevich | 45766d4 | 2017-04-26 11:40:48 -0700 | [diff] [blame] | 71 | |
Nathan Harold | ee26864 | 2017-12-14 18:20:30 -0800 | [diff] [blame] | 72 | # allow platform apps to use UDP sockets provided by the system server but not |
| 73 | # modify them other than to connect |
| 74 | allow platform_app system_server:udp_socket { connect getattr read recvfrom sendto write }; |
| 75 | |
Nick Kralevich | 45766d4 | 2017-04-26 11:40:48 -0700 | [diff] [blame] | 76 | ### |
| 77 | ### Neverallow rules |
| 78 | ### |
| 79 | |
| 80 | # app domains which access /dev/fuse should not run as platform_app |
| 81 | neverallow platform_app fuse_device:chr_file *; |