Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame] | 1 | # android debug logging, logpersist domains |
| 2 | type logpersist, domain; |
| 3 | |
| 4 | # logcatd is a shell script that execs logcat with various parameters. |
| 5 | allow logpersist shell_exec:file rx_file_perms; |
| 6 | allow logpersist logcat_exec:file rx_file_perms; |
| 7 | |
| 8 | ### |
| 9 | ### Neverallow rules |
| 10 | ### |
| 11 | ### logpersist should NEVER do any of this |
| 12 | |
| 13 | # Block device access. |
| 14 | neverallow logpersist dev_type:blk_file { read write }; |
| 15 | |
| 16 | # ptrace any other app |
| 17 | neverallow logpersist domain:process ptrace; |
| 18 | |
| 19 | # Write to files in /data/data or system files on /data except misc_logd_file |
| 20 | neverallow logpersist { privapp_data_file app_data_file system_data_file }:dir_file_class_set write; |
| 21 | |
| 22 | # Only init should be allowed to enter the logpersist domain via exec() |
| 23 | # Following is a list of debug domains we know that transition to logpersist |
| 24 | # neverallow_with_undefined_domains { |
| 25 | # domain |
| 26 | # -init # goldfish, logcatd, raft |
| 27 | # -mmi # bat, mtp8996, msmcobalt |
| 28 | # -system_app # Smith.apk |
| 29 | # } logpersist:process transition; |
| 30 | neverallow * logpersist:process dyntransition; |