Commit Graph

67 Commits

Author SHA1 Message Date
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
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
cf8304cadf sec-mod/main: eliminate mem leaks related to vhost transition
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2018-04-14 18:34:12 +02: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
8253cc2920 sec-mod: separated expiration from creation time fields
That allows to set explicit expiration of the cookie, and
ensure that we can close a session in a way that we provide
a limited time window for it to re-open. That handles anyconnect
client compatibility; this client terminates and reconnects
using the original cookie, multiple times.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-11 08:26:43 +01:00
Nikos Mavrogiannopoulos
99b2fdcd06 Reset periodically the server statistics kept
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
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
e474a15598 radius: update the worker's pid on subsequent updates
That is, even if we initially advertize the PID of the worker
handling the client as NAS-Port, the client may eventually end-up
being served by another process. In that case we make sure that
the radius server is notified on the next accounting message.
2016-09-27 09:06:18 +02:00
Nikos Mavrogiannopoulos
e798493d08 sec-mod: perform group checks at auth completion stage
This allows to retrieve allowed groups from radius response.
2016-04-01 15:39:02 +02:00
Nikos Mavrogiannopoulos
c213a8b8fc sec-mod: do not export expired entries to cookies list op
Also combined macro to determine expired entries.
2016-03-07 13:42:46 +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
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
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
40185fe0c2 radius: send user agent information as Connect-Info on accounting start
Relates #26
2016-01-18 11:55:16 +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
9252e22298 Added reference counting to configuration values.
That is, to allow referencing to these values from proc_st
without fearing of them being invalidated on a config reload. We
perform a cleanup of these values on the server periodic check.
2015-12-05 11:08:51 +01:00
Nikos Mavrogiannopoulos
2473633b8d Added cookie key rotation 2015-11-17 08:33:38 +01:00
Nikos Mavrogiannopoulos
037225a6da use nettle's base64 implementation 2015-10-30 14:47:19 +01: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
9797ccee81 when multiple password prompts are sent, utilize a counter to differentiate them 2015-05-19 13:10:26 +02:00
Nikos Mavrogiannopoulos
379716efcd pam: allow passing brief prompt in addition to messages 2015-05-19 10:09:42 +02:00
Nikos Mavrogiannopoulos
33bcfb178e main: use two sockets to communicate with sec-mod
That allows to have a reliable synchronous socket, and
a socket where messages are sent and received asynchronously.
2015-05-13 14:04:22 +02:00
Nikos Mavrogiannopoulos
df5a67b5c7 radius: set NAS_PORT on accounting requests 2015-05-11 14:26:58 +02:00
Nikos Mavrogiannopoulos
18134a87d5 radius: advertise the correct NAS IP in accounting messages 2015-05-11 14:26:42 +02:00
Nikos Mavrogiannopoulos
d1d83d909c sec-mod: eliminated redundant parameters 2015-05-11 14:25:51 +02:00
Nikos Mavrogiannopoulos
41bcc9d0c0 radius: put the process ID into NAS-Port 2015-05-11 14:15:25 +02:00
Nikos Mavrogiannopoulos
f89525ff94 added config option 'persistent-cookies'
When it is set, it doesn't invalidate cookies after
user disconnection.
2015-05-06 20:41:42 +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
7ea22d3aac receive SM_CMD_AUTH_BAN_IP_REPLY asynchronously to prevent race conditions 2015-03-23 11:13:26 +01:00
Nikos Mavrogiannopoulos
cc16a65819 separated permanent configuration options from the reloaded ones 2015-03-02 13:18:52 +01:00
Nikos Mavrogiannopoulos
a617485232 enforce of IP banning was moved to main 2015-02-25 13:16:56 +01:00
Nikos Mavrogiannopoulos
3222cedb99 simplify the communication between main and sec-mod 2015-02-25 10:33:25 +01:00
Nikos Mavrogiannopoulos
40e96aae45 Separated accounting from authentication. 2015-02-23 15:19:44 +01:00
Nikos Mavrogiannopoulos
e7f0b1f947 keep statistics over the lifetime of a session rather than closing and opening the session multiple times 2015-02-22 22:01:47 +01:00
Nikos Mavrogiannopoulos
f1bc754169 add part of the session ID in logs to differentiate them 2015-02-21 17:14:09 +01:00
Nikos Mavrogiannopoulos
2557944bf0 eliminated unneeded variable 2015-02-19 19:29:03 +01:00
Nikos Mavrogiannopoulos
108d34f613 Ban an IP only when the MAX_PASSWORD_TRIES attempts have been exceeded 2015-02-19 11:47:20 +01:00
Nikos Mavrogiannopoulos
bfeab4b015 Additional data are passed only to auth module's global_init 2015-02-19 11:47:20 +01:00
Nikos Mavrogiannopoulos
11f43f144a eliminated auth message upper limit 2015-02-19 11:47:20 +01:00
Nikos Mavrogiannopoulos
8bb0af61bc Added GSSAPI as an additional password auth mechanism
That also adds the ability to support an OR composition of multiple
authentication methods. That is using the 'enable-auth' config option.
2015-02-19 11:47:20 +01:00
Nikos Mavrogiannopoulos
d348caacc2 added seclog_hex 2015-02-12 21:43:40 +01:00
Nikos Mavrogiannopoulos
6c8174668d moved LOG_DEBUG messages to debug level 3 or higher 2015-01-28 11:48:58 +01:00
Nikos Mavrogiannopoulos
414c5d94da harmonize the time cookies are stored in security module and main server 2015-01-25 18:48:49 +01:00
Nikos Mavrogiannopoulos
853f7876cd radius: increase the info sent during accounting requests
Based on suggestions by Niels Peen. That adds:
Calling-Station-Id in auth message, and Service-Type,
Framed-Protocol, Framed-IP-Address, Acct-Authentic,
NAS-Port-Type, Acct-Session-Time in acct messages.
2014-12-14 15:03:59 +01:00
Nikos Mavrogiannopoulos
065753bd57 undid ed5b177691
It is not currently possible to reload only a part of the
configuration. If the back-end module changes, the server will
bail out instead.
2014-12-10 15:28:14 +01:00