Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 1 | # |
| 2 | # Rules to allow the Android CTS to run. |
| 3 | # Do not enable in production policy. |
| 4 | # |
| 5 | |
| 6 | bool android_cts false; |
| 7 | if (android_cts) { |
Stephen Smalley | 10a2ac2 | 2013-04-04 11:57:44 -0400 | [diff] [blame] | 8 | # For TestDeviceSetup (RootProcessScanner). |
| 9 | # Reads /proc/pid/status and statm entries to check that |
| 10 | # no unexpected root processes are running. |
| 11 | # Also for android.security.cts.VoldExploitTest. |
| 12 | # Requires ability to read /proc/pid/cmdline of vold. |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 13 | allow appdomain domain:dir r_dir_perms; |
| 14 | allow appdomain domain:{ file lnk_file } r_file_perms; |
| 15 | |
| 16 | # Will still fail when trying to read other app /proc/pid |
| 17 | # entries due to MLS constraints. Just silence the denials. |
| 18 | dontaudit appdomain appdomain:dir r_dir_perms; |
| 19 | dontaudit appdomain appdomain:file r_file_perms; |
| 20 | |
Stephen Smalley | 10a2ac2 | 2013-04-04 11:57:44 -0400 | [diff] [blame] | 21 | # For android.permission.cts.FileSystemPermissionTest. |
| 22 | # Walk the file tree, stat any file in order to check file permissions. |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 23 | allow appdomain fs_type:dir r_dir_perms; |
| 24 | allow appdomain dev_type:dir r_dir_perms; |
| 25 | allow appdomain file_type:dir_file_class_set getattr; |
| 26 | allow appdomain dev_type:dir_file_class_set getattr; |
| 27 | allow appdomain fs_type:dir_file_class_set getattr; |
| 28 | |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 29 | # Tries to open /dev/alarm for writing but expects failure. |
| 30 | dontaudit appdomain alarm_device:chr_file write; |
| 31 | |
Stephen Smalley | 10a2ac2 | 2013-04-04 11:57:44 -0400 | [diff] [blame] | 32 | # For android.security.cts.VoldExploitTest. |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 33 | # Tries to create and use a netlink kobject uevent socket |
| 34 | # to test for a vulnerable vold. |
| 35 | dontaudit appdomain self:netlink_kobject_uevent_socket create; |
| 36 | |
| 37 | # Tries to override DAC restrictions but expects to fail. |
| 38 | dontaudit shell self:capability dac_override; |
| 39 | } |