]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - policy/modules/services/abrt.te
Merge branch 'master' of ssh://git.fedorahosted.org/git/selinux-policy
[people/stevee/selinux-policy.git] / policy / modules / services / abrt.te
CommitLineData
826d0142 1policy_module(abrt, 1.2.0)
e3a90e35
CP
2
3########################################
4#
5# Declarations
6#
7
3eaa9939 8## <desc>
9a0f7994
DG
9## <p>
10## Allow ABRT to modify public files
11## used for public file transfer services.
12## </p>
3eaa9939
DW
13## </desc>
14gen_tunable(abrt_anon_write, false)
15
e3a90e35
CP
16type abrt_t;
17type abrt_exec_t;
18init_daemon_domain(abrt_t, abrt_exec_t)
19
20type abrt_initrc_exec_t;
21init_script_file(abrt_initrc_exec_t)
22
23# etc files
24type abrt_etc_t;
25files_config_file(abrt_etc_t)
26
27# log files
28type abrt_var_log_t;
29logging_log_file(abrt_var_log_t)
30
31# tmp files
32type abrt_tmp_t;
33files_tmp_file(abrt_tmp_t)
34
35# var/cache files
36type abrt_var_cache_t;
37files_type(abrt_var_cache_t)
38
39# pid files
40type abrt_var_run_t;
41files_pid_file(abrt_var_run_t)
42
1b2f08ea
CP
43# type needed to allow all domains
44# to handle /var/cache/abrt
45type abrt_helper_t;
46type abrt_helper_exec_t;
47application_domain(abrt_helper_t, abrt_helper_exec_t)
48role system_r types abrt_helper_t;
49
50ifdef(`enable_mcs',`
51 init_ranged_daemon_domain(abrt_t, abrt_exec_t, s0 - mcs_systemhigh)
52')
53
e3a90e35
CP
54########################################
55#
56# abrt local policy
57#
58
1b2f08ea
CP
59allow abrt_t self:capability { chown kill setuid setgid sys_nice dac_override };
60dontaudit abrt_t self:capability sys_rawio;
3eaa9939 61allow abrt_t self:process { sigkill signal signull setsched getsched };
e3a90e35
CP
62
63allow abrt_t self:fifo_file rw_fifo_file_perms;
64allow abrt_t self:tcp_socket create_stream_socket_perms;
65allow abrt_t self:udp_socket create_socket_perms;
66allow abrt_t self:unix_dgram_socket create_socket_perms;
67allow abrt_t self:netlink_route_socket r_netlink_socket_perms;
68
69# abrt etc files
95985585 70list_dirs_pattern(abrt_t, abrt_etc_t, abrt_etc_t)
e3a90e35
CP
71rw_files_pattern(abrt_t, abrt_etc_t, abrt_etc_t)
72
73# log file
74manage_files_pattern(abrt_t, abrt_var_log_t, abrt_var_log_t)
75logging_log_filetrans(abrt_t, abrt_var_log_t, file)
76
1b2f08ea 77# abrt tmp files
e3a90e35
CP
78manage_dirs_pattern(abrt_t, abrt_tmp_t, abrt_tmp_t)
79manage_files_pattern(abrt_t, abrt_tmp_t, abrt_tmp_t)
80files_tmp_filetrans(abrt_t, abrt_tmp_t, { file dir })
3eaa9939 81can_exec(abrt_t, abrt_tmp_t)
e3a90e35
CP
82
83# abrt var/cache files
84manage_files_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
85manage_dirs_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
1b2f08ea 86manage_lnk_files_pattern(abrt_t, abrt_var_cache_t, abrt_var_cache_t)
e3a90e35 87files_var_filetrans(abrt_t, abrt_var_cache_t, { file dir })
b5212295 88files_spool_filetrans(abrt_t, abrt_var_cache_t, dir)
e3a90e35
CP
89
90# abrt pid files
91manage_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
92manage_dirs_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
b5212295 93manage_sock_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
1b2f08ea 94manage_lnk_files_pattern(abrt_t, abrt_var_run_t, abrt_var_run_t)
3eaa9939 95files_pid_filetrans(abrt_t, abrt_var_run_t, { file dir sock_file })
e3a90e35
CP
96
97kernel_read_ring_buffer(abrt_t)
98kernel_read_system_state(abrt_t)
99kernel_rw_kernel_sysctl(abrt_t)
100
101corecmd_exec_bin(abrt_t)
102corecmd_exec_shell(abrt_t)
1b2f08ea 103corecmd_read_all_executables(abrt_t)
e3a90e35 104
cd173453
DG
105corenet_all_recvfrom_netlabel(abrt_t)
106corenet_all_recvfrom_unlabeled(abrt_t)
cd173453
DG
107corenet_tcp_sendrecv_generic_if(abrt_t)
108corenet_tcp_sendrecv_generic_node(abrt_t)
109corenet_tcp_sendrecv_generic_port(abrt_t)
1b2f08ea
CP
110corenet_tcp_bind_generic_node(abrt_t)
111corenet_tcp_connect_http_port(abrt_t)
112corenet_tcp_connect_ftp_port(abrt_t)
113corenet_tcp_connect_all_ports(abrt_t)
114corenet_sendrecv_http_client_packets(abrt_t)
115
1b2f08ea 116dev_getattr_all_chr_files(abrt_t)
e3a90e35 117dev_read_urand(abrt_t)
1b2f08ea
CP
118dev_rw_sysfs(abrt_t)
119dev_dontaudit_read_raw_memory(abrt_t)
120
121domain_getattr_all_domains(abrt_t)
122domain_read_all_domains_state(abrt_t)
123domain_signull_all_domains(abrt_t)
e3a90e35
CP
124
125files_getattr_all_files(abrt_t)
8effc8a7 126files_read_config_files(abrt_t)
6a074ab5 127files_read_etc_runtime_files(abrt_t)
1b2f08ea
CP
128files_read_var_symlinks(abrt_t)
129files_read_var_lib_files(abrt_t)
e3a90e35 130files_read_usr_files(abrt_t)
1b2f08ea
CP
131files_read_generic_tmp_files(abrt_t)
132files_read_kernel_modules(abrt_t)
133files_dontaudit_list_default(abrt_t)
134files_dontaudit_read_default_files(abrt_t)
3eaa9939
DW
135files_dontaudit_read_all_symlinks(abrt_t)
136files_dontaudit_getattr_all_sockets(abrt_t)
e3a90e35
CP
137
138fs_list_inotifyfs(abrt_t)
139fs_getattr_all_fs(abrt_t)
140fs_getattr_all_dirs(abrt_t)
1b2f08ea
CP
141fs_read_fusefs_files(abrt_t)
142fs_read_noxattr_fs_files(abrt_t)
143fs_read_nfs_files(abrt_t)
144fs_read_nfs_symlinks(abrt_t)
145fs_search_all(abrt_t)
e3a90e35 146
3eaa9939 147sysnet_dns_name_resolve(abrt_t)
e3a90e35
CP
148
149logging_read_generic_logs(abrt_t)
150logging_send_syslog_msg(abrt_t)
151
83406219 152miscfiles_read_generic_certs(abrt_t)
e3a90e35
CP
153miscfiles_read_localization(abrt_t)
154
1b2f08ea 155userdom_dontaudit_read_user_home_content_files(abrt_t)
3eaa9939
DW
156userdom_dontaudit_read_admin_home_files(abrt_t)
157
158tunable_policy(`abrt_anon_write',`
9a0f7994 159 miscfiles_manage_public_files(abrt_t)
3eaa9939
DW
160')
161
162optional_policy(`
163 apache_read_modules(abrt_t)
164')
e3a90e35
CP
165
166optional_policy(`
1b2f08ea 167 dbus_system_domain(abrt_t, abrt_exec_t)
e3a90e35
CP
168')
169
e3a90e35 170optional_policy(`
1b2f08ea
CP
171 nis_use_ypbind(abrt_t)
172')
173
174optional_policy(`
3eaa9939
DW
175 nsplugin_read_rw_files(abrt_t)
176 nsplugin_read_home(abrt_t)
177')
178
179optional_policy(`
9a0f7994 180 policykit_dbus_chat(abrt_t)
1b2f08ea
CP
181 policykit_domtrans_auth(abrt_t)
182 policykit_read_lib(abrt_t)
183 policykit_read_reload(abrt_t)
184')
185
b5212295
CP
186optional_policy(`
187 prelink_exec(abrt_t)
188 libs_exec_ld_so(abrt_t)
189 corecmd_exec_all_executables(abrt_t)
190')
191
1b2f08ea
CP
192# to install debuginfo packages
193optional_policy(`
194 rpm_exec(abrt_t)
195 rpm_dontaudit_manage_db(abrt_t)
196 rpm_manage_cache(abrt_t)
57ce3836 197 rpm_manage_log(abrt_t)
1b2f08ea
CP
198 rpm_manage_pid_files(abrt_t)
199 rpm_read_db(abrt_t)
200 rpm_signull(abrt_t)
e3a90e35
CP
201')
202
203# to run mailx plugin
204optional_policy(`
205 sendmail_domtrans(abrt_t)
206')
1b2f08ea 207
3eaa9939
DW
208optional_policy(`
209 sosreport_domtrans(abrt_t)
210 sosreport_read_tmp_files(abrt_t)
211 sosreport_delete_tmp_files(abrt_t)
212')
213
1b2f08ea
CP
214optional_policy(`
215 sssd_stream_connect(abrt_t)
216')
217
218########################################
219#
9a0f7994 220# abrt-helper local policy
1b2f08ea
CP
221#
222
b5212295 223allow abrt_helper_t self:capability { chown setgid sys_nice };
1b2f08ea
CP
224allow abrt_helper_t self:process signal;
225
226read_files_pattern(abrt_helper_t, abrt_etc_t, abrt_etc_t)
227
b5212295 228files_search_spool(abrt_helper_t)
1b2f08ea
CP
229manage_dirs_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
230manage_files_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
231manage_lnk_files_pattern(abrt_helper_t, abrt_var_cache_t, abrt_var_cache_t)
232files_var_filetrans(abrt_helper_t, abrt_var_cache_t, { file dir })
233
234read_files_pattern(abrt_helper_t, abrt_var_run_t, abrt_var_run_t)
235read_lnk_files_pattern(abrt_helper_t, abrt_var_run_t, abrt_var_run_t)
236
237domain_read_all_domains_state(abrt_helper_t)
238
239files_read_etc_files(abrt_helper_t)
3eaa9939 240files_dontaudit_all_non_security_leaks(abrt_helper_t)
1b2f08ea
CP
241
242fs_list_inotifyfs(abrt_helper_t)
243fs_getattr_all_fs(abrt_helper_t)
244
245auth_use_nsswitch(abrt_helper_t)
246
247logging_send_syslog_msg(abrt_helper_t)
248
249miscfiles_read_localization(abrt_helper_t)
250
251term_dontaudit_use_all_ttys(abrt_helper_t)
252term_dontaudit_use_all_ptys(abrt_helper_t)
253
9a0f7994 254ifdef(`hide_broken_symptoms',`
3eaa9939 255 domain_dontaudit_leaks(abrt_helper_t)
1b2f08ea
CP
256 userdom_dontaudit_read_user_home_content_files(abrt_helper_t)
257 userdom_dontaudit_read_user_tmp_files(abrt_helper_t)
258 dev_dontaudit_read_all_blk_files(abrt_helper_t)
259 dev_dontaudit_read_all_chr_files(abrt_helper_t)
260 dev_dontaudit_write_all_chr_files(abrt_helper_t)
261 dev_dontaudit_write_all_blk_files(abrt_helper_t)
262 fs_dontaudit_rw_anon_inodefs_files(abrt_helper_t)
ef521e99
DG
263
264 optional_policy(`
265 rpm_dontaudit_leaks(abrt_helper_t)
266 ')
1b2f08ea 267')
3eaa9939 268
9a0f7994 269ifdef(`hide_broken_symptoms',`
3eaa9939 270 gen_require(`
9a0f7994 271 attribute domain;
3eaa9939
DW
272 ')
273
9a0f7994 274 allow abrt_t self:capability sys_resource;
3eaa9939
DW
275 allow abrt_t domain:file write;
276 allow abrt_t domain:process setrlimit;
277')