73 Commits

Author SHA1 Message Date
Nikos Mavrogiannopoulos
59400941cf tests: verify that address got by the proxy matches the client
Also measure whether ban points are credited to the right
address for failed attempts.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-08-17 16:14:14 +02:00
Nikos Mavrogiannopoulos
c393d4d7b4 vhost: do not require setting device per vhost
It is not necessary to specify the device config directive on
each virtual host configuration. Ensure that we don't require it
by mistake. This also introduces a traffic test when operating
with virtual hosts.

Resolves: #480

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-07-18 16:32:34 +02:00
Nikos Mavrogiannopoulos
e547733d61 tests: removed legacy tests and added missing ones
Added test-group-cert and test-fork tests that were
present but were never included in the CI test suite.

Removed unix-test which was an obsolete test present
in tests/.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-06-22 12:29:02 +02:00
Nikos Mavrogiannopoulos
1373a11f57 tests: added a test for groups defined over multiple AVPs
This adds a test for the available multi-group options as
well as documentation for the feature. This tests two options:
 * Separate group names in separate class attributes
 * Separate group names in separate class attributes with the OU= format

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2023-06-17 00:25:55 +02:00
Kirill Ovchinnikov
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
8bde99db99 PAM tests: ROOTUID → ROOTGID
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2023-01-05 13:07:05 +01:00
Dimitri Papadopoulos
3eec11bfcd Get rid of deprecated option cookie-validity
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2022-12-24 12:46:53 +01: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
Nikos Mavrogiannopoulos
cd2ad0c66f radiusd.conf: set libdir through autoconf
It should depend on the system tested.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2021-12-22 22:28:06 +01:00
Dimitri Papadopoulos
81df79a95b Typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
2021-10-09 17:57:11 +02:00
fdomain
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
66a263e477 tests: increase the size of a transmitted banner to reproduce #364
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-10-18 13:30:12 +02:00
William Dauchy
80babceacf listen-netns: fix worker case for DTLS
while using udp, we later open a file descriptor for the worker. With a
listen netns config, I overlooked this case which oblige me to move the
struct containing the file descriptor in the main one. Then I can access
them from each worker to make it possible to open the socket in the
correct netns. I also need to keep the netns fd open during the whole
life of the process.

the issue was not visible on a tcp-only case, but while using udp you
can see logs such as:

main[user]: x.x.x.x:54024 bind UDP to 0.0.0.0:443: Cannot assign requested address
worker[user]: x.x.x.x setting up DTLS-PSK connection
main[user]: x.x.x.x:54024 bind UDP to 0.0.0.0:443: Cannot assign requested address

update tests to reflects that:
- instead of creating our own netns, use the one created in common.sh
- we start server in ns1, but listen in ns2, and test client from ns3
  (we don't want to listen in ns1 to test listen-ns)

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
2020-09-20 21:49:08 +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
Nikos Mavrogiannopoulos
6be284dd63 radius: ignore redundant group class
This ignores any items following the first group class attribute.

Resolves: #332

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-09-03 14:35:31 +02:00
Alan Jowett
945699097d Modify ocserv-sm to permit it to scale up to the number of CPUs. This permits a higher rate of client connections and prevents TLS signing from becoming a bottleneck for clients connecting.
Resolves: #341

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-08-26 09:46:04 -06:00
Nikos Mavrogiannopoulos
d0a509c6c3 tests: introduced new proxy protocol tests
This replaces the old no longer used "docker-tests".

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-09 21:32:27 +02:00
Nikos Mavrogiannopoulos
5021c994db tests: always use @ISOLATE_WORKERS@
Now all tests configs are being auto-generated, so this variable
will be replaced.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-09 19:56:37 +02:00
Nikos Mavrogiannopoulos
d84272ffed tests: added test for ping-leases
Resolves: #340

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-09 17:59:04 +02:00
Nikos Mavrogiannopoulos
b2c0c6c1cf tests: replaced explicit ports with random assignment
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-08-09 13:14:22 +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
Nikos Mavrogiannopoulos
8aa39b0106 Improved user disconnection to avoid race conditions
Previously when we were disconnecting a user there were few seconds
after which the cookie was still valid, so a reconnect would succeed
by the same user. This change ensures that a disconnected (via occtl)
user cannot re-use the same cookie to connect. That enables a safe
user removal from the authentication database, and from run-time.

Resolves: #59

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-07-25 21:38:55 +02:00
William Dauchy
f4c7d41d14 add basic namespace support for listen address
- this patch adds `listen-netns` parameter
- when set the listening socket will be created in the given namespace

it allows to properly segregate your traffic:
- do the backend traffic in the root namespace
- receive the VIP traffic in a given namespace

All this patch is widely inspired by haproxy implementation which allows
to bind each IP in a given namespace.

Resolves: #316

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
2020-07-13 18:11:30 +02:00
Nikos Mavrogiannopoulos
95fb96ee32 test-udp-listen-host: added some reliability improvements
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-06-29 12:06:29 +02:00
Nikos Mavrogiannopoulos
1dacbb13a7 tests: added test cases for no-route in group and main configuration
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-05-30 10:38:44 +02:00
Nikos Mavrogiannopoulos
3a8e280a92 translate labels to groups when provided by client
This addresses issues with anyconnect clients which send back the descriptive labels.

Resolves #267

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-05-21 22:24:17 +02:00
Nikos Mavrogiannopoulos
03b05526c3 tests: check whether ipv6 interface is up
Relates: #301

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-05-13 06:16:27 +02:00
Nikos Mavrogiannopoulos
fd2bd42cb2 .gitlab-ci.yml: corrected kerberos tests
This also corrects the kerberos test script environment
to enable running the test.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-04-10 23:06:07 +02:00
Nikos Mavrogiannopoulos
e9251a66e8 tests: test-max-same-1/test-multi-cookie: use update_config
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2020-04-08 19:37:57 +02:00
Nikos Mavrogiannopoulos
689843e874 tests: separate resources in haproxy-connect in test-udp-listen-host
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-04-08 19:25:47 +02:00
Nikos Mavrogiannopoulos
2d9bc11f59 occtl: list actual banned entries
This fixes the ban entries listing from printing all the items in
the database, to all the items that are actually banned from
connecting.

Resolves: #272

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2020-04-03 22:09:14 +02:00
Nikos Mavrogiannopoulos
3544e3ee2b tests: verify environment under Apple clients
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-03-16 22:21:37 +01:00
Nikos Mavrogiannopoulos
65a7fcab67 tests: remove option pointing to non-existant script
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-03-15 13:23:35 +01:00
Nikos Mavrogiannopoulos
5e817d3d60 tests: added test to test match-tls-dtls-ciphers config option
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-03-12 17:01:01 +01:00
Nikos Mavrogiannopoulos
5097604d4d tests: added test for PSK-NEGOTIATE ciphers
Relates: #262

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2020-03-12 13:23:06 +01:00
Alan Jowett
b43e782b12 Add support for RFC6750 bearer tokens to ocserv
This permits the validation of OpenID Connect auth tokens OpenID
Connect is an OAuth 2.0 protocol used to identify a resource owner
(VPN client end-user) to a resource server (VPN server) intermediated
by an Authorization server.

Resolves: #240

Signed-off-by: Alan TG Jowett <alan.jowett@microsoft.com>
2020-03-09 21:48:04 +01:00
Nikos Mavrogiannopoulos
cc651b9de5 Ensure scripts have all the information on all disconnection types
When a client re-uses a cookie and takes over a previous connection
previously the disconnect script of the old connection wouldn't receive
the IP information. Ensure that all information is provided to scripts
at this case.

Resolves: #231

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-23 13:44:19 +01:00
Nikos Mavrogiannopoulos
d852195e64 tests: reproduce #231
This modifies test-pass-script to force a DPD timeout to
verify whether ${IP_REMOTE} is set on the disconnect script.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-19 22:17:31 +01:00
Nikos Mavrogiannopoulos
ebe7c3bfb4 tests: added test to check whether server blocks if script blocks
This test verifies that the server will continue to operate
even if the up script will block indefinitely.

Resolves: #241

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2020-02-07 22:46:21 +01:00
Nikos Mavrogiannopoulos
55d5af2ebc check_multiple_users: do not account disconnected ones
When max-same-clients is set to 1 and a user re-using a cookie
connects, check_multiple_users() would prevent the user from
reconnecting. This corrects the issue by taking into account
only valid sessions that have not yet been disconnected.

Resolves: #223

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-12-16 21:30:24 +01:00
Nikos Mavrogiannopoulos
cfa62cf6b4 Merge branch 'tmp-test-kerberos' into 'master'
tests: added kerberos test case

See merge request openconnect/ocserv!116
2019-12-12 15:29:35 +00:00
Nikos Mavrogiannopoulos
c9e907c841 tests: replaced docker-based kerberos test case with one that runs in CI
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-11-17 14:51:21 +01:00
Nikos Mavrogiannopoulos
ea845a57fc tests: clean-up pam server initiation
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-11-17 11:10:19 +01:00
Nikos Mavrogiannopoulos
4bcf29643d ocserv: added support for per-user split-dns directive
Resolves: #229

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2019-11-17 11:06:47 +01:00
Lele Long
17ed47488d Add udp-listen-host option for DTLS
This option supports different listen addresses for tcp and
udp such as haproxy for tcp, but support dtls at the same time (haproxy
does not support UDP at the moment)
2019-09-30 09:01:55 +08:00
Alexey Dotsenko
0153172c03 tests: add radius otp test
tests (radius-otp): add a check radcli version (atleast 1.2.7), since debian uses version
1.2.6, which does not support Access-Challenge server response.

tests: show debug messages only in VERBOSE mode

tests (radius-otp): replace test for option max_challenge to macro MAX_CHALLENGE

Signed-off-by: Alexey Dotsenko <lex@rwx.su>
2019-06-24 17:25:44 +03:00
Nikos Mavrogiannopoulos
15380220ac tests: rewrite the radius tests using namespaces
This simplifies the test and makes it runnable in our CI.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-06-03 22:47:23 +02:00
Nikos Mavrogiannopoulos
27c83dcf42 tests: consistently disable isolate-workers in tests
That is to prevent coverage reporting in tests.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2019-01-20 06:43:47 +01:00
Nikos Mavrogiannopoulos
b181f20a2e tests: added functionality test for config-per-group
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-11-18 21:06:22 +01:00
Nikos Mavrogiannopoulos
579cfc0ead Added support for AES-256-CBC
This enables support for AES-256 for anyconnect clients which
do not support AES-GCM. Also prioritized the 256-bit ciphers
higher than the 128-bit ones.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-07-20 21:58:49 +02:00