forked from fedora-selinux/selinux-policy-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bacula.te
212 lines (153 loc) · 5.81 KB
/
bacula.te
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
policy_module(bacula, 1.2.0)
########################################
#
# Declarations
#
attribute_role bacula_admin_roles;
type bacula_t;
type bacula_exec_t;
init_daemon_domain(bacula_t, bacula_exec_t)
type bacula_initrc_exec_t;
init_script_file(bacula_initrc_exec_t)
type bacula_etc_t;
files_type(bacula_etc_t)
type bacula_log_t;
logging_log_file(bacula_log_t)
type bacula_spool_t;
files_type(bacula_spool_t)
type bacula_store_t;
files_type(bacula_store_t)
files_mountpoint(bacula_store_t)
type bacula_tmp_t;
files_tmp_file(bacula_tmp_t)
type bacula_var_lib_t;
files_type(bacula_var_lib_t)
type bacula_var_run_t;
files_pid_file(bacula_var_run_t)
type bacula_admin_t;
type bacula_admin_exec_t;
application_domain(bacula_admin_t, bacula_admin_exec_t)
role bacula_admin_roles types bacula_admin_t;
type bacula_unconfined_script_exec_t;
application_executable_file(bacula_unconfined_script_exec_t)
########################################
#
# Local policy
#
allow bacula_t self:capability { dac_read_search chown fowner fsetid setgid setuid};
allow bacula_t self:process signal;
allow bacula_t self:fifo_file rw_fifo_file_perms;
allow bacula_t self:tcp_socket { accept listen };
read_files_pattern(bacula_t, bacula_etc_t, bacula_etc_t)
manage_files_pattern(bacula_t, bacula_tmp_t, bacula_tmp_t)
manage_dirs_pattern(bacula_t, bacula_tmp_t, bacula_tmp_t)
files_tmp_filetrans(bacula_t, bacula_tmp_t, { dir file })
manage_dirs_pattern(bacula_t,bacula_log_t, bacula_log_t)
append_files_pattern(bacula_t, bacula_log_t, bacula_log_t)
create_files_pattern(bacula_t, bacula_log_t, bacula_log_t)
setattr_files_pattern(bacula_t, bacula_log_t, bacula_log_t)
logging_log_filetrans(bacula_t, bacula_log_t, { file dir })
manage_dirs_pattern(bacula_t, bacula_spool_t, bacula_spool_t)
manage_files_pattern(bacula_t, bacula_spool_t, bacula_spool_t)
manage_files_pattern(bacula_t, bacula_store_t, bacula_store_t)
manage_lnk_files_pattern(bacula_t, bacula_store_t, bacula_store_t)
manage_dirs_pattern(bacula_t, bacula_store_t, bacula_store_t)
manage_dirs_pattern(bacula_t, bacula_var_lib_t, bacula_var_lib_t)
manage_files_pattern(bacula_t, bacula_var_lib_t, bacula_var_lib_t)
files_var_lib_filetrans(bacula_t, bacula_var_lib_t, dir)
allow bacula_t bacula_var_run_t:file manage_file_perms;
files_pid_filetrans(bacula_t, bacula_var_run_t, file)
kernel_read_kernel_sysctls(bacula_t)
kernel_read_system_state(bacula_t)
corecmd_exec_bin(bacula_t)
corecmd_exec_shell(bacula_t)
corenet_all_recvfrom_unlabeled(bacula_t)
corenet_all_recvfrom_netlabel(bacula_t)
corenet_tcp_sendrecv_generic_if(bacula_t)
corenet_udp_sendrecv_generic_if(bacula_t)
corenet_tcp_sendrecv_generic_node(bacula_t)
corenet_udp_sendrecv_generic_node(bacula_t)
corenet_tcp_sendrecv_all_ports(bacula_t)
corenet_udp_sendrecv_all_ports(bacula_t)
corenet_tcp_bind_generic_node(bacula_t)
corenet_udp_bind_generic_node(bacula_t)
corenet_sendrecv_generic_server_packets(bacula_t)
corenet_udp_bind_generic_port(bacula_t)
#TODO: check port labels for hplip a bacula
corenet_tcp_bind_bacula_port(bacula_t)
corenet_sendrecv_hplip_server_packets(bacula_t)
corenet_tcp_bind_hplip_port(bacula_t)
corenet_udp_bind_hplip_port(bacula_t)
corenet_sendrecv_all_client_packets(bacula_t)
corenet_tcp_connect_all_ports(bacula_t)
dev_getattr_all_blk_files(bacula_t)
dev_getattr_all_chr_files(bacula_t)
files_getattr_all_pipes(bacula_t)
files_getattr_all_sockets(bacula_t)
files_dontaudit_getattr_all_sockets(bacula_t)
files_dontaudit_getattr_all_pipes(bacula_t)
files_read_all_files(bacula_t)
files_read_all_symlinks(bacula_t)
fs_getattr_xattr_fs(bacula_t)
fs_list_all(bacula_t)
storage_raw_read_fixed_disk(bacula_t)
storage_read_tape(bacula_t)
storage_write_tape(bacula_t)
auth_use_nsswitch(bacula_t)
auth_read_shadow(bacula_t)
logging_send_syslog_msg(bacula_t)
sysnet_dns_name_resolve(bacula_t)
userdom_home_manager(bacula_t)
optional_policy(`
mysql_stream_connect(bacula_t)
mysql_tcp_connect(bacula_t)
')
optional_policy(`
nis_use_ypbind(bacula_t)
')
optional_policy(`
sysnet_use_ldap(bacula_t)
ldap_stream_connect(bacula_t)
')
optional_policy(`
postgresql_tcp_connect(bacula_t)
postgresql_stream_connect(bacula_t)
')
########################################
#
# Client local policy
#
allow bacula_admin_t self:process signal;
allow bacula_admin_t self:tcp_socket { accept listen };
allow bacula_admin_t self:dgram_socket_class_set create_socket_perms;
read_files_pattern(bacula_admin_t, bacula_etc_t, bacula_etc_t)
corenet_all_recvfrom_unlabeled(bacula_admin_t)
corenet_all_recvfrom_netlabel(bacula_admin_t)
corenet_tcp_sendrecv_generic_if(bacula_admin_t)
corenet_tcp_sendrecv_generic_node(bacula_admin_t)
corenet_tcp_sendrecv_all_ports(bacula_admin_t)
corenet_tcp_bind_generic_node(bacula_admin_t)
corenet_sendrecv_hplip_client_packets(bacula_admin_t)
corenet_tcp_connect_hplip_port(bacula_admin_t)
domain_use_interactive_fds(bacula_admin_t)
sysnet_dns_name_resolve(bacula_admin_t)
userdom_dontaudit_search_user_home_dirs(bacula_admin_t)
userdom_use_user_ptys(bacula_admin_t)
########################################
#
# Unconfined script local policy
#
optional_policy(`
type bacula_unconfined_script_t;
domain_type(bacula_unconfined_script_t)
domain_entry_file(bacula_unconfined_script_t, bacula_unconfined_script_exec_t)
role system_r types bacula_unconfined_script_t;
allow bacula_t bacula_unconfined_script_t:process signal_perms;
domtrans_pattern(bacula_t, bacula_unconfined_script_exec_t, bacula_unconfined_script_t)
allow bacula_unconfined_script_t bacula_unconfined_script_exec_t:dir search_dir_perms;
allow bacula_unconfined_script_t bacula_unconfined_script_exec_t:dir read_file_perms;
allow bacula_unconfined_script_t bacula_unconfined_script_exec_t:file ioctl;
optional_policy(`
unconfined_domain(bacula_unconfined_script_t)
')
')