1### 2### Untrusted v2 sandbox apps. 3### 4 5typeattribute untrusted_v2_app coredomain; 6 7app_domain(untrusted_v2_app) 8net_domain(untrusted_v2_app) 9bluetooth_domain(untrusted_v2_app) 10 11# Read and write system app data files passed over Binder. 12# Motivating case was /data/data/com.android.settings/cache/*.jpg for 13# cropping or taking user photos. 14allow untrusted_v2_app system_app_data_file:file { read write getattr }; 15 16# Access to /data/media. 17allow untrusted_v2_app media_rw_data_file:dir create_dir_perms; 18allow untrusted_v2_app media_rw_data_file:file create_file_perms; 19 20# Traverse into /mnt/media_rw for bypassing FUSE daemon 21# TODO: narrow this to just MediaProvider 22allow untrusted_v2_app mnt_media_rw_file:dir search; 23 24# allow cts to query all services 25allow untrusted_v2_app servicemanager:service_manager list; 26 27allow untrusted_v2_app audioserver_service:service_manager find; 28allow untrusted_v2_app cameraserver_service:service_manager find; 29allow untrusted_v2_app drmserver_service:service_manager find; 30allow untrusted_v2_app mediaserver_service:service_manager find; 31allow untrusted_v2_app mediaextractor_service:service_manager find; 32allow untrusted_v2_app mediacodec_service:service_manager find; 33allow untrusted_v2_app mediametrics_service:service_manager find; 34allow untrusted_v2_app mediadrmserver_service:service_manager find; 35allow untrusted_v2_app nfc_service:service_manager find; 36allow untrusted_v2_app radio_service:service_manager find; 37# TODO: potentially provide a tighter list of services here 38allow untrusted_v2_app app_api_service:service_manager find; 39 40# gdbserver for ndk-gdb ptrace attaches to app process. 41allow untrusted_v2_app self:process ptrace; 42 43# Write app-specific trace data to the Perfetto traced damon. This requires 44# connecting to its producer socket and obtaining a (per-process) tmpfs fd. 45allow untrusted_v2_app traced:fd use; 46allow untrusted_v2_app traced_tmpfs:file { read write getattr map }; 47unix_socket_connect(untrusted_v2_app, traced_producer, traced) 48