Call init_domain() in addition to init_daemon_domain(), this adds permissions needed...
[selinux.git] / tf2 / tf2.te
1 policy_module(tf2, 0.1.28)
2
3 require {
4     type default_t;
5 }
6
7 # File context for the executable process
8 type tf2_t;
9 type tf2_exec_t;
10
11 # File type for writable files
12 type tf2_rw_t;
13 files_type(tf2_rw_t)
14
15 # File type for readable files
16 type tf2_ro_t;
17 files_type(tf2_ro_t)
18
19
20 init_domain(tf2_t, tf2_exec_t)
21 init_daemon_domain(tf2_t, tf2_exec_t)
22
23 allow tf2_t self:process { setsched signal signull };
24 allow tf2_t self:tcp_socket { create_stream_socket_perms connected_stream_socket_perms };
25
26 corenet_udp_sendrecv_generic_port(tf2_t)
27 corenet_udp_bind_generic_port(tf2_t)
28 corenet_udp_bind_generic_node(tf2_t)
29 corenet_tcp_sendrecv_generic_port(tf2_t)
30 corenet_tcp_bind_generic_port(tf2_t)
31 corenet_tcp_bind_generic_node(tf2_t)
32
33 read_files_pattern(tf2_t, tf2_ro_t, tf2_ro_t)
34 read_lnk_files_pattern(tf2_t, tf2_ro_t, tf2_ro_t)
35 list_dirs_pattern(tf2_t, tf2_ro_t, tf2_ro_t)
36 mmap_files_pattern(tf2_t, tf2_ro_t, tf2_ro_t)
37
38 manage_files_pattern(tf2_t, tf2_rw_t, tf2_rw_t)
39 manage_dirs_pattern(tf2_t, tf2_rw_t, tf2_rw_t)
40 setattr_files_pattern(tf2_t, tf2_rw_t, tf2_rw_t)
41
42 sysnet_dns_name_resolve(tf2_t)
43
44 # Needed to load shared libs
45 allow tf2_t tf2_exec_t:file execmod;
46
47 dev_read_urand(tf2_t)
48
49 # TF2 wants to read /proc/cpuinfo
50 kernel_read_system_state(tf2_t)
51 # dev_read_sysfs(tf2_t)
52
53 # TF2 needs to read the network state
54 kernel_read_network_state(tf2_t)
55
56 # There's a lot of noise from these accesses
57 dontaudit tf2_t default_t:dir read;
58
59 allow init_t tf2_t:process { noatsecure };
60 allow tf2_t self:process execmem;