Integrations/VPN/openconnect-ocserv
AnyConnect protocol · OpenConnect · RADIUS

MFA for OpenConnect (ocserv)

OpenConnect server (ocserv) is the open-source VPN server that speaks the AnyConnect protocol, so users connect with the OpenConnect client or a compatible AnyConnect client. ocserv can check logins against RADIUS through radcli, but it has no second factor of its own. Authnull becomes the RADIUS server ocserv uses and requires MFA on every VPN login. You point radcli at Authnull, switch ocserv to RADIUS authentication, and users must approve a push or enter a code before the tunnel comes up.

At a glance
VendorOpen source
Connects viaRADIUS
ProtectsRemote-access VPN
DeploymentAgentless
Setup time20 minutes
No rip-and-replace — sits in front of your existing setup
How Authnull connects

OpenConnect (ocserv) forwards the login; Authnull adds the factor.

OpenConnect (ocserv)
user connects
Authnull
RADIUS
Directory
AD / LDAP
User device
approve factor

ocserv sends the login to Authnull over RADIUS through radcli. Authnull checks the password against your directory, asks for the factor, and returns Access-Accept. Raise the radcli timeout so users have time to approve.

Setup

Configure MFA for OpenConnect (ocserv)

Real steps — the exact menus, fields, and values. Follow along in your console; the whole thing takes about 20 minutes.

1

Point radcli at Authnull

In the radcli client config, set the Authnull connector as the auth and accounting server and raise the timeout.

radiusclient.conf
authserver 10.0.0.20:1812
acctserver 10.0.0.20:1813
servers /etc/radcli/servers
radius_timeout 60
radius_retries 1
2

Add the shared secret

Add the Authnull connector and the shared secret from the Authnull console to the radcli servers file.

/etc/radcli/servers
10.0.0.20   <shared-secret>
3

Switch ocserv to RADIUS

Set ocserv to authenticate through RADIUS, and optionally send accounting records.

ocserv.conf
auth = "radius[config=/etc/radcli/radiusclient.conf,groupconfig=true]"
acct = "radius[config=/etc/radcli/radiusclient.conf]"
4

Restart and test

Restart ocserv, then connect with the OpenConnect client using a test account. Expect a password prompt, then an MFA challenge. Approving it brings the tunnel up.

shell
systemctl restart ocserv
Reference — connection values
ProtocolRADIUS (radcli)
auth port1812
acct port1813
Timeout60s

Closes the MFA gap auditors look for

Enforcing MFA on OpenConnect (ocserv) gives you evidence for the remote-access and privileged-access controls in SOC 2 and the access requirements under CCPA — with per-login logs you can hand straight to an assessor.

Add MFA to OpenConnect (ocserv) — free to start.

Spin up Authnull, point OpenConnect (ocserv) at it, and enforce a factor on a pilot group today. No card, no rip-and-replace.

Book a demo