blob: bb7a09191b5316c223f81da7a60678eb0e101d12 [file] [log] [blame]
Primiano Tuccic80f9e02017-12-21 03:51:15 +01001# Perfetto user-space tracing daemon (unprivileged)
2type traced, domain, coredomain;
3type traced_exec, exec_type, file_type;
4
5# Allow init to exec the daemon.
6init_daemon_domain(traced)
7
8# Allow traced to start with a lower scheduling class and change
9# class accordingly to what defined in the config provided by
10# the privileged process that controls it.
11allow traced self:global_capability_class_set { sys_nice };
12
13###
14### Neverallow rules
15###
16### traced should NEVER do any of this
17
18# Disallow mapping executable memory (execstack and exec are already disallowed
19# globally in domain.te).
20neverallow traced self:process execmem;
21
22# Block device access.
23neverallow traced dev_type:blk_file { read write };
24
25# ptrace any other process
26neverallow traced domain:process ptrace;
27
28# Disallows access to /data files, still allowing to write to file descriptors
29# passed through the socket.
30neverallow traced { data_file_type -system_data_file -zoneinfo_data_file }:dir *;
31neverallow traced system_data_file:dir ~{ getattr search };
32neverallow traced zoneinfo_data_file:dir ~r_dir_perms;
33neverallow traced { data_file_type -zoneinfo_data_file }:lnk_file *;
34neverallow traced { data_file_type -zoneinfo_data_file }:file ~write;
35
36# Only init is allowed to enter the traced domain via exec()
37neverallow { domain -init } traced:process transition;
38neverallow * traced:process dyntransition;