blob: 245496f8f304cb785c2d5a60e36534cdfa16a0e7 [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
Jaekyun Seok224921d2018-04-09 12:07:32 +090034set_prop(system_app, bluetooth_a2dp_offload_prop)
Alex Klyubinb5853c32017-01-05 17:18:32 -080035set_prop(system_app, bluetooth_prop)
36set_prop(system_app, debug_prop)
37set_prop(system_app, system_prop)
Jaekyun Seok224921d2018-04-09 12:07:32 +090038set_prop(system_app, exported_bluetooth_prop)
Jaekyun Seoke4971452017-10-19 16:54:49 +090039set_prop(system_app, exported_system_prop)
40set_prop(system_app, exported2_system_prop)
41set_prop(system_app, exported3_system_prop)
Alex Klyubinb5853c32017-01-05 17:18:32 -080042set_prop(system_app, logd_prop)
43set_prop(system_app, net_radio_prop)
44set_prop(system_app, system_radio_prop)
Jaekyun Seoke4971452017-10-19 16:54:49 +090045set_prop(system_app, exported_system_radio_prop)
Alex Klyubinb5853c32017-01-05 17:18:32 -080046set_prop(system_app, log_tag_prop)
47userdebug_or_eng(`set_prop(system_app, logpersistd_logging_prop)')
48auditallow system_app net_radio_prop:property_service set;
49auditallow system_app system_radio_prop:property_service set;
Jaekyun Seoke4971452017-10-19 16:54:49 +090050auditallow system_app exported_system_radio_prop:property_service set;
Alex Klyubinb5853c32017-01-05 17:18:32 -080051
52# ctl interface
53set_prop(system_app, ctl_default_prop)
54set_prop(system_app, ctl_bugreport_prop)
55
56# Create /data/anr/traces.txt.
57allow system_app anr_data_file:dir ra_dir_perms;
58allow system_app anr_data_file:file create_file_perms;
59
60# Settings need to access app name and icon from asec
61allow system_app asec_apk_file:file r_file_perms;
62
Bookatz022ab0e2018-02-13 09:33:36 -080063# Allow system apps (like Settings) to interact with statsd
64binder_call(system_app, statsd)
65
Joe Onorato41f93db2016-11-20 23:23:04 -080066# Allow system apps to interact with incidentd
67binder_call(system_app, incidentd)
68
Alex Klyubinb5853c32017-01-05 17:18:32 -080069allow system_app servicemanager:service_manager list;
70# TODO: scope this down? Too broad?
Dan Cashman91d398d2017-09-26 12:58:29 -070071allow system_app {
72 service_manager_type
Martijn Coenenac097ac2018-08-17 09:35:42 +020073 -apex_service
Dan Cashman91d398d2017-09-26 12:58:29 -070074 -dumpstate_service
75 -installd_service
76 -netd_service
77 -virtual_touchpad_service
78 -vold_service
79 -vr_hwc_service
80}:service_manager find;
Jeff Vander Stoep2d32d812017-10-13 13:33:46 -070081# suppress denials for services system_app should not be accessing.
82dontaudit system_app {
83 dumpstate_service
84 installd_service
85 netd_service
86 virtual_touchpad_service
87 vold_service
88 vr_hwc_service
89}:service_manager find;
Alex Klyubinb5853c32017-01-05 17:18:32 -080090
91allow system_app keystore:keystore_key {
92 get_state
93 get
94 insert
95 delete
96 exist
97 list
98 reset
99 password
100 lock
101 unlock
102 is_empty
103 sign
104 verify
105 grant
106 duplicate
107 clear_uid
108 user_changed
109};
110
Jeff Vander Stoep7a4af302018-04-10 12:47:48 -0700111# /proc/net access.
112# TODO(b/9496886) Audit access for removal.
113r_dir_file(system_app, proc_net_type)
114userdebug_or_eng(`
115 auditallow system_app proc_net_type:{ dir file lnk_file } { getattr open read };
116')
117
Tri Vo06d7dca2018-01-10 12:51:51 -0800118# settings app reads /proc/version
Jeff Vander Stoepc975bd92017-09-27 12:27:03 -0700119allow system_app {
Jeff Vander Stoepc975bd92017-09-27 12:27:03 -0700120 proc_version
121}:file r_file_perms;
Jeff Vander Stoepc15d54e2017-07-25 16:43:49 -0700122
Alex Klyubinb5853c32017-01-05 17:18:32 -0800123control_logd(system_app)
Mark Salyzynd33a9a12016-11-07 15:11:39 -0800124read_runtime_log_tags(system_app)
Pavel Grafov118e4962018-01-18 17:22:28 +0000125get_prop(system_app, device_logging_prop)
Nick Kralevich45766d42017-04-26 11:40:48 -0700126
Nathan Haroldee268642017-12-14 18:20:30 -0800127# allow system apps to use UDP sockets provided by the system server but not
128# modify them other than to connect
Nathan Harold252b0152018-03-27 06:34:54 -0700129allow system_app system_server:udp_socket {
130 connect getattr read recvfrom sendto write getopt setopt };
Nathan Haroldee268642017-12-14 18:20:30 -0800131
Nick Kralevich45766d42017-04-26 11:40:48 -0700132###
133### Neverallow rules
134###
135
136# app domains which access /dev/fuse should not run as system_app
137neverallow system_app fuse_device:chr_file *;