ocserv: updated config
[feed/packages.git] / net / ocserv / files / ocserv.conf.template
1 ############################################################################
2 # NOTE: Do not modify this file to configure ocserv. Add new directives #
3 # in /etc/ocserv/ocserv.conf.local and these will be included in ocserv's #
4 # configuration #
5 ############################################################################
6
7
8 # User authentication method. Could be set multiple times and in that case
9 # all should succeed.
10 # Options: certificate, pam.
11 #auth = "certificate"
12 #auth = "pam"
13
14 # The gid-min option is used by auto-select-group option, in order to
15 # select the minimum group ID.
16 #auth = "pam[gid-min=1000]"
17
18 # The plain option requires specifying a password file which contains
19 # entries of the following format.
20 # "username:groupname:encoded-password"
21 # One entry must be listed per line, and 'ocpasswd' can be used
22 # to generate password entries.
23 auth = "|AUTH|"
24
25 # A banner to be displayed on clients after connection
26 banner = "Welcome to OpenWRT"
27
28 # A banner to be displayed on clients before connection
29 #pre-login-banner = "Welcome"
30
31 #isolate-workers = true
32
33 # When the server has a dynamic DNS address (that may change),
34 # should set that to true to ask the client to resolve again on
35 # reconnects.
36 listen-host-is-dyndns = |DYNDNS|
37
38 # Use listen-host to limit to specific IPs or to the IPs of a provided
39 # hostname.
40 #listen-host = [IP|HOSTNAME]
41
42 # Limit the number of clients. Unset or set to zero for unlimited.
43 #max-clients = 1024
44 max-clients = |MAX_CLIENTS|
45
46 # Rate limit the number of incoming connections to one every X milliseconds
47 # (X is the provided value), as the secmod backlog grows. This
48 # makes the server more resilient (and prevents connection failures) on
49 # multiple concurrent connections. Set to zero for no limit.
50 rate-limit-ms = 100
51
52 # Limit the number of identical clients (i.e., users connecting
53 # multiple times). Unset or set to zero for unlimited.
54 max-same-clients = |MAX_SAME|
55
56 # TCP and UDP port number
57 tcp-port = |PORT|
58 |UDP|udp-port = |UDP_PORT|
59
60 # Stats report time. The number of seconds after which each
61 # worker process will report its usage statistics (number of
62 # bytes transferred etc). This is useful when accounting like
63 # radius is in use.
64 #stats-report-time = 360
65
66 # Stats reset time. The period of time statistics kept by main/sec-mod
67 # processes will be reset. These are the statistics shown by cmd
68 # 'occtl show stats'. For daily: 86400, weekly: 604800
69 # This is unrelated to stats-report-time.
70 server-stats-reset-time = 604800
71
72 # Keepalive in seconds
73 keepalive = 32400
74
75 # Dead peer detection in seconds.
76 dpd = |DPD|
77
78 # Dead peer detection for mobile clients. The needs to
79 # be much higher to prevent such clients being awaken too
80 # often by the DPD messages, and save battery.
81 # (clients that send the X-AnyConnect-Identifier-DeviceType)
82 mobile-dpd = 1800
83
84 # If using DTLS, and no UDP traffic is received for this
85 # many seconds, attempt to send future traffic over the TCP
86 # connection instead, in an attempt to wake up the client
87 # in the case that there is a NAT and the UDP translation
88 # was deleted. If this is unset, do not attempt to use this
89 # recovery mechanism.
90 switch-to-tcp-timeout = 25
91
92 # MTU discovery (DPD must be enabled)
93 try-mtu-discovery = false
94
95 # The key and the certificates of the server
96 # The key may be a file, or any URL supported by GnuTLS (e.g.,
97 # tpmkey:uuid=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx;storage=user
98 # or pkcs11:object=my-vpn-key;object-type=private)
99 #
100 # There may be multiple certificate and key pairs and each key
101 # should correspond to the preceding certificate.
102 server-cert = /etc/ocserv/server-cert.pem
103 server-key = /etc/ocserv/server-key.pem
104
105 # Diffie-Hellman parameters. Only needed if you require support
106 # for the DHE ciphersuites (by default this server supports ECDHE).
107 # Can be generated using:
108 # certtool --generate-dh-params --outfile /path/to/dh.pem
109 #dh-params = /path/to/dh.pem
110
111 # If you have a certificate from a CA that provides an OCSP
112 # service you may provide a fresh OCSP status response within
113 # the TLS handshake. That will prevent the client from connecting
114 # independently on the OCSP server.
115 # You can update this response periodically using:
116 # ocsptool --ask --load-cert=your_cert --load-issuer=your_ca --outfile response
117 # Make sure that you replace the following file in an atomic way.
118 #ocsp-response = /path/to/ocsp.der
119
120 # In case PKCS #11 or TPM keys are used the PINs should be available
121 # in files. The srk-pin-file is applicable to TPM keys only, and is the
122 # storage root key.
123 #pin-file = /path/to/pin.txt
124 #srk-pin-file = /path/to/srkpin.txt
125
126 # The Certificate Authority that will be used to verify
127 # client certificates (public keys) if certificate authentication
128 # is set.
129 #ca-cert = /etc/ocserv/ca.pem
130
131 # The object identifier that will be used to read the user ID in the client
132 # certificate. The object identifier should be part of the certificate's DN
133 # Useful OIDs are:
134 # CN = 2.5.4.3, UID = 0.9.2342.19200300.100.1.1
135 #cert-user-oid = 0.9.2342.19200300.100.1.1
136
137 # The object identifier that will be used to read the user group in the
138 # client certificate. The object identifier should be part of the certificate's
139 # DN. Useful OIDs are:
140 # OU (organizational unit) = 2.5.4.11
141 #cert-group-oid = 2.5.4.11
142
143 # The revocation list of the certificates issued by the 'ca-cert' above.
144 #crl = /etc/ocserv/crl.pem
145
146 # Uncomment this to enable compression negotiation (LZS, LZ4).
147 |COMPRESSION|compression = true
148
149 # GnuTLS priority string
150 tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0"
151
152 # To enforce perfect forward secrecy (PFS) on the main channel.
153 #tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0:-RSA"
154
155 # The time (in seconds) that a client is allowed to stay connected prior
156 # to authentication
157 auth-timeout = 240
158
159 # The time (in seconds) that a client is allowed to stay idle (no traffic)
160 # before being disconnected. Unset to disable.
161 #idle-timeout = 1200
162
163 # The time (in seconds) that a mobile client is allowed to stay idle (no
164 # traffic) before being disconnected. Unset to disable.
165 #mobile-idle-timeout = 2400
166
167 # The time (in seconds) that a client is not allowed to reconnect after
168 # a failed authentication attempt.
169 min-reauth-time = 360
170
171 # Banning clients in ocserv works with a point system. IP addresses
172 # that get a score over that configured number are banned for
173 # min-reauth-time seconds. By default a wrong password attempt is 10 points,
174 # a KKDCP POST is 1 point, and a connection is 1 point. Note that
175 # due to difference processes being involved the count of points
176 # will not be real-time precise.
177 #
178 # Score banning cannot be reliably used when receiving proxied connections
179 # locally from an HTTP server (i.e., when listen-clear-file is used).
180 #
181 # Set to zero to disable.
182 max-ban-score = 80
183
184 # The time (in seconds) that all score kept for a client is reset.
185 ban-reset-time = 1200
186
187 # In case you'd like to change the default points.
188 #ban-points-wrong-password = 10
189 #ban-points-connection = 1
190 #ban-points-kkdcp = 1
191
192 # Cookie timeout (in seconds)
193 # Once a client is authenticated he's provided a cookie with
194 # which he can reconnect. That cookie will be invalidated if not
195 # used within this timeout value. This cookie remains valid, during
196 # the user's connected time, and after user disconnection it
197 # remains active for this amount of time. That setting should allow a
198 # reasonable amount of time for roaming between different networks.
199 cookie-timeout = 300
200
201 # If this is enabled (not recommended) the cookies will stay
202 # valid even after a user manually disconnects, and until they
203 # expire. This may improve roaming with some broken clients.
204 #persistent-cookies = true
205
206 # Whether roaming is allowed, i.e., if true a cookie is
207 # restricted to a single IP address and cannot be re-used
208 # from a different IP.
209 deny-roaming = false
210
211 # ReKey time (in seconds)
212 # ocserv will ask the client to refresh keys periodically once
213 # this amount of seconds is elapsed. Set to zero to disable (note
214 # that, some clients fail if rekey is disabled).
215 rekey-time = 172800
216
217 # ReKey method
218 # Valid options: ssl, new-tunnel
219 # ssl: Will perform an efficient rehandshake on the channel allowing
220 # a seamless connection during rekey.
221 # new-tunnel: Will instruct the client to discard and re-establish the channel.
222 # Use this option only if the connecting clients have issues with the ssl
223 # option.
224 rekey-method = ssl
225
226 # Script to call when a client connects and obtains an IP
227 # Parameters are passed on the environment.
228 # REASON, USERNAME, GROUPNAME, HOSTNAME (the hostname selected by client),
229 # DEVICE, IP_REAL (the real IP of the client), IP_LOCAL (the local IP
230 # in the P-t-P connection), IP_REMOTE (the VPN IP of the client),
231 # ID (a unique numeric ID); REASON may be "connect" or "disconnect".
232
233 # These scripts are not needed if you have setup an interface for all vpns+
234 # devices.
235 #connect-script = /usr/bin/ocserv-script
236 #disconnect-script = /usr/bin/ocserv-script
237
238 # UTMP
239 use-utmp = false
240
241 # Whether to enable support for the occtl tool (i.e., either through D-BUS,
242 # or via a unix socket).
243 use-occtl = true
244
245 # socket file used for IPC with occtl. You only need to set that,
246 # if you use more than a single servers.
247 occtl-socket-file = /var/run/occtl.socket
248
249 # PID file. It can be overriden in the command line.
250 pid-file = /var/run/ocserv.pid
251
252 # The default server directory. Does not require any devices present.
253 chroot-dir = /var/lib/ocserv
254
255 # socket file used for IPC, will be appended with .PID
256 # It must be accessible within the chroot environment (if any)
257 #socket-file = /var/run/ocserv-socket
258 socket-file = ocserv-socket
259
260 # The user the worker processes will be run as. It should be
261 # unique (no other services run as this user).
262 run-as-user = ocserv
263 run-as-group = ocserv
264
265 # Set the protocol-defined priority (SO_PRIORITY) for packets to
266 # be sent. That is a number from 0 to 6 with 0 being the lowest
267 # priority. Alternatively this can be used to set the IP Type-
268 # Of-Service, by setting it to a hexadecimal number (e.g., 0x20).
269 # This can be set per user/group or globally.
270 #net-priority = 3
271
272 # Set the VPN worker process into a specific cgroup. This is Linux
273 # specific and can be set per user/group or globally.
274 #cgroup = "cpuset,cpu:test"
275
276 #
277 # Network settings
278 #
279
280 # The name of the tun device
281 device = vpns
282
283 # Whether the generated IPs will be predictable, i.e., IP stays the
284 # same for the same user when possible.
285 predictable-ips = |PREDICTABLE_IPS|
286
287 # The default domain to be advertised
288 |ENABLE_DEFAULT_DOMAIN|default-domain = |DEFAULT_DOMAIN|
289
290 # The pool of addresses that leases will be given from.
291 ipv4-network = |IPV4ADDR|
292 ipv4-netmask = |NETMASK|
293
294 # The advertized DNS server. Use multiple lines for
295 # multiple servers.
296 # dns = fc00::4be0
297 #dns = 192.168.1.2
298
299 # The NBNS server (if any)
300 #nbns = 192.168.1.3
301
302 # The IPv6 subnet that leases will be given from.
303 |ENABLE_IPV6|ipv6-network = |IPV6ADDR|
304
305 # The domains over which the provided DNS should be used. Use
306 # multiple lines for multiple domains.
307 |ENABLE_SPLIT_DNS|split-dns = |DEFAULT_DOMAIN|
308
309 # Prior to leasing any IP from the pool ping it to verify that
310 # it is not in use by another (unrelated to this server) host.
311 ping-leases = |PING_LEASES|
312
313 # Whether to tunnel all DNS queries via the VPN. This is the default
314 # when a default route is set.
315 #tunnel-all-dns = true
316
317 # Unset to assign the default MTU of the device
318 # mtu =
319
320 # Unset to enable bandwidth restrictions (in bytes/sec). The
321 # setting here is global, but can also be set per user or per group.
322 #rx-data-per-sec = 40000
323 #tx-data-per-sec = 40000
324
325 # The number of packets (of MTU size) that are available in
326 # the output buffer. The default is low to improve latency.
327 # Setting it higher will improve throughput.
328 #output-buffer = 10
329
330 # Routes to be forwarded to the client. If you need the
331 # client to forward routes to the server, you may use the
332 # config-per-user/group or even connect and disconnect scripts.
333 #
334 # To set the server as the default gateway for the client just
335 # comment out all routes from the server.
336 #route = 192.168.1.0/255.255.255.0
337 #route = 192.168.5.0/255.255.255.0
338 #route = fef4:db8:1000:1001::/64
339
340 # Configuration files that will be applied per user connection or
341 # per group. Each file name on these directories must match the username
342 # or the groupname.
343 # The options allowed in the configuration files are dns, nbns,
344 # ipv?-network, ipv4-netmask, ipv6-prefix, rx/tx-per-sec, iroute, route,
345 # net-priority and cgroup.
346 #
347 # Note that the 'iroute' option allows to add routes on the server
348 # based on a user or group. The syntax depends on the input accepted
349 # by the commands route-add-cmd and route-del-cmd (see below).
350
351 config-per-user = /etc/ocserv/config-per-user/
352 config-per-group = /etc/ocserv/config-per-group/
353
354 # When config-per-xxx is specified and there is no group or user that
355 # matches, then utilize the following configuration.
356
357 #default-user-config = /etc/ocserv/defaults/user.conf
358 #default-group-config = /etc/ocserv/defaults/group.conf
359
360 # Groups that a client is allowed to select from.
361 # A client may belong in multiple groups, and in certain use-cases
362 # it is needed to switch between them. For these cases the client can
363 # select prior to authentication. Add multiple entries for multiple groups.
364 #select-group = group1
365 #select-group = group2[My group 2]
366 #select-group = tost[The tost group]
367
368 # The name of the group that if selected it would allow to use
369 # the assigned by default group.
370 #default-select-group = DEFAULT
371
372 # Instead of specifying manually all the allowed groups, you may instruct
373 # ocserv to scan all available groups and include the full list. That
374 # option is only functional on plain authentication.
375 #auto-select-group = true
376
377 # The system command to use to setup a route. %{R} will be replaced with the
378 # route/mask and %{D} with the (tun) device.
379 #
380 # The following example is from linux systems. %{R} should be something
381 # like 192.168.2.0/24
382
383 #route-add-cmd = "/usr/sbin/ip route add %{R} dev %{D}"
384 #route-del-cmd = "/usr/sbin/ip route delete %{R} dev %{D}"
385
386 route-add-cmd = "/sbin/route add -net %{RI} dev %{D}"
387 route-del-cmd = "/sbin/route del -net %{RI} dev %{D}"
388
389 # This option allows to forward a proxy. The special strings '%{U}'
390 # and '%{G}', if present will be replaced by the username and group name.
391 #proxy-url = http://example.com/
392 #proxy-url = http://example.com/%{U}/%{G}/hello
393
394 #
395 # The following options are for (experimental) AnyConnect client
396 # compatibility.
397
398 # Client profile xml. A sample file exists in doc/profile.xml.
399 # This file must be accessible from inside the worker's chroot.
400 # It is not used by the openconnect client.
401 #user-profile = profile.xml
402
403 # Binary files that may be downloaded by the CISCO client. Must
404 # be within any chroot environment.
405 #binary-files = /path/to/binaries
406
407 # Unless set to false it is required for clients to present their
408 # certificate even if they are authenticating via a previously granted
409 # cookie and complete their authentication in the same TCP connection.
410 # Legacy CISCO clients do not do that, and thus this option should be
411 # set for them.
412 cisco-client-compat = |CISCO_COMPAT|
413
414 #Advanced options
415
416 # Option to allow sending arbitrary custom headers to the client after
417 # authentication and prior to VPN tunnel establishment.
418 #custom-header = "X-My-Header: hi there"
419
420 expose-iroutes = true
421
422 # Log Level. Ocserv sends the logging messages to standard error
423 # as well as the system log. The log level can be overridden in the
424 # command line with the -d option. All messages at the configured
425 # level and lower will be displayed.
426 # Supported levels (default 0):
427 # 0 default (Same as basic)
428 # 1 basic
429 # 2 info
430 # 3 debug
431 # 4 http
432 # 8 sensitive
433 # 9 TLS
434 log-level = 3
435
436 # This option will enable the X-CSTP-Client-Bypass-Protocol (disabled by default).
437 # If the server has not configured an IPv6 or IPv4 address pool, enabling this option
438 # will instruct the client to bypass the server for that IP protocol. The option is
439 # currently only understood by Anyconnect clients.
440 client-bypass-protocol = false
441
442 # The following options are related to server camouflage (hidden service)
443
444 # This option allows you to enable the camouflage feature of ocserv that makes it look
445 # like a web server to unauthorized parties.
446 # With "camouflage" enabled, connection to the VPN can be established only if the client provided a specific
447 # "secret string" in the connection URL, e.g. "https://example.com/?mysecretkey",
448 # otherwise the server will return HTTP error for all requests.
449 camouflage = false
450
451 # The URL prefix that should be set on the client (after '?' sign) to pass through the camouflage check,
452 # e.g. in case of 'mysecretkey', the server URL on the client should be like "https://example.com/?mysecretkey".
453 camouflage_secret = "mysecretkey"
454
455 # Defines the realm (browser prompt) for HTTP authentication.
456 # If no realm is set, the server will return 404 Not found error instead of 401 Unauthorized.
457 # Better change it from the default value to avoid fingerprinting.
458 camouflage_realm = "Restricted Content"
459
460 # HTTP headers
461 included-http-headers = Strict-Transport-Security: max-age=31536000 ; includeSubDomains
462 included-http-headers = X-Frame-Options: deny
463 included-http-headers = X-Content-Type-Options: nosniff
464 included-http-headers = Content-Security-Policy: default-src 'none'
465 included-http-headers = X-Permitted-Cross-Domain-Policies: none
466 included-http-headers = Referrer-Policy: no-referrer
467 included-http-headers = Clear-Site-Data: "cache","cookies","storage"
468 included-http-headers = Cross-Origin-Embedder-Policy: require-corp
469 included-http-headers = Cross-Origin-Opener-Policy: same-origin
470 included-http-headers = Cross-Origin-Resource-Policy: same-origin
471 included-http-headers = X-XSS-Protection: 0
472 included-http-headers = Pragma: no-cache
473 included-http-headers = Cache-control: no-store, no-cache