Skip to content

Commit 3e0d12c

Browse files
committed
Update selinux policy
1 parent 53d2cc9 commit 3e0d12c

File tree

3 files changed

+90
-4
lines changed

3 files changed

+90
-4
lines changed

scripts/selinux/nginx_agent.pp

920 Bytes
Binary file not shown.

scripts/selinux/nginx_agent.te

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ require {
6565
type fixed_disk_device_t;
6666
type nvme_device_t;
6767
type udev_var_run_t;
68+
type httpd_var_lib_t;
69+
type unconfined_t;
70+
type unreserved_port_t;
6871
}
6972

7073
allow nginx_agent_t bin_t:file { execute execute_no_trans };
@@ -101,7 +104,7 @@ allow nginx_agent_t httpd_config_t:file { getattr open read };
101104
#!!!! This avc can be allowed using the boolean 'domain_can_mmap_files'
102105
allow nginx_agent_t httpd_exec_t:file map;
103106
allow nginx_agent_t httpd_exec_t:file { execute execute_no_trans getattr open read };
104-
allow nginx_agent_t httpd_log_t:dir { getattr open read search };
107+
allow nginx_agent_t httpd_log_t:dir { watch getattr open read search };
105108
allow nginx_agent_t passwd_file_t:file { getattr open read };
106109
allow nginx_agent_t self:capability dac_read_search;
107110

@@ -124,7 +127,7 @@ allow nginx_agent_t httpd_log_t:file { open read };
124127
allow nginx_agent_t httpd_t:process signal;
125128
allow nginx_agent_t httpd_var_run_t:file { open read write };
126129
allow nginx_agent_t self:capability { dac_override net_bind_service };
127-
allow nginx_agent_t cert_t:dir { search open read };
130+
allow nginx_agent_t cert_t:dir { getattr search open read };
128131
allow nginx_agent_t cert_t:lnk_file read;
129132

130133

@@ -149,8 +152,15 @@ allow nginx_agent_t self:udp_socket { connect create getattr setopt };
149152
allow nginx_agent_t fixed_disk_device_t:blk_file getattr;
150153
allow nginx_agent_t nvme_device_t:blk_file getattr;
151154
allow nginx_agent_t udev_var_run_t:dir search;
152-
allow nginx_agent_t udev_var_run_t:file { getattr open read };
155+
allow nginx_agent_t udev_var_run_t:file { getattr open read write };
153156

154157
allow nginx_agent_t etc_t:dir { add_name write };
155158
allow nginx_agent_t etc_t:file { create write };
156159

160+
allow nginx_agent_t httpd_var_lib_t:dir { getattr search };
161+
allow nginx_agent_t unconfined_t:process signal;
162+
allow nginx_agent_t unreserved_port_t:tcp_socket name_bind;
163+
allow nginx_agent_t self:cap_userns sys_ptrace;
164+
allow nginx_agent_t usr_t:dir watch;
165+
allow nginx_agent_t var_log_t:file { open write };
166+
allow nginx_agent_t var_run_t:file { open read write };

scripts/selinux/nginx_agent_selinux.8

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "nginx_agent_selinux" "8" "25-03-13" "nginx_agent" "SELinux Policy nginx_agent"
1+
.TH "nginx_agent_selinux" "8" "25-03-21" "nginx_agent" "SELinux Policy nginx_agent"
22
.SH "NAME"
33
nginx_agent_selinux \- Security Enhanced Linux Policy for the nginx_agent processes
44
.SH "DESCRIPTION"
@@ -243,6 +243,22 @@ The SELinux process type nginx_agent_t can manage files labeled with the followi
243243
/var/tmp/vi\.recover
244244
.br
245245

246+
.br
247+
.B udev_var_run_t
248+
249+
/dev/\.udev(/.*)?
250+
.br
251+
/var/run/udev(/.*)?
252+
.br
253+
/var/run/libgpod(/.*)?
254+
.br
255+
/var/run/PackageKit/udev(/.*)?
256+
.br
257+
/dev/\.udevdb
258+
.br
259+
/dev/udev\.tbl
260+
.br
261+
246262
.br
247263
.B var_lib_t
248264

@@ -251,6 +267,66 @@ The SELinux process type nginx_agent_t can manage files labeled with the followi
251267
/var/lib(/.*)?
252268
.br
253269

270+
.br
271+
.B var_log_t
272+
273+
/var/log/.*
274+
.br
275+
/nsr/logs(/.*)?
276+
.br
277+
/var/webmin(/.*)?
278+
.br
279+
/var/log/secure[^/]*
280+
.br
281+
/opt/zimbra/log(/.*)?
282+
.br
283+
/var/log/maillog[^/]*
284+
.br
285+
/var/log/spooler[^/]*
286+
.br
287+
/var/log/messages[^/]*
288+
.br
289+
/usr/centreon/log(/.*)?
290+
.br
291+
/var/spool/rsyslog(/.*)?
292+
.br
293+
/var/axfrdns/log/main(/.*)?
294+
.br
295+
/var/spool/bacula/log(/.*)?
296+
.br
297+
/var/tinydns/log/main(/.*)?
298+
.br
299+
/var/dnscache/log/main(/.*)?
300+
.br
301+
/var/stockmaniac/templates_cache(/.*)?
302+
.br
303+
/opt/Symantec/scspagent/IDS/system(/.*)?
304+
.br
305+
/var/log
306+
.br
307+
/var/log/dmesg
308+
.br
309+
/var/log/syslog
310+
.br
311+
/var/named/chroot/var/log
312+
.br
313+
314+
.br
315+
.B var_run_t
316+
317+
/run/.*
318+
.br
319+
/var/run/.*
320+
.br
321+
/run
322+
.br
323+
/var/run
324+
.br
325+
/var/run
326+
.br
327+
/var/spool/postfix/pid
328+
.br
329+
254330
.SH FILE CONTEXTS
255331
SELinux requires files to have an extended attribute to define the file type.
256332
.PP

0 commit comments

Comments
 (0)