1# android debug logging, logpersist domains
2type logpersist, domain;
3
4# logcatd is a shell script that execs logcat with various parameters.
5allow logpersist shell_exec:file rx_file_perms;
6allow 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.
14neverallow logpersist dev_type:blk_file { read write };
15
16# ptrace any other app
17neverallow logpersist domain:process ptrace;
18
19# Write to files in /data/data or system files on /data except misc_logd_file
20neverallow 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;
30neverallow * logpersist:process dyntransition;
31