-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreenginx.toml
78 lines (66 loc) · 1.96 KB
/
freenginx.toml
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
# This is an example of a AppArmor profile. Further configuration is required.
#include <tunables/global>
profile docker-freenginx flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
network inet tcp,
network inet udp,
deny network raw,
deny network packet,
file,
umount,
deny /bin/** rwmlk,
deny /boot/** rwmlk,
deny /dev/** rwmlk,
deny /etc/** wl,
deny /home/** rwmlk,
deny /lib/** wl,
deny /lib64/** rwmlk,
deny /media/** rwmlk,
deny /mnt/** rwmlk,
deny /opt/** rwmlk,
deny /proc/** rwmlk,
deny /root/** rwmlk,
deny /sbin/** rwmlk,
deny /srv/** rwmlk,
deny /sys/** rwmlk,
deny /usr/** wl,
audit /** w,
owner /tmp/freenginx.pid rw,
owner /tmp/freenginx.lock rw,
owner /usr/sbin/freenginx ix,
owner /etc/freenginx/** r,
owner /etc/freenginx/ssl/** r,
owner /var/cache/freenginx/** rw,
owner /tmp/client_temp/** rw,
owner /tmp/proxy_temp_path/** rw,
owner /tmp/fastcgi_temp/** rw,
/etc/timezone r,
/etc/localtime r,
/dev/stderr rw,
/dev/stdout rw,
deny /bin/dash mrwklx,
deny /bin/sh mrwklx,
deny /bin/bash mrwklx,
deny /bin/fish mrwklx,
deny /etc/passwd rw,
deny /etc/sudoers w,
capability,
# deny write for all files directly in /proc (not in a subdir)
deny @{PROC}/* w,
# deny write to files not in /proc/<number>/** or /proc/sys/**
deny @{PROC}/{[^1-9],[^1-9][^0-9],[^1-9s][^0-9y][^0-9s],[^1-9][^0-9][^0-9][^0-9]*}/** w,
deny @{PROC}/sys/[^k]** w, # deny /proc/sys except /proc/sys/k* (effectively /proc/sys/kernel)
deny @{PROC}/sys/kernel/{?,??,[^s][^h][^m]**} w, # deny everything except shm* in /proc/sys/kernel/
deny @{PROC}/sysrq-trigger rwklx,
deny @{PROC}/mem rwklx,
deny @{PROC}/kmem rwklx,
deny @{PROC}/kcore rwklx,
deny mount,
deny /sys/[^f]*/** wklx,
deny /sys/f[^s]*/** wklx,
deny /sys/fs/[^c]*/** wklx,
deny /sys/fs/c[^g]*/** wklx,
deny /sys/fs/cg[^r]*/** wklx,
deny /sys/firmware/** rwklx,
deny /sys/kernel/security/** rwklx,
}