1logrotate_selinux(8) SELinux Policy logrotate logrotate_selinux(8)
2
3
4
6 logrotate_selinux - Security Enhanced Linux Policy for the logrotate
7 processes
8
10 Security-Enhanced Linux secures the logrotate processes via flexible
11 mandatory access control.
12
13 The logrotate processes execute with the logrotate_t SELinux type. You
14 can check if you have these processes running by executing the ps com‐
15 mand with the -Z qualifier.
16
17 For example:
18
19 ps -eZ | grep logrotate_t
20
21
22
24 The logrotate_t SELinux type can be entered via the logrotate_exec_t
25 file type.
26
27 The default entrypoint paths for the logrotate_t domain are the follow‐
28 ing:
29
30 /etc/cron.(daily|weekly)/sysklogd, /usr/sbin/logrotate
31
33 SELinux defines process types (domains) for each process running on the
34 system
35
36 You can see the context of a process using the -Z option to ps
37
38 Policy governs the access confined processes have to files. SELinux
39 logrotate policy is very flexible allowing users to setup their logro‐
40 tate processes in as secure a method as possible.
41
42 The following process types are defined for logrotate:
43
44 logrotate_t, logrotate_mail_t
45
46 Note: semanage permissive -a logrotate_t can be used to make the
47 process type logrotate_t permissive. SELinux does not deny access to
48 permissive process types, but the AVC (SELinux denials) messages are
49 still generated.
50
51
53 SELinux policy is customizable based on least access required. logro‐
54 tate policy is extremely flexible and has several booleans that allow
55 you to manipulate the policy and run logrotate with the tightest access
56 possible.
57
58
59
60 If you want to allow logrotate to read logs inside, you must turn on
61 the logrotate_read_inside_containers boolean. Disabled by default.
62
63 setsebool -P logrotate_read_inside_containers 1
64
65
66
67 If you want to allow logrotate to manage nfs files, you must turn on
68 the logrotate_use_nfs boolean. Disabled by default.
69
70 setsebool -P logrotate_use_nfs 1
71
72
73
74 If you want to allow users to resolve user passwd entries directly from
75 ldap rather then using a sssd server, you must turn on the authlo‐
76 gin_nsswitch_use_ldap boolean. Disabled by default.
77
78 setsebool -P authlogin_nsswitch_use_ldap 1
79
80
81
82 If you want to deny any process from ptracing or debugging any other
83 processes, you must turn on the deny_ptrace boolean. Enabled by
84 default.
85
86 setsebool -P deny_ptrace 1
87
88
89
90 If you want to allow any process to mmap any file on system with
91 attribute file_type, you must turn on the domain_can_mmap_files bool‐
92 ean. Enabled by default.
93
94 setsebool -P domain_can_mmap_files 1
95
96
97
98 If you want to allow all domains write to kmsg_device, while kernel is
99 executed with systemd.log_target=kmsg parameter, you must turn on the
100 domain_can_write_kmsg boolean. Disabled by default.
101
102 setsebool -P domain_can_write_kmsg 1
103
104
105
106 If you want to allow all domains to use other domains file descriptors,
107 you must turn on the domain_fd_use boolean. Enabled by default.
108
109 setsebool -P domain_fd_use 1
110
111
112
113 If you want to allow all domains to have the kernel load modules, you
114 must turn on the domain_kernel_load_modules boolean. Disabled by
115 default.
116
117 setsebool -P domain_kernel_load_modules 1
118
119
120
121 If you want to allow all domains to execute in fips_mode, you must turn
122 on the fips_mode boolean. Enabled by default.
123
124 setsebool -P fips_mode 1
125
126
127
128 If you want to enable reading of urandom for all domains, you must turn
129 on the global_ssp boolean. Disabled by default.
130
131 setsebool -P global_ssp 1
132
133
134
135 If you want to allow confined applications to run with kerberos, you
136 must turn on the kerberos_enabled boolean. Enabled by default.
137
138 setsebool -P kerberos_enabled 1
139
140
141
142 If you want to allow system to run with NIS, you must turn on the
143 nis_enabled boolean. Disabled by default.
144
145 setsebool -P nis_enabled 1
146
147
148
149 If you want to allow confined applications to use nscd shared memory,
150 you must turn on the nscd_use_shm boolean. Disabled by default.
151
152 setsebool -P nscd_use_shm 1
153
154
155
156 If you want to support NFS home directories, you must turn on the
157 use_nfs_home_dirs boolean. Disabled by default.
158
159 setsebool -P use_nfs_home_dirs 1
160
161
162
163 If you want to support SAMBA home directories, you must turn on the
164 use_samba_home_dirs boolean. Disabled by default.
165
166 setsebool -P use_samba_home_dirs 1
167
168
169
171 The SELinux process type logrotate_t can manage files labeled with the
172 following file types. The paths listed are the default paths for these
173 file types. Note the processes UID still need to have DAC permissions.
174
175 abrt_var_cache_t
176
177 /var/tmp/abrt(/.*)?
178 /var/cache/abrt(/.*)?
179 /var/spool/abrt(/.*)?
180 /var/spool/debug(/.*)?
181 /var/cache/abrt-di(/.*)?
182 /var/spool/rhsm/debug(/.*)?
183
184 logfile
185
186 all log files
187
188 logrotate_lock_t
189
190
191 logrotate_tmp_t
192
193
194 logrotate_var_lib_t
195
196 /var/lib/logrotate(/.*)?
197 /var/lib/logrotate.status.*
198
199 named_cache_t
200
201 /var/named/data(/.*)?
202 /var/lib/softhsm(/.*)?
203 /var/lib/unbound(/.*)?
204 /var/named/slaves(/.*)?
205 /var/named/dynamic(/.*)?
206 /var/named/chroot/var/tmp(/.*)?
207 /var/named/chroot/var/named/data(/.*)?
208 /var/named/chroot/var/named/slaves(/.*)?
209 /var/named/chroot/var/named/dynamic(/.*)?
210
211 nfs_t
212
213
214 openshift_var_lib_t
215
216 /var/lib/openshift(/.*)?
217 /var/lib/stickshift(/.*)?
218 /var/lib/containers/home(/.*)?
219
220 systemd_passwd_var_run_t
221
222 /var/run/systemd/ask-password(/.*)?
223 /var/run/systemd/ask-password-block(/.*)?
224
225 var_spool_t
226
227 /var/spool(/.*)?
228
229 virt_cache_t
230
231 /var/cache/oz(/.*)?
232 /var/cache/libvirt(/.*)?
233
234
236 SELinux requires files to have an extended attribute to define the file
237 type.
238
239 You can see the context of a file using the -Z option to ls
240
241 Policy governs the access confined processes have to these files.
242 SELinux logrotate policy is very flexible allowing users to setup their
243 logrotate processes in as secure a method as possible.
244
245 EQUIVALENCE DIRECTORIES
246
247
248 logrotate policy stores data with multiple different file context types
249 under the /var/lib/logrotate directory. If you would like to store the
250 data in a different directory you can use the semanage command to cre‐
251 ate an equivalence mapping. If you wanted to store this data under the
252 /srv dirctory you would execute the following command:
253
254 semanage fcontext -a -e /var/lib/logrotate /srv/logrotate
255 restorecon -R -v /srv/logrotate
256
257 STANDARD FILE CONTEXT
258
259 SELinux defines the file context types for the logrotate, if you wanted
260 to store files with these types in a diffent paths, you need to execute
261 the semanage command to sepecify alternate labeling and then use
262 restorecon to put the labels on disk.
263
264 semanage fcontext -a -t logrotate_var_lib_t '/srv/mylogrotate_con‐
265 tent(/.*)?'
266 restorecon -R -v /srv/mylogrotate_content
267
268 Note: SELinux often uses regular expressions to specify labels that
269 match multiple files.
270
271 The following file types are defined for logrotate:
272
273
274
275 logrotate_exec_t
276
277 - Set files with the logrotate_exec_t type, if you want to transition
278 an executable to the logrotate_t domain.
279
280
281 Paths:
282 /etc/cron.(daily|weekly)/sysklogd, /usr/sbin/logrotate
283
284
285 logrotate_lock_t
286
287 - Set files with the logrotate_lock_t type, if you want to treat the
288 files as logrotate lock data, stored under the /var/lock directory
289
290
291
292 logrotate_mail_tmp_t
293
294 - Set files with the logrotate_mail_tmp_t type, if you want to store
295 logrotate mail temporary files in the /tmp directories.
296
297
298
299 logrotate_tmp_t
300
301 - Set files with the logrotate_tmp_t type, if you want to store logro‐
302 tate temporary files in the /tmp directories.
303
304
305
306 logrotate_var_lib_t
307
308 - Set files with the logrotate_var_lib_t type, if you want to store the
309 logrotate files under the /var/lib directory.
310
311
312 Paths:
313 /var/lib/logrotate(/.*)?, /var/lib/logrotate.status.*
314
315
316 Note: File context can be temporarily modified with the chcon command.
317 If you want to permanently change the file context you need to use the
318 semanage fcontext command. This will modify the SELinux labeling data‐
319 base. You will need to use restorecon to apply the labels.
320
321
323 semanage fcontext can also be used to manipulate default file context
324 mappings.
325
326 semanage permissive can also be used to manipulate whether or not a
327 process type is permissive.
328
329 semanage module can also be used to enable/disable/install/remove pol‐
330 icy modules.
331
332 semanage boolean can also be used to manipulate the booleans
333
334
335 system-config-selinux is a GUI tool available to customize SELinux pol‐
336 icy settings.
337
338
340 This manual page was auto-generated using sepolicy manpage .
341
342
344 selinux(8), logrotate(8), semanage(8), restorecon(8), chcon(1), sepol‐
345 icy(8) , setsebool(8), logrotate_mail_selinux(8), logro‐
346 tate_mail_selinux(8)
347
348
349
350logrotate 19-04-25 logrotate_selinux(8)