blob: b2f83764f88a171dc3acf36dfb3c6956135ca72b [file] [log] [blame]
Alex Klyubinb5853c32017-01-05 17:18:32 -08001###
2### Apps that run with the system UID, e.g. com.android.system.ui,
3### com.android.settings. These are not as privileged as the system
4### server.
5###
6
Alex Klyubinf5446eb2017-03-23 14:27:32 -07007typeattribute system_app coredomain;
Alex Klyubinb5853c32017-01-05 17:18:32 -08008
dcashman3e8dbf02016-12-08 11:23:34 -08009app_domain(system_app)
Alex Klyubinb5853c32017-01-05 17:18:32 -080010net_domain(system_app)
11binder_service(system_app)
12
Jeff Vander Stoepa12aad42017-07-10 20:39:50 -070013# android.ui and system.ui
14allow system_app rootfs:dir getattr;
15
Alex Klyubinb5853c32017-01-05 17:18:32 -080016# Read and write /data/data subdirectory.
17allow system_app system_app_data_file:dir create_dir_perms;
18allow system_app system_app_data_file:{ file lnk_file } create_file_perms;
19
20# Read and write to /data/misc/user.
21allow system_app misc_user_data_file:dir create_dir_perms;
22allow system_app misc_user_data_file:file create_file_perms;
23
24# Access to vold-mounted storage for measuring free space
25allow system_app mnt_media_rw_file:dir search;
26
27# Read wallpaper file.
28allow system_app wallpaper_file:file r_file_perms;
29
30# Read icon file.
31allow system_app icon_file:file r_file_perms;
32
33# Write to properties
34set_prop(system_app, bluetooth_prop)
35set_prop(system_app, debug_prop)
36set_prop(system_app, system_prop)
Jaekyun Seoke4971452017-10-19 16:54:49 +090037set_prop(system_app, exported_system_prop)
38set_prop(system_app, exported2_system_prop)
39set_prop(system_app, exported3_system_prop)
Alex Klyubinb5853c32017-01-05 17:18:32 -080040set_prop(system_app, logd_prop)
41set_prop(system_app, net_radio_prop)
42set_prop(system_app, system_radio_prop)
Jaekyun Seoke4971452017-10-19 16:54:49 +090043set_prop(system_app, exported_system_radio_prop)
Alex Klyubinb5853c32017-01-05 17:18:32 -080044set_prop(system_app, log_tag_prop)
45userdebug_or_eng(`set_prop(system_app, logpersistd_logging_prop)')
46auditallow system_app net_radio_prop:property_service set;
47auditallow system_app system_radio_prop:property_service set;
Jaekyun Seoke4971452017-10-19 16:54:49 +090048auditallow system_app exported_system_radio_prop:property_service set;
Alex Klyubinb5853c32017-01-05 17:18:32 -080049
50# ctl interface
51set_prop(system_app, ctl_default_prop)
52set_prop(system_app, ctl_bugreport_prop)
53
54# Create /data/anr/traces.txt.
55allow system_app anr_data_file:dir ra_dir_perms;
56allow system_app anr_data_file:file create_file_perms;
57
58# Settings need to access app name and icon from asec
59allow system_app asec_apk_file:file r_file_perms;
60
Bookatz022ab0e2018-02-13 09:33:36 -080061# Allow system apps (like Settings) to interact with statsd
62binder_call(system_app, statsd)
63
Joe Onorato41f93db2016-11-20 23:23:04 -080064# Allow system apps to interact with incidentd
65binder_call(system_app, incidentd)
66
Alex Klyubinb5853c32017-01-05 17:18:32 -080067allow system_app servicemanager:service_manager list;
68# TODO: scope this down? Too broad?
Dan Cashman91d398d2017-09-26 12:58:29 -070069allow system_app {
70 service_manager_type
71 -dumpstate_service
72 -installd_service
73 -netd_service
74 -virtual_touchpad_service
75 -vold_service
76 -vr_hwc_service
77}:service_manager find;
Jeff Vander Stoep2d32d812017-10-13 13:33:46 -070078# suppress denials for services system_app should not be accessing.
79dontaudit system_app {
80 dumpstate_service
81 installd_service
82 netd_service
83 virtual_touchpad_service
84 vold_service
85 vr_hwc_service
86}:service_manager find;
Alex Klyubinb5853c32017-01-05 17:18:32 -080087
88allow system_app keystore:keystore_key {
89 get_state
90 get
91 insert
92 delete
93 exist
94 list
95 reset
96 password
97 lock
98 unlock
99 is_empty
100 sign
101 verify
102 grant
103 duplicate
104 clear_uid
105 user_changed
106};
107
Tri Vo06d7dca2018-01-10 12:51:51 -0800108# settings app reads /proc/version
Jeff Vander Stoepc975bd92017-09-27 12:27:03 -0700109allow system_app {
Jeff Vander Stoepc975bd92017-09-27 12:27:03 -0700110 proc_version
111}:file r_file_perms;
Jeff Vander Stoepc15d54e2017-07-25 16:43:49 -0700112
Alex Klyubinb5853c32017-01-05 17:18:32 -0800113control_logd(system_app)
Mark Salyzynd33a9a12016-11-07 15:11:39 -0800114read_runtime_log_tags(system_app)
Pavel Grafov118e4962018-01-18 17:22:28 +0000115get_prop(system_app, device_logging_prop)
Nick Kralevich45766d42017-04-26 11:40:48 -0700116
Nathan Haroldee268642017-12-14 18:20:30 -0800117# allow system apps to use UDP sockets provided by the system server but not
118# modify them other than to connect
Nathan Harold252b0152018-03-27 06:34:54 -0700119allow system_app system_server:udp_socket {
120 connect getattr read recvfrom sendto write getopt setopt };
Nathan Haroldee268642017-12-14 18:20:30 -0800121
Nick Kralevich45766d42017-04-26 11:40:48 -0700122###
123### Neverallow rules
124###
125
126# app domains which access /dev/fuse should not run as system_app
127neverallow system_app fuse_device:chr_file *;