aboutsummaryrefslogtreecommitdiff
path: root/configs/znc-with-net.cfg
blob: 13c5107187abb90bebc20cf0559bdbb57a59ca5e (plain)
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
# Example config for nsjail

name: "znc-with-net"

description: "This policy allows to run znc a jail. "
description: "Networking is permitted with this setup (clone_newnet: false). "
description: ""
description: "The only permitted home directory is $HOME/.znc."
description: ""
description: "Run as: nsjail --config configs/znc-with-net.cfg"

mode: ONCE
hostname: "ZNC"
cwd: "/home/znc"
daemon: true

time_limit: 0

envar: "HOME=/home/znc"
envar: "TMP=/tmp"

log_fd: 2

rlimit_as: 4096
rlimit_cpu_type: INF
rlimit_fsize: 4096
rlimit_nofile: 128

clone_newnet: false

mount {
	dst: "/proc"
	fstype: "proc"
}

mount {
	src: "/lib"
	dst: "/lib"
	is_bind: true
}

mount {
	src: "/usr/lib"
	dst: "/usr/lib"
	is_bind: true
}

mount {
	src: "/lib64"
	dst: "/lib64"
	is_bind: true
	mandatory: false
}

mount {
	src: "/lib32"
	dst: "/lib32"
	is_bind: true
	mandatory: false
}

mount {
	src: "/usr/share"
	dst: "/usr/share"
	is_bind: true
}

mount {
	src: "/dev/urandom"
	dst: "/dev/urandom"
	is_bind: true
	rw: true
}

mount {
	src: "/dev/null"
	dst: "/dev/null"
	is_bind: true
	rw: true
}

mount {
	src: "/etc/resolv.conf"
	dst: "/etc/resolv.conf"
	is_bind: true
	mandatory: false
}

mount {
	src: "/etc/ssl"
	dst: "/etc/ssl"
	is_bind: true
}

mount {
	dst: "/tmp"
	fstype: "tmpfs"
	rw: true
	is_bind: false
}

mount {
	dst: "/dev/shm"
	fstype: "tmpfs"
	rw: true
	is_bind: false
}

mount {
	dst: "/home/znc"
	fstype: "tmpfs"
	rw: true
	is_bind: false
}

mount {
	prefix_src_env: "HOME"
	src: "/.znc"
	dst: "/home/znc/.znc"
	rw: true
	is_bind: true
	mandatory: true
}

seccomp_string: "KILL_PROCESS {"
seccomp_string: "	ptrace,"
seccomp_string: "	process_vm_readv,"
seccomp_string: "	process_vm_writev"
seccomp_string: "}"
seccomp_string: "DEFAULT ALLOW"

exec_bin {
	path: "/usr/bin/znc"
	arg: "-f"
	exec_fd: true
}