Nick Kralevich | 748fdef | 2013-07-12 16:33:29 -0700 | [diff] [blame] | 1 | ### |
| 2 | ### Domain for all zygote spawned apps |
| 3 | ### |
| 4 | ### This file is the base policy for all zygote spawned apps. |
| 5 | ### Other policy files, such as isolated_app.te, untrusted_app.te, etc |
| 6 | ### extend from this policy. Only policies which should apply to ALL |
| 7 | ### zygote spawned apps should be added here. |
| 8 | ### |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 9 | |
Stephen Smalley | ad7df7b | 2013-12-20 08:24:12 -0500 | [diff] [blame] | 10 | # Dalvik Compiler JIT Mapping. |
| 11 | allow appdomain self:process execmem; |
Stephen Smalley | e7ec2f5 | 2013-12-23 16:18:55 -0500 | [diff] [blame] | 12 | allow appdomain ashmem_device:chr_file execute; |
Stephen Smalley | ad7df7b | 2013-12-20 08:24:12 -0500 | [diff] [blame] | 13 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 14 | # Receive and use open file descriptors inherited from zygote. |
| 15 | allow appdomain zygote:fd use; |
| 16 | |
Stephen Smalley | 48759ca | 2013-10-29 14:42:39 -0400 | [diff] [blame] | 17 | # gdbserver for ndk-gdb reads the zygote. |
Nick Kralevich | 4fce0ef | 2014-05-22 15:00:25 -0700 | [diff] [blame] | 18 | # valgrind needs mmap exec for zygote |
| 19 | allow appdomain zygote_exec:file rx_file_perms; |
Stephen Smalley | 48759ca | 2013-10-29 14:42:39 -0400 | [diff] [blame] | 20 | |
| 21 | # gdbserver for ndk-gdb ptrace attaches to app process. |
| 22 | allow appdomain self:process ptrace; |
| 23 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 24 | # Read system properties managed by zygote. |
| 25 | allow appdomain zygote_tmpfs:file read; |
| 26 | |
| 27 | # Notify zygote of death; |
| 28 | allow appdomain zygote:process sigchld; |
| 29 | |
Stephen Smalley | 48759ca | 2013-10-29 14:42:39 -0400 | [diff] [blame] | 30 | # Notify shell and adbd of death when spawned via runas for ndk-gdb. |
| 31 | allow appdomain shell:process sigchld; |
| 32 | allow appdomain adbd:process sigchld; |
| 33 | |
| 34 | # child shell or gdbserver pty access for runas. |
| 35 | allow appdomain devpts:chr_file { getattr read write ioctl }; |
| 36 | |
Stephen Smalley | 3dad7b6 | 2014-03-05 09:50:08 -0500 | [diff] [blame] | 37 | # Use pipes and sockets provided by system_server via binder or local socket. |
Alex Klyubin | 1fdee11 | 2013-09-13 15:59:04 -0700 | [diff] [blame] | 38 | allow appdomain system_server:fifo_file rw_file_perms; |
Stephen Smalley | 3dad7b6 | 2014-03-05 09:50:08 -0500 | [diff] [blame] | 39 | allow appdomain system_server:unix_stream_socket { read write setopt getattr getopt shutdown }; |
| 40 | allow appdomain system_server:tcp_socket { read write getattr getopt shutdown }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 41 | |
Nick Kralevich | 82fc3b5 | 2013-12-06 13:31:16 -0800 | [diff] [blame] | 42 | # Communication with other apps via fifos |
| 43 | allow appdomain appdomain:fifo_file rw_file_perms; |
| 44 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 45 | # Communicate with surfaceflinger. |
Stephen Smalley | b0db712 | 2014-03-06 16:03:48 -0500 | [diff] [blame] | 46 | allow appdomain surfaceflinger:unix_stream_socket { read write setopt getattr getopt shutdown }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 47 | |
| 48 | # App sandbox file accesses. |
| 49 | allow appdomain app_data_file:dir create_dir_perms; |
Stephen Smalley | 6531712 | 2013-12-11 09:08:09 -0500 | [diff] [blame] | 50 | allow appdomain app_data_file:notdevfile_class_set create_file_perms; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 51 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 52 | # lib subdirectory of /data/data dir is system-owned. |
| 53 | allow appdomain system_data_file:dir r_dir_perms; |
Nick Kralevich | 78706f9 | 2014-06-02 14:49:10 -0700 | [diff] [blame] | 54 | allow appdomain system_data_file:file { execute execute_no_trans open execmod }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 55 | |
Jeff Sharkey | 6736bac | 2014-04-24 13:31:29 -0700 | [diff] [blame] | 56 | # Access to OEM provided data and apps |
| 57 | allow appdomain oemfs:dir r_dir_perms; |
| 58 | allow appdomain oemfs:file rx_file_perms; |
| 59 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 60 | # Execute the shell or other system executables. |
| 61 | allow appdomain shell_exec:file rx_file_perms; |
| 62 | allow appdomain system_file:file rx_file_perms; |
| 63 | |
| 64 | # Read/write wallpaper file (opened by system). |
Robert Craig | fc4c6b7 | 2014-01-23 10:05:28 -0500 | [diff] [blame] | 65 | allow appdomain wallpaper_file:file { getattr read write }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 66 | |
| 67 | # Write to /data/anr/traces.txt. |
| 68 | allow appdomain anr_data_file:dir search; |
| 69 | allow appdomain anr_data_file:file { open append }; |
| 70 | |
Nick Kralevich | 09e6abd | 2013-12-13 22:19:45 -0800 | [diff] [blame] | 71 | # Allow apps to send dump information to dumpstate |
| 72 | allow appdomain dumpstate:fd use; |
Stephen Smalley | b0db712 | 2014-03-06 16:03:48 -0500 | [diff] [blame] | 73 | allow appdomain dumpstate:unix_stream_socket { read write getopt getattr shutdown }; |
Nick Kralevich | 2e7a301 | 2014-01-10 23:05:25 -0800 | [diff] [blame] | 74 | allow appdomain shell_data_file:file { write getattr }; |
Nick Kralevich | 09e6abd | 2013-12-13 22:19:45 -0800 | [diff] [blame] | 75 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 76 | # Write to /proc/net/xt_qtaguid/ctrl file. |
| 77 | allow appdomain qtaguid_proc:file rw_file_perms; |
| 78 | # Everybody can read the xt_qtaguid resource tracking misc dev. |
| 79 | # So allow all apps to read from /dev/xt_qtaguid. |
| 80 | allow appdomain qtaguid_device:chr_file r_file_perms; |
| 81 | |
Stephen Smalley | 3ba9012 | 2013-12-12 09:09:53 -0500 | [diff] [blame] | 82 | # Grant GPU access to all processes started by Zygote. |
| 83 | # They need that to render the standard UI. |
| 84 | allow appdomain gpu_device:chr_file { rw_file_perms execute }; |
| 85 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 86 | # Use the Binder. |
| 87 | binder_use(appdomain) |
| 88 | # Perform binder IPC to binder services. |
| 89 | binder_call(appdomain, binderservicedomain) |
| 90 | # Perform binder IPC to other apps. |
| 91 | binder_call(appdomain, appdomain) |
| 92 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 93 | # Already connected, unnamed sockets being passed over some other IPC |
| 94 | # hence no sock_file or connectto permission. This appears to be how |
| 95 | # Chrome works, may need to be updated as more apps using isolated services |
| 96 | # are examined. |
Stephen Smalley | b0db712 | 2014-03-06 16:03:48 -0500 | [diff] [blame] | 97 | allow appdomain appdomain:unix_stream_socket { getopt getattr read write shutdown }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 98 | |
| 99 | # Backup ability for every app. BMS opens and passes the fd |
| 100 | # to any app that has backup ability. Hence, no open permissions here. |
Geremy Condra | 8156073 | 2013-08-30 13:02:30 -0700 | [diff] [blame] | 101 | allow appdomain backup_data_file:file { read write getattr }; |
| 102 | allow appdomain cache_backup_file:file { read write getattr }; |
Stephen Smalley | 9ba844f | 2014-04-04 09:09:25 -0400 | [diff] [blame] | 103 | allow appdomain cache_backup_file:dir getattr; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 104 | # Backup ability using 'adb backup' |
| 105 | allow appdomain system_data_file:lnk_file getattr; |
| 106 | |
Stephen Smalley | 2737cef | 2014-03-04 13:44:01 -0500 | [diff] [blame] | 107 | # Allow read/stat of /data/media files passed by Binder or local socket IPC. |
| 108 | allow appdomain media_rw_data_file:file { read getattr }; |
| 109 | |
Nick Kralevich | 1545b60 | 2014-05-05 11:04:12 -0700 | [diff] [blame] | 110 | # Read and write /data/data/com.android.providers.telephony files passed over Binder. |
| 111 | allow appdomain radio_data_file:file { read write getattr }; |
Stephen Smalley | 3fbc536 | 2014-03-27 09:45:26 -0400 | [diff] [blame] | 112 | |
Stephen Smalley | 91a4f8d | 2014-05-07 13:10:02 -0400 | [diff] [blame] | 113 | # Read and write system app data files passed over Binder. |
| 114 | # Motivating case was /data/data/com.android.settings/cache/*.jpg for |
| 115 | # cropping or taking user photos. |
| 116 | allow untrusted_app system_app_data_file:file { read write getattr }; |
| 117 | |
Stephen Smalley | b0db712 | 2014-03-06 16:03:48 -0500 | [diff] [blame] | 118 | # Access SDcard. |
| 119 | allow appdomain sdcard_type:dir create_dir_perms; |
| 120 | allow appdomain sdcard_type:file create_file_perms; |
| 121 | |
Nick Kralevich | 0b8c20e | 2013-10-09 12:27:27 -0700 | [diff] [blame] | 122 | # Allow apps to use the USB Accessory interface. |
| 123 | # http://developer.android.com/guide/topics/connectivity/usb/accessory.html |
| 124 | # |
| 125 | # USB devices are first opened by the system server (USBDeviceManagerService) |
| 126 | # and the file descriptor is passed to the right Activity via binder. |
| 127 | allow appdomain usb_device:chr_file { read write getattr ioctl }; |
| 128 | allow appdomain usbaccessory_device:chr_file { read write getattr }; |
| 129 | |
Stephen Smalley | 527316a | 2013-12-23 14:48:02 -0500 | [diff] [blame] | 130 | # For art. |
| 131 | allow appdomain dalvikcache_data_file:file execute; |
| 132 | |
Stephen Smalley | 19c5090 | 2014-04-09 14:24:33 -0400 | [diff] [blame] | 133 | # /data/dalvik-cache/profiles |
| 134 | allow appdomain dalvikcache_profiles_data_file:file write; |
| 135 | |
Torne (Richard Coles) | 9786af2 | 2014-05-23 11:01:58 +0100 | [diff] [blame] | 136 | # Allow any app to read shared RELRO files. |
| 137 | allow appdomain shared_relro_file:dir search; |
| 138 | allow appdomain shared_relro_file:file r_file_perms; |
| 139 | |
Christopher Tate | 6f6c425 | 2014-05-30 15:21:22 -0700 | [diff] [blame^] | 140 | # Allow apps to read/execute installed binaries |
| 141 | allow appdomain apk_data_file:file { rx_file_perms execmod }; |
| 142 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 143 | ### |
Stephen Smalley | 5946937 | 2013-12-16 08:55:24 -0500 | [diff] [blame] | 144 | ### CTS-specific rules |
| 145 | ### |
| 146 | |
| 147 | # For cts/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/RootProcessScanner.java. |
| 148 | # Reads /proc/pid/status and statm entries to check that |
| 149 | # no unexpected root processes are running. |
| 150 | # Also for cts/tests/tests/security/src/android/security/cts/VoldExploitTest.java |
| 151 | # Reads /proc/pid/cmdline of vold. |
| 152 | allow appdomain domain:dir { open read search getattr }; |
| 153 | allow appdomain domain:{ file lnk_file } { open read getattr }; |
| 154 | |
| 155 | # For cts/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java. |
| 156 | # testRunAsHasCorrectCapabilities |
| 157 | allow appdomain runas_exec:file getattr; |
| 158 | # Others are either allowed elsewhere or not desired. |
| 159 | |
| 160 | # For cts/tests/tests/security/src/android/security/cts/SELinuxTest.java |
| 161 | # Check SELinux policy and contexts. |
| 162 | selinux_check_access(appdomain) |
| 163 | selinux_check_context(appdomain) |
| 164 | # Validate that each process is running in the correct security context. |
| 165 | allow appdomain domain:process getattr; |
| 166 | |
Mark Salyzyn | 8ed750e | 2013-11-12 15:34:52 -0800 | [diff] [blame] | 167 | # logd access |
| 168 | read_logd(appdomain) |
| 169 | # application inherit logd write socket (urge is to deprecate this long term) |
| 170 | allow appdomain zygote:unix_dgram_socket write; |
| 171 | |
Stephen Smalley | 5946937 | 2013-12-16 08:55:24 -0500 | [diff] [blame] | 172 | ### |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 173 | ### Neverallow rules |
| 174 | ### |
| 175 | ### These are things that Android apps should NEVER be able to do |
| 176 | ### |
| 177 | |
| 178 | # Superuser capabilities. |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 179 | # bluetooth requires net_admin. |
| 180 | neverallow { appdomain -unconfineddomain -bluetooth } self:capability *; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 181 | neverallow { appdomain -unconfineddomain } self:capability2 *; |
| 182 | |
| 183 | # Block device access. |
| 184 | neverallow { appdomain -unconfineddomain } dev_type:blk_file { read write }; |
| 185 | |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 186 | # Access to any of the following character devices. |
| 187 | neverallow { appdomain -unconfineddomain } { |
| 188 | audio_device |
| 189 | camera_device |
| 190 | dm_device |
| 191 | radio_device |
| 192 | gps_device |
| 193 | rpmsg_device |
| 194 | }:chr_file { read write }; |
| 195 | |
| 196 | # Note: Try expanding list of app domains in the future. |
Greg Hackmann | 7004789 | 2014-05-06 15:42:18 -0700 | [diff] [blame] | 197 | neverallow { untrusted_app isolated_app shell -unconfineddomain } { |
| 198 | adf_device |
| 199 | graphics_device |
| 200 | }:chr_file { read write }; |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 201 | |
| 202 | neverallow { appdomain -nfc -unconfineddomain } nfc_device:chr_file |
| 203 | { read write }; |
| 204 | neverallow { appdomain -bluetooth -unconfineddomain } hci_attach_dev:chr_file |
| 205 | { read write }; |
| 206 | neverallow { appdomain -unconfineddomain } tee_device:chr_file { read write }; |
| 207 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 208 | # Privileged netlink socket interfaces. |
| 209 | neverallow { appdomain -unconfineddomain } |
| 210 | self:{ |
| 211 | netlink_socket |
| 212 | netlink_firewall_socket |
| 213 | netlink_tcpdiag_socket |
| 214 | netlink_nflog_socket |
| 215 | netlink_xfrm_socket |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 216 | netlink_audit_socket |
| 217 | netlink_ip6fw_socket |
| 218 | netlink_dnrt_socket |
| 219 | netlink_kobject_uevent_socket |
| 220 | } *; |
| 221 | |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 222 | # Sockets under /dev/socket that are not specifically typed. |
| 223 | neverallow { appdomain -unconfineddomain } socket_device:sock_file write; |
| 224 | |
| 225 | # Unix domain sockets. |
| 226 | neverallow { appdomain -unconfineddomain } adbd_socket:sock_file write; |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 227 | neverallow { appdomain -unconfineddomain } installd_socket:sock_file write; |
| 228 | neverallow { appdomain -bluetooth -radio -shell -system_app -unconfineddomain } |
| 229 | property_socket:sock_file write; |
| 230 | neverallow { appdomain -radio -unconfineddomain } rild_socket:sock_file write; |
| 231 | neverallow { appdomain -unconfineddomain } vold_socket:sock_file write; |
| 232 | neverallow { appdomain -unconfineddomain } zygote_socket:sock_file write; |
| 233 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 234 | # ptrace access to non-app domains. |
| 235 | neverallow { appdomain -unconfineddomain } { domain -appdomain }:process ptrace; |
| 236 | |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 237 | # Write access to /proc/pid entries for any non-app domain. |
Nick Kralevich | 73c5ea7 | 2013-10-25 16:53:37 -0700 | [diff] [blame] | 238 | neverallow { appdomain -unconfineddomain } { domain -appdomain }:file write; |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 239 | |
| 240 | # signal access to non-app domains. |
| 241 | # sigchld allowed for parent death notification. |
| 242 | # signull allowed for kill(pid, 0) existence test. |
| 243 | # All others prohibited. |
| 244 | neverallow { appdomain -unconfineddomain } { domain -appdomain }:process |
| 245 | { sigkill sigstop signal }; |
| 246 | |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 247 | # Transition to a non-app domain. |
Stephen Smalley | 396015c | 2014-01-07 12:47:10 -0500 | [diff] [blame] | 248 | # Exception for the shell domain, can transition to runas, etc. |
Stephen Smalley | 5708544 | 2013-09-30 08:47:54 -0400 | [diff] [blame] | 249 | neverallow { appdomain -shell -unconfineddomain } ~appdomain:process |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 250 | { transition dyntransition }; |
| 251 | |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 252 | # Write to rootfs. |
| 253 | neverallow { appdomain -unconfineddomain } rootfs:dir_file_class_set |
| 254 | { create write setattr relabelfrom relabelto append unlink link rename }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 255 | |
| 256 | # Write to /system. |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 257 | neverallow { appdomain -unconfineddomain } system_file:dir_file_class_set |
| 258 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 259 | |
| 260 | # Write to entrypoint executables. |
| 261 | neverallow { appdomain -unconfineddomain } exec_type:file |
| 262 | { create write setattr relabelfrom relabelto append unlink link rename }; |
Nick Kralevich | 6634a10 | 2013-07-12 18:45:56 -0700 | [diff] [blame] | 263 | |
| 264 | # Write to system-owned parts of /data. |
| 265 | # This is the default type for anything under /data not otherwise |
| 266 | # specified in file_contexts. Define a different type for portions |
| 267 | # that should be writable by apps. |
| 268 | # Exception for system_app for Settings. |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 269 | neverallow { appdomain -unconfineddomain -system_app } |
| 270 | system_data_file:dir_file_class_set |
| 271 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 272 | |
| 273 | # Write to various other parts of /data. |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 274 | neverallow { appdomain -unconfineddomain } drm_data_file:dir_file_class_set |
| 275 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 276 | neverallow { appdomain -unconfineddomain } gps_data_file:dir_file_class_set |
| 277 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 278 | neverallow { appdomain -platform_app -unconfineddomain } |
| 279 | apk_data_file:dir_file_class_set |
| 280 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 281 | neverallow { appdomain -platform_app -unconfineddomain } |
| 282 | apk_tmp_file:dir_file_class_set |
| 283 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 284 | neverallow { appdomain -platform_app -unconfineddomain } |
| 285 | apk_private_data_file:dir_file_class_set |
| 286 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 287 | neverallow { appdomain -platform_app -unconfineddomain } |
| 288 | apk_private_tmp_file:dir_file_class_set |
| 289 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 290 | neverallow { appdomain -shell -unconfineddomain } |
| 291 | shell_data_file:dir_file_class_set |
Nick Kralevich | 2e7a301 | 2014-01-10 23:05:25 -0800 | [diff] [blame] | 292 | { create setattr relabelfrom relabelto append unlink link rename }; |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 293 | neverallow { appdomain -bluetooth -unconfineddomain } |
| 294 | bluetooth_data_file:dir_file_class_set |
| 295 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 296 | neverallow { appdomain -unconfineddomain } |
| 297 | keystore_data_file:dir_file_class_set |
| 298 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 299 | neverallow { appdomain -unconfineddomain } |
| 300 | systemkeys_data_file:dir_file_class_set |
| 301 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 302 | neverallow { appdomain -unconfineddomain } |
| 303 | wifi_data_file:dir_file_class_set |
| 304 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 305 | neverallow { appdomain -unconfineddomain } |
| 306 | dhcp_data_file:dir_file_class_set |
| 307 | { create write setattr relabelfrom relabelto append unlink link rename }; |
| 308 | |
| 309 | # Access to factory files. |
| 310 | neverallow { appdomain -unconfineddomain } |
| 311 | efs_file:dir_file_class_set { read write }; |
| 312 | |
| 313 | # Write to various pseudo file systems. |
Stephen Smalley | df8af76 | 2014-01-13 09:05:01 -0500 | [diff] [blame] | 314 | neverallow { appdomain -bluetooth -nfc -unconfineddomain } |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 315 | sysfs:dir_file_class_set write; |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 316 | neverallow { appdomain -unconfineddomain } |
| 317 | proc:dir_file_class_set write; |
| 318 | |
| 319 | # Access to syslog(2) or /proc/kmsg. |
Nick Kralevich | 685e2f9 | 2014-05-28 13:48:52 -0700 | [diff] [blame] | 320 | neverallow { appdomain -system_app } |
Nick Kralevich | f821b5a | 2014-05-27 16:49:59 -0700 | [diff] [blame] | 321 | kernel:system { syslog_mod syslog_console }; |
Nick Kralevich | 685e2f9 | 2014-05-28 13:48:52 -0700 | [diff] [blame] | 322 | neverallow { appdomain -system_app -shelldomain } |
Nick Kralevich | f821b5a | 2014-05-27 16:49:59 -0700 | [diff] [blame] | 323 | kernel:system syslog_read; |
Stephen Smalley | 2a273ad | 2013-09-27 10:55:59 -0400 | [diff] [blame] | 324 | |
| 325 | # Ability to perform any filesystem operation other than statfs(2). |
| 326 | # i.e. no mount(2), unmount(2), etc. |
| 327 | neverallow { appdomain -unconfineddomain } fs_type:filesystem ~getattr; |
| 328 | |
| 329 | # Ability to set system properties. |
| 330 | neverallow { appdomain -system_app -radio -shell -bluetooth -unconfineddomain } |
| 331 | property_type:property_service set; |