William Hester | 5f486c7 | 2019-01-15 13:39:30 -0800 | [diff] [blame] | 1 | # Allow apps to read the Test Harness Mode property. This property is used in |
| 2 | # the implementation of ActivityManager.isDeviceInTestHarnessMode() |
| 3 | get_prop(appdomain, test_harness_prop) |
| 4 | |
Inseob Kim | dbcc459 | 2020-05-21 20:12:55 +0900 | [diff] [blame] | 5 | get_prop(appdomain, boot_status_prop) |
| 6 | get_prop(appdomain, dalvik_config_prop) |
Inseob Kim | dddf6f5 | 2020-07-06 22:24:11 +0900 | [diff] [blame] | 7 | get_prop(appdomain, media_config_prop) |
Inseob Kim | 5eacf72 | 2020-07-01 01:27:49 +0900 | [diff] [blame] | 8 | get_prop(appdomain, packagemanager_config_prop) |
Inseob Kim | dbcc459 | 2020-05-21 20:12:55 +0900 | [diff] [blame] | 9 | get_prop(appdomain, surfaceflinger_color_prop) |
| 10 | get_prop(appdomain, systemsound_config_prop) |
Inseob Kim | 641cffe | 2020-06-05 10:40:16 +0900 | [diff] [blame] | 11 | get_prop(appdomain, telephony_config_prop) |
Inseob Kim | dbcc459 | 2020-05-21 20:12:55 +0900 | [diff] [blame] | 12 | get_prop(appdomain, userspace_reboot_config_prop) |
| 13 | get_prop(appdomain, vold_config_prop) |
Hongguang Chen | 67c3688 | 2020-07-27 15:15:53 -0700 | [diff] [blame^] | 14 | get_prop(appdomain, adbd_config_prop) |
Inseob Kim | dbcc459 | 2020-05-21 20:12:55 +0900 | [diff] [blame] | 15 | |
Florian Mayer | 5e52281 | 2019-10-08 16:15:14 +0100 | [diff] [blame] | 16 | userdebug_or_eng(`perfetto_producer({ appdomain })') |
| 17 | |
Jeff Vander Stoep | 607bc67 | 2019-12-16 10:59:03 +0100 | [diff] [blame] | 18 | # Prevent apps from causing presubmit failures. |
| 19 | # Apps can cause selinux denials by accessing CE storage |
| 20 | # and/or external storage. In either case, the selinux denial is |
| 21 | # not the cause of the failure, but just a symptom that |
| 22 | # storage isn't ready. Many apps handle the failure appropriately. |
| 23 | # |
| 24 | # Apps cannot access external storage before it becomes available. |
| 25 | dontaudit appdomain storage_stub_file:dir getattr; |
| 26 | # Attempts to write to system_data_file is generally a sign |
| 27 | # that apps are attempting to access encrypted storage before |
| 28 | # the ACTION_USER_UNLOCKED intent is delivered. Apps are not |
| 29 | # allowed to write to CE storage before it's available. |
| 30 | # Attempting to do so will be blocked by both selinux and unix |
| 31 | # permissions. |
| 32 | dontaudit appdomain system_data_file:dir write; |
Jeff Vander Stoep | 67896ee | 2020-04-02 13:36:17 +0200 | [diff] [blame] | 33 | # Apps should not be reading vendor-defined properties. |
| 34 | dontaudit appdomain vendor_default_prop:file read; |
Jeff Vander Stoep | 607bc67 | 2019-12-16 10:59:03 +0100 | [diff] [blame] | 35 | |
Nathan Harold | ee26864 | 2017-12-14 18:20:30 -0800 | [diff] [blame] | 36 | neverallow appdomain system_server:udp_socket { |
Nathan Harold | 252b015 | 2018-03-27 06:34:54 -0700 | [diff] [blame] | 37 | accept append bind create ioctl listen lock name_bind |
| 38 | relabelfrom relabelto setattr shutdown }; |
Nick Kralevich | 1e5021c | 2018-11-28 17:50:24 -0800 | [diff] [blame] | 39 | |
| 40 | # Transition to a non-app domain. |
| 41 | # Exception for the shell and su domains, can transition to runas, etc. |
Nick Kralevich | 0eb0a16 | 2018-12-12 09:06:05 -0800 | [diff] [blame] | 42 | # Exception for crash_dump to allow for app crash reporting. |
| 43 | # Exception for renderscript binaries (/system/bin/bcc, /system/bin/ld.mc) |
| 44 | # to allow renderscript to create privileged executable files. |
| 45 | neverallow { appdomain -shell userdebug_or_eng(`-su') } |
| 46 | { domain -appdomain -crash_dump -rs }:process { transition }; |
| 47 | neverallow { appdomain -shell userdebug_or_eng(`-su') } |
| 48 | { domain -appdomain }:process { dyntransition }; |
Daniel Rosenberg | afede84 | 2020-05-11 22:50:40 -0700 | [diff] [blame] | 49 | |
| 50 | # Don't allow regular apps access to storage configuration properties. |
| 51 | neverallow { appdomain -mediaprovider_app } storage_config_prop:file no_rw_file_perms; |
Peiyong Lin | 37dea07 | 2020-06-03 12:20:41 -0700 | [diff] [blame] | 52 | |
Inseob Kim | c80b024 | 2020-07-16 22:25:47 +0900 | [diff] [blame] | 53 | # Allow to read sendbug.preferred.domain |
| 54 | get_prop(appdomain, sendbug_config_prop) |
| 55 | |
Peiyong Lin | 37dea07 | 2020-06-03 12:20:41 -0700 | [diff] [blame] | 56 | # Allow to read graphics related properties. |
| 57 | get_prop(appdomain, graphics_config_prop) |
Inseob Kim | c97a97c | 2020-07-20 20:26:07 +0900 | [diff] [blame] | 58 | |
| 59 | # Allow to read persist.config.calibration_fac |
| 60 | get_prop(appdomain, camera_calibration_prop) |