Commit Graph

97 Commits

Author SHA1 Message Date
Alan Jowett
01a9815bdf Set disconnect reason when updating ban-ip
Resolves: #360

Signed-off-by: Alan Jowett alan.jowett@microsoft.com
2020-11-06 13:16:32 -07:00
Alan Jowett
34eab81339 Resolves: #326
Pass the hostname to ocserv-main after receiving the connect request.

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-07-28 13:37:20 -06: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
Alan Jowett
722e030e58 Add reporting of RX latency
Resolve: #258

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-05-26 18:14:36 -06:00
Alan Jowett
ce66485ee6 Uses fork/exec to limit memory footprint of ocserv-worker processes
Capture all the required worker process state in a protobuf and
pass to worker via env. Snapshot all config files to ensure ocserv-sm
and ocserv-worker remain in sync. Split ocserv-worker functionality
into it's own executable with minimal dependencies.

Resolves: #285

Signed-off-by: Alan Jowett alanjo@microsoft.com
2020-05-25 08:33:16 +02:00
Alan Jowett
780fbb89a0 Script needs access to additional client metadata.
Export more information to the script, including client device platform,
type and user agent.

Resolves: #256

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-03-11 09:13:55 +01:00
Alan Jowett
c9662282a1 Prevent tampering of our_ip, ip, session_start_time in SEC_AUTH_INIT from ocserv-worker to ocserv->sm and reject replay of auth_init_messages from old sessions.
Resolves: #252

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2020-02-28 11:20:30 -07: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
Nikos Mavrogiannopoulos
8b0b1e6067 tlslib: added support for gnutls 3.6.3 (unreleased)
That adds support for GNUTLS_PRIVKEY_INFO_PK_ALGO_BITS which is
necessary for RSA-PSS private keys.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-03-10 19:19:07 +01:00
Nikos Mavrogiannopoulos
ba6921ed9a Introduced the notion of virtual hosts
This provides virtualized server configurations which take
effect after client connection when client hello is received.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-03-06 20:42:31 +01:00
Nikos Mavrogiannopoulos
907c34c520 occtl: improved session output
That is, do not print expiration time in sessions that are in use
(they don't expire during that time), and print whether a session
is in use.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-01-07 11:42:09 +01:00
Nikos Mavrogiannopoulos
6cb4b37153 occtl: print cookie expiration time
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-11 08:26:48 +01:00
Nikos Mavrogiannopoulos
20fbbdbcd0 occtl: replaced last_modified time with created
ocserv no longer sends the last modified time, but rather the
cookie creation time.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-11 08:26:48 +01:00
Nikos Mavrogiannopoulos
af2a64df2f ocserv: handle RSA-PSS and ed25519 key types when compiled with gnutls 3.6.0
That is, enhance the security module to accept and understand
more elaborate signing commands.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2017-08-23 12:00:15 +02:00
Nikos Mavrogiannopoulos
d6ff620487 secmod sends periodically stats to main
That ensures that statistics will reach main even if no
users are logged in/logged out.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-04-14 16:39:00 +03:00
Nikos Mavrogiannopoulos
e9cf88f8c2 main: store additional statistics globally
That is, store:
 * number of timed out sessions
 * number of timed out due being idle sessions
 * number of errored sessions
 * total number of session handled (closed)
 * total number of kbytes sent
 * total number of kbytes received
 * minimum MTU seen
 * maximum MTU seen
 * total authentication failures
 * average/max authentication time (in secs)
 * average/max session time (in minutes)

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-04-14 16:39:00 +03:00
Nikos Mavrogiannopoulos
145ba5c14d Explicitly specify the protocol buffers syntax used in .proto files.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-02-12 10:19:02 +01:00
Nikos Mavrogiannopoulos
fdea01f4f5 Do not log the internal session ID nor re-use it in radius
Use instead a value derived from it, to avoid access to the debugging
log files, or radius result to access to the server.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-01-29 15:48:46 +01:00
Nikos Mavrogiannopoulos
5fce6c8c86 Use the X-AnyConnect-Identifier-Platform header to identify mobile clients
That is, if the header contains "android" or "apple-ios" mark it as
a mobile client. The header X-AnyConnect-Identifier-DeviceType is only
considered for logging purposes and appended to the user-agent name
if present.
2016-09-25 15:44:43 +02:00
Nikos Mavrogiannopoulos
0c093ad8f3 ocserv: allow overriding hostname on the per-user configuration
This allows for the administrator to set specific hostnames, or even
empty hostname for specific users.
2016-06-18 11:08:53 +02:00
Nikos Mavrogiannopoulos
3a834fad26 occtl: print the cookie associated with a user on user info
This allows to map existing cookies to connected users.
2016-05-14 20:37:12 +02:00
Nikos Mavrogiannopoulos
e0947340bb ipc: pass the connection status as integer
Conversion to textual form now happens at the client (occtl)
instead of the main server.
2016-03-06 19:07:24 +01:00
Nikos Mavrogiannopoulos
f3338e84f7 Added occtl command to display cookies
This allows to display and examine valid cookies from occtl.
2016-03-06 12:05:36 +01:00
Nikos Mavrogiannopoulos
63d3b98cad use more consistent naming in internal messages 2016-03-05 14:00:50 +01:00
Nikos Mavrogiannopoulos
33a11af1b8 worker: pass received hostname to user via SESSION_INFO msg 2016-03-04 16:52:48 +01:00
Nikos Mavrogiannopoulos
9d144c89a9 Eliminated hostname handling in sec-mod
This value never reached sec-mod as it is only get known
after session is initiated by the client (i.e., after
auth_rep message is received).
2016-03-04 16:47:52 +01:00
Nikos Mavrogiannopoulos
f41b425f23 worker: replaced the timeout-based session forwarding with a validity checking
That checks whether the first packet received in the new session is valid
and if true, accept the new fd. This avoids the mess with validity detection
based on timeouts.
2016-02-23 15:50:39 +01:00
Nikos Mavrogiannopoulos
010257c6a2 Simplified cookie handling
This change set eliminates the need for cryptographically authenticated
cookies and relies on sec-module providing accurate information on
the SID provided by the client.
2016-02-23 15:31:17 +01:00
Nikos Mavrogiannopoulos
6c6481de40 radius: send user agent information as Connect-Info
That allows the radius server to store information on particular
client. Resolves #26
2016-01-16 23:01:10 +01:00
Nikos Mavrogiannopoulos
e1fc1f3c45 TLS session resumption database was moved to sec-mod
This reduces the number of sensitive data available to main process.
Resolves #21
2015-12-07 19:52:30 +01:00
Nikos Mavrogiannopoulos
14d19b3e9a Enhanced configuration option 'restrict-user-to-ports'
This enhancement allows to negate the rules and allow the user connecting
to all ports except the specified.
2015-12-07 11:15:56 +01:00
Nikos Mavrogiannopoulos
eabfbe8473 Added configuration option 'restrict-user-to-ports'
This option is intended to allow restricting users to accessing
specific ports once they enter the VPN. The rules set using this
option will be enforced by the ocserv-fw script.
2015-12-02 10:38:12 +01:00
Nikos Mavrogiannopoulos
cefd77b633 Simplified per-user/group configuration handling
We now use a common structure in SESSION_REPLY and AUTH_REP
messages. That structure is generated by sec-mod and forwarded
by main to worker, thus eliminating the need to create passing
code for each new user-config variable being added.
2015-11-26 18:29:14 +01:00
Nikos Mavrogiannopoulos
f5fca982dc Added configuration option restrict-user-to-routes
This option, if set, will call /usr/bin/ocserv-fw for each user
connecting, i.e., adding firewall restrictions based on its allowed
routes.
2015-11-23 17:31:55 +01:00
Nikos Mavrogiannopoulos
2473633b8d Added cookie key rotation 2015-11-17 08:33:38 +01:00
Nikos Mavrogiannopoulos
65004a55df Added configuration option tunnel-all-dns 2015-11-10 13:50:03 +01:00
Nikos Mavrogiannopoulos
5138a39116 Added a draft design document 2015-11-10 13:49:56 +01:00
Nikos Mavrogiannopoulos
0b8f4beb8b Added user-specific configuration options dpd, mobile-dpd, keepalive, max-same-clients 2015-11-10 13:49:13 +01:00
Nikos Mavrogiannopoulos
40bd1550c1 ipv6: introduced ipv6-subnet-prefix config option
That option allows to specify the IPv6 subnet prefix to be given
to client. That is, allow providing the clients networks larger
than /128. Set the option to 128 to simulate the previous behavior
of ocserv.
2015-10-24 19:26:48 +02:00
Nikos Mavrogiannopoulos
8ae336f2ba worker: notify early main on session info
That allows to pass TLS information early, but more importantly
to pass information on the IP of the client (and our listen IP),
to main, which will be provided in turn to the up and down scripts,
as well as occtl.
2015-08-22 20:13:46 +02:00
Nikos Mavrogiannopoulos
c60a0bce50 Combined password prompt and message
That is because there are clients (anyconnect) which only print
the message but not the prompt.
2015-05-20 10:01:25 +02:00
Nikos Mavrogiannopoulos
0abc1ee2db Allow overriding session-timeout from radius 2015-05-19 15:35:46 +02:00
Nikos Mavrogiannopoulos
9797ccee81 when multiple password prompts are sent, utilize a counter to differentiate them 2015-05-19 13:10:26 +02:00
Nikos Mavrogiannopoulos
2f266e5828 removed deprecated field from auth_reply_msg 2015-05-19 11:33:32 +02:00
Nikos Mavrogiannopoulos
379716efcd pam: allow passing brief prompt in addition to messages 2015-05-19 10:09:42 +02:00
Nikos Mavrogiannopoulos
0ca7389c5d radius: set our IP in the request explicitly 2015-05-11 14:19:47 +02:00
Nikos Mavrogiannopoulos
df4425a7d2 radius: consider Acct-Interim-Interval by default
That can also be overriden by specifying 'override-interim-updates=true'
in the radius subconfig.
2015-05-05 11:24:34 +02:00
Nikos Mavrogiannopoulos
9ed9716e0e radius: send IP address on session start 2015-05-04 19:02:40 +02:00
Nikos Mavrogiannopoulos
6e336431fe radius: distinguish between user disconnect and admin reset of worker process 2015-04-29 11:45:29 +02:00
Nikos Mavrogiannopoulos
02aa9c691e keep track of client entries in sec-mod and report them in status msg 2015-04-26 17:06:16 +02:00