Commit Graph
250 Commits
Author SHA1 Message Date
Grigory Trenin db125634b8 Allow using no-udp option in vhosts
Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-04-14 13:26:32 -04:00
Nikos Mavrogiannopoulos 4a0a087996 config: align default values with sample.config
Several options had hardcoded or named defaults in apply_default_conf()
that diverged from the values documented in doc/sample.config, leading
to silent behaviour differences for servers running without explicit
configuration.

Relates: #680

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-04-14 18:57:45 +02:00
Nikos Mavrogiannopoulos 611eb00527 config: add scope annotations and validation script
Add machine-readable [scope: X] annotations to doc/sample.config and
src/vpn.h struct fields to document which config options are permanent,
global-only, per-vhost, or per-user/group overridable.

Scope vocabulary:
  global (non-reloadable)  -- in perm_cfg_st; requires restart; cannot differ per vhost
  vhost (non-reloadable)   -- in perm_cfg_st; requires restart; can differ per vhost
  global            -- in cfg_st; reloadable; cannot be set in [vhost:] sections
  vhost             -- in cfg_st; reloadable; can differ per vhost
  vhost user        -- in cfg_st; reloadable; also overridable per user/group

Add tests/check-config-scope.py: a script that cross-checks the annotations
against the actual code:
  (a) every option in sample.config has a [scope:] annotation
  (b-c) [global] options match error_on_vhost() calls in config.c
  (d-e) [vhost user] options match handlers in src/sup-config/file.c
  (f) every field in cfg_st and perm_cfg_st has a [scope:] comment

Also fix a pre-existing bug in src/sup-config/file.c: the tunnel-all-dns
option was compared using an underscore ("tunnel_all_dns") instead of
the correct dash ("tunnel-all-dns"), silently ignoring the per-user
setting.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-04-14 18:57:45 +02:00
Nikos Mavrogiannopoulos db50c02cbd Merge branch 'tmp-radius-group-separator' into 'master'
radius: add group-separator option for OU= Class attributes

Closes #428

See merge request openconnect/ocserv!513
2026-04-10 04:29:39 +00:00
Grigory Trenin bf12b9fe9c Fix global option inheritance for virtual hosts
Ensure global options are properly copied to virtual hosts when not
explicitly specified.

This change also:
- Documents global options that cannot be overridden in virtual hosts.
- Adds a 'VIRTUAL HOSTS' section to the man page to clarify behavior.

Closes #698

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-04-09 20:20:45 -04:00
Nikos Mavrogiannopoulos 828fca691e radius: add group-separator option for OU= Class attributes
Freeradius deployments may send groups in the Class attribute using a
comma as separator (e.g. "OU=group1,group2") rather than the semicolon
that ocserv expects by default. Add a group-separator option to the
radius auth configuration to allow this to be changed:

  auth = "radius[config=...,group-separator=comma]"

Accepted values are 'semicolon' (default) and 'comma'. The literal
character is not accepted in the config syntax as it conflicts with the
key=value pair delimiter.

Resolves: #428

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-04-06 21:27:28 +02:00
Nikos Mavrogiannopoulos 598bcf405e Added ocserv-fw for nftables
This also introduces a basic functional test for ocserv-fw.

Resolves: #397

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-03-29 16:55:12 +02:00
Grigory Trenin b080d7dd2b Rename min-reauth-time to ban-time (#676)
Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-23 05:44:05 -05:00
Grigory Trenin 08c321c41a docs: tidy up man pages
- Updated the SYNOPSIS of ocserv(8), occtl(8), and ocpasswd(8)
  to match their --help output
- Corrected usage syntax (eg: '-c config' is optional for ocserv,
  'username' is required for ocpasswd).
- Removed non-standard ':' trailing from options definitions
- Documented missing command-line options: --log-stderr,  --syslog,
  --no-chdir, --traceable
- Added default configuration file paths:
  /etc/ocserv/ocserv.conf, /etc/ocserv/ocpasswd
- Documented USER_AGENT environment variable
- Fixed typos

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
2026-01-10 18:05:02 -05:00
Dimitri Papadopoulos 4a4c341b45 Option listen-host expects a single IP address
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2025-03-02 19:07:22 +01:00
Nikos Mavrogiannopoulos 48d7057fb3 config: auto-select-group made global not per vhost
The group functionality is available globally only and
there is no benefit from this option being per vhost.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2024-04-23 21:35:44 +02:00
Marcin OchabandNikos Mavrogiannopoulos 3f966ae8ca Allow selecting group by URL or profile
This introduces the 'select-group-by-url' config option
that allows selecting an authgroup just by connecting to
a dedicated URI.

Signed-off-by: Marcin Ochab <marcin.ochab@gmail.com>
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2024-04-23 21:35:00 +02:00
Nikos Mavrogiannopoulos 29dba5cee8 web: updated links to web page
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2024-01-05 16:47:18 +01:00
Dimitri Papadopoulos 715b9b2ea1 Use proper symbol for second, prefix for kilo
The SI symbol for second is s:
https://www.bipm.org/en/si-base-units/second

The SI prefix for a multiplying factor of 10³ is k:
https://www.bipm.org/en/measurement-units/si-prefixes

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-12-24 10:40:21 +01:00
Dimitri Papadopoulos 311433b4db Minor typo
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-12-22 15:56:47 +01:00
Nikos Mavrogiannopoulos d504ba832b sample.config: added warning for compression [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-12-19 22:36:33 +01:00
Nikos Mavrogiannopoulos f0067ae0ea Cleanup of the logging subsystem; allow logging to stderr only
Separated the logging logically from any remaining debugging
features. Introduced command line option for logging to stderr
only (for systemd and containers). The default log level is set
to (2) info.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-12-15 13:04:40 +01:00
Nikos Mavrogiannopoulos 86cd25dafb sample.config: further clarify RX and TX meaning [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-12-10 02:11:13 +01:00
Nikos Mavrogiannopoulos d192340484 sample.config: clarified RX and TX meaning [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-12-07 16:06:14 +01:00
Dimitri Papadopoulos Orfanos a711aa4a22 Merge branch 'libexec' into 'master'
bin/ocserv-fw → libexec/ocserv-fw

Closes #78

See merge request openconnect/ocserv!388
2023-12-06 17:51:37 +00:00
Nikos Mavrogiannopoulos 30cf47ad60 sample.config: set default logging priority to 2
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-12-06 16:47:00 +01:00
Dimitri Papadopoulos 8ada82ff5c bin/ocserv-fw → libexec/ocserv-fw
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-11-28 21:57:02 +01:00
Dimitri Papadopoulos b29d915699 Fix misspelling newly reported by codespell
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-09-11 19:18:37 +02:00
Nikos Mavrogiannopoulos 6aad62e266 debug: increased default log-level to debug
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-08-28 20:48:02 +02:00
Nikos Mavrogiannopoulos 70ceee36d6 sample.config: corrected documentation [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-11 14:54:57 +02:00
Nikos Mavrogiannopoulos 9e457abda8 Merge branch 'cisco-ipphone' into 'master'
Add support for Cisco IP-Phone Enterprise firmware VPN

See merge request openconnect/ocserv!356
2023-07-11 12:46:40 +00:00
Gareth Palmer 996d021e1b Add support for Cisco IP-Phone Enterprise firmware VPN client.
The VPN client that comes with the Cisco IP-Phone Enterprise
firmware is based on AnyConnect but was unable to authenticate
with ocserv.

The phone makes an initial GET request and looks for a cookie
named 'webvpn' that has an expiry attribute and a cookie named
'webvpnlogin' containing a non-empty value.

When username+password mode is configured, the phone will then
send a POST request containing those credentials. When using
certificate authentication an empty POST request is sent.

A handler that implements this new behaviour has been added
under the '/svc' path.

To use DTLS 'dtls-legacy' must be enabled and 'udp-port' must
be 443, a new 'cisco-svc-client-compat' option automatically
checks those settings.

New test cases test-pass-svc and test-cert-svc check the above
behaviour.

Older versions of the phone's firmware will fail to create the
DTLS tunnel if the cipher negotiated for HTTPS does not match
that selected for DTLS.

To work-around this either disable DTLS or only allow the
RSA-AES-256-CBC/SHA1 or RSA-AES-128-CBC/SHA1 cipher to be used.

doc/README-cisco-svc.md includes additional information.

Note: 'Enterprise' here is used to differentiate between that
firmware and the MPP (Multi-Platform) firmware which uses the
same hardware.

Signed-off-by: Gareth Palmer <gareth.palmer3@gmail.com>
2023-07-11 22:48:22 +12:00
Nikos Mavrogiannopoulos 52f64c4032 sample.config: added more information on how logging works
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-05 18:37:46 +02:00
Dimitri Papadopoulos d2fef9f08f https://gitlab.com/ocserv/ocserv → openconnect/ocserv
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-06-12 17:25:59 +02:00
Kirill OvchinnikovandNikos Mavrogiannopoulos 85fdf7d2e6 Camouflage functionality
This adds a "camouflage" functionality (looking and acting like an ordinary web server),
to prevent OCserv installations from being automatically scanned or blocked with active probing techniques.

Signed-off-by: Kirill Ovchinnikov <kirill.ovchinn@gmail.com>
2023-06-09 15:08:25 +02:00
Dimitri Papadopoulos f28669bf60 Remove spaces
* Remove trailing spaces at end-of-line
* Remove blank lines at end-of-file

Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2022-11-28 11:22:33 +01:00
Tara MalleshandFeng Xie cfe2ea06d9 Allow HTTP headers to be configurable 2022-07-02 04:02:56 +00:00
Nikos Mavrogiannopoulos 44ec3c60ed sample.config: document the local subnet exemption from ban.
Relates: #441

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2022-02-05 10:20:26 +01:00
Nikos Mavrogiannopoulos 5c79fa24b2 sample.config: removed mentioning of listen-clear-file
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2021-11-20 17:14:35 +01:00
Dimitri Papadopoulos 1dcd78d05f Fix typo found by codespell 2021-11-13 13:17:51 +01:00
Nikos Mavrogiannopoulos 7fc33ad008 sample.config: documented sec-mod-scale
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2021-10-09 18:07:08 +02:00
Dimitri PapadopoulosandNikos Mavrogiannopoulos 81df79a95b Typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2021-10-09 17:57:11 +02:00
Russell YoungandNikos Mavrogiannopoulos 658ffb47df Separated logging level from debug-ability
Modified code to separate logging level from the debug-ability. Added new command line option -x or --traceable to control the pr_dumpable state (default is pr_dumpable false) Added config parameter for controlling the log-level the option is "log-level" it can also be specified on the commandline with -d or --debug.

Signed-off-by: Russell Young <ruyoung@microsoft.com>
2021-05-18 18:38:49 +00:00
fdomainandNikos Mavrogiannopoulos b3fe0d85c2 Added client-bypass-protocol config option
By default, anyconnect clients will drop all traffic of a given IP
version if there is no IP address in that version assigned to the
client. The client-bypass-protocol option, if enabled, will send an
extra header to the clients telling anyconnect client to bypass VPN
tunnel if there is no IP assigned. No impact for openconnect clients,
this header will simply be ignored.

Signed-off-by: Florian Domain <f.domain@criteo.com>
2021-05-18 07:15:43 +00:00
Nikos Mavrogiannopoulos 56f98cbba2 sample.config: document what 'unlimited' means
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-12-12 23:12:10 +01:00
Nikos Mavrogiannopoulos 5cf457b425 Removed the listen-clear-file config option
This option was almost impossible to use in general and worked with
very few clients only (not including openconnect). That also meant that
it could not be tested. Removed to reduce maintenance to parameters
that are used in practice.

Resolves: #376

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-12-03 10:04:57 +01:00
Nikos Mavrogiannopoulos 58c08279bd sample.config: moved server-drain-ms to a more suitable section of the file
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-09-29 21:37:26 +02:00
Yousong Zhou c47911a7d0 Fix typo in comment of sample config
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-09-15 19:14:50 +08:00
Alan Jowett 77dfa36c71 Stop accepting new TCP connections when the server is at maximum active connection capacity.
Add support for gracefully stopping the server.
Add primer on using ocserv with L3 load balancer.

Resolves: #345

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-08-28 16:01:35 -06:00
Nikos Mavrogiannopoulos 44a1357083 Merge branch 'tmp-domain-suffix' into 'master'
sample.config: documented how to specify multiple default domains

Closes #328

See merge request openconnect/ocserv!206
2020-08-10 18:44:07 +00:00
Nikos Mavrogiannopoulos 8f3dd01483 sample.config: disable all legacy TLS versions by default
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-09 18:41:24 +02:00
Nikos Mavrogiannopoulos edbb1e7111 sample.config: documented how to specify multiple default domains
It is possible to specify multiple domains in X-CSTP-Default-Domain for
openconnect clients; make sure that this is documented.

Resolves: #328

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-06 20:57:22 +02:00
Nikos Mavrogiannopoulos 7a7d432d0f use REMOTE_HOSTNAME to pass the user's advertised hostname
The previously used HOSTNAME variable is being overriden by bash and
thus was not a reliable one. We switch to setting REMOTE_HOSTNAME,
but keep the HOSTNAME for compatibility.

This also changes 'test-pass-script' to check for the new variable.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-05 23:05:24 +02:00
Nikos Mavrogiannopoulos 68eccaedf7 sample.config: documented host-update-script and added unit test
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-07-28 20:12:52 +02:00
Nikos Mavrogiannopoulos 9460367822 Added the config option of a pre-login banner
Resolves: #313

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-07-27 22:15:12 +02:00