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