blob: 73aa79e90bcabb3b73eff19f6f868df71306ba4f [file] [log] [blame]
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -08001###
2### Untrusted_app_all.
3###
Chad Brubakerb93f0492017-03-29 14:53:09 -07004### This file defines the rules shared by all untrusted app domains except
5### ephemeral apps.
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -08006### Apps are labeled based on mac_permissions.xml (maps signer and
7### optionally package name to seinfo value) and seapp_contexts (maps UID
8### and optionally seinfo value to domain for process and type for data
9### directory). The untrusted_app_all attribute is assigned to all default
10### seapp_contexts for any app with UID between APP_AID (10000)
11### and AID_ISOLATED_START (99000) if the app has no specific seinfo
12### value as determined from mac_permissions.xml. In current AOSP, this
13### attribute is assigned to all non-system apps as well as to any system apps
14### that are not signed by the platform key. To move
15### a system app into a specific domain, add a signer entry for it to
16### mac_permissions.xml and assign it one of the pre-existing seinfo values
17### or define and use a new seinfo value in both mac_permissions.xml and
18### seapp_contexts.
19###
20
Nick Kralevich9be90fb2017-03-06 02:49:50 +000021# Legacy text relocations
22allow untrusted_app_all apk_data_file:file execmod;
23
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -080024# Some apps ship with shared libraries and binaries that they write out
25# to their sandbox directory and then execute.
Nick Kralevich9be90fb2017-03-06 02:49:50 +000026allow untrusted_app_all app_data_file:file { rx_file_perms execmod };
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -080027
28# ASEC
29allow untrusted_app_all asec_apk_file:file r_file_perms;
30allow untrusted_app_all asec_apk_file:dir r_dir_perms;
31# Execute libs in asec containers.
Nick Kralevich9be90fb2017-03-06 02:49:50 +000032allow untrusted_app_all asec_public_file:file { execute execmod };
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -080033
34# Used by Finsky / Android "Verify Apps" functionality when
35# running "adb install foo.apk".
36# TODO: Long term, we don't want apps probing into shell data files.
37# Figure out a way to remove these rules.
38allow untrusted_app_all shell_data_file:file r_file_perms;
39allow untrusted_app_all shell_data_file:dir r_dir_perms;
40
41# Read and write system app data files passed over Binder.
42# Motivating case was /data/data/com.android.settings/cache/*.jpg for
43# cropping or taking user photos.
44allow untrusted_app_all system_app_data_file:file { read write getattr };
45
46#
47# Rules migrated from old app domains coalesced into untrusted_app.
48# This includes what used to be media_app, shared_app, and release_app.
49#
50
51# Access to /data/media.
52allow untrusted_app_all media_rw_data_file:dir create_dir_perms;
53allow untrusted_app_all media_rw_data_file:file create_file_perms;
54
55# Traverse into /mnt/media_rw for bypassing FUSE daemon
56# TODO: narrow this to just MediaProvider
57allow untrusted_app_all mnt_media_rw_file:dir search;
58
59# allow cts to query all services
60allow untrusted_app_all servicemanager:service_manager list;
61
62allow untrusted_app_all audioserver_service:service_manager find;
63allow untrusted_app_all cameraserver_service:service_manager find;
64allow untrusted_app_all drmserver_service:service_manager find;
65allow untrusted_app_all mediaserver_service:service_manager find;
66allow untrusted_app_all mediaextractor_service:service_manager find;
67allow untrusted_app_all mediacodec_service:service_manager find;
68allow untrusted_app_all mediametrics_service:service_manager find;
69allow untrusted_app_all mediadrmserver_service:service_manager find;
Chong Zhang72916412016-10-31 17:02:32 -070070allow untrusted_app_all mediacasserver_service:service_manager find;
Jeff Vander Stoepbacb6d72017-02-13 13:33:27 -080071allow untrusted_app_all nfc_service:service_manager find;
72allow untrusted_app_all radio_service:service_manager find;
73allow untrusted_app_all surfaceflinger_service:service_manager find;
74allow untrusted_app_all app_api_service:service_manager find;
75allow untrusted_app_all vr_manager_service:service_manager find;
76
77# Allow GMS core to access perfprofd output, which is stored
78# in /data/misc/perfprofd/. GMS core will need to list all
79# data stored in that directory to process them one by one.
80userdebug_or_eng(`
81 allow untrusted_app_all perfprofd_data_file:file r_file_perms;
82 allow untrusted_app_all perfprofd_data_file:dir r_dir_perms;
83')
84
85# gdbserver for ndk-gdb ptrace attaches to app process.
86allow untrusted_app_all self:process ptrace;
87
88# Cts: HwRngTest
89allow untrusted_app_all sysfs_hwrandom:dir search;
90allow untrusted_app_all sysfs_hwrandom:file r_file_perms;
91
Fyodor Kupolovb238fe62017-03-14 11:42:03 -070092# Allow apps to view preloaded media content
93allow untrusted_app_all preloads_media_file:dir r_dir_perms;
94allow untrusted_app_all preloads_media_file:file r_file_perms;
95allow untrusted_app_all preloads_data_file:dir search;