Agentless VPN with LDAP-integrated certificate authentication
This is a sample configuration of Agentless VPN that requires users to authenticate using a certificate with LDAP UserPrincipalName checking.
This sample uses Windows 2012R2 Active Directory acting as both the user certificate issuer, the certificate authority, and the LDAP server.
|
|
When configuring an LDAP connection to an Active Directory server, an administrator must provide Active Directory user credentials.
|
Sample topology
Sample configuration
WAN interface is the interface connected to ISP. This example shows static mode. You can also use DHCP or PPPoE mode. The Agentless VPN connection is established over the WAN interface.
In this sample, the User Principal Name is included in the subject name of the issued certificate. This is the user field we use to search LDAP in the connection attempt.
To use the user certificate, you must first install it on the user’s PC. When the user tries to authenticate, the user certificate is checked against the CA certificate to verify that they match.
Every user should have a unique user certificate. This allows you to distinguish each user and revoke a specific user’s certificate, such as if a user no longer has VPN access.
To install the server certificate:
The server certificate is used for authentication and for encrypting Agentless VPN traffic.
-
Go to System > Feature Visibility and ensure Certificates is enabled.
-
Go to System > Certificates and select Import > Local Certificate.
-
Set Type to Certificate.
-
Choose the Certificate file and the Key file for your certificate, and enter the Password.
-
If required, change the Certificate Name.
The server certificate now appears in the list of Certificates.
To install the CA certificate:
The CA certificate is the certificate that signed both the server certificate and the user certificate. In this example, it is used to authenticate Agentless VPN users.
-
Go to System > Certificates and select Import > CA Certificate.
-
Select Local PC and then select the certificate file.
The CA certificate now appears in the list of External CA Certificates. In this example, it is called CA_Cert_1.
To configure Agentless VPN using the GUI:
-
Configure the interface and firewall address. The port1 interface connects to the internal network.
-
Go to Network > Interfaces and edit the wan1 interface.
-
Set IP/Network Mask to 172.20.120.123/255.255.255.0.
-
Edit port1 interface and set IP/Network Mask to 192.168.1.99/255.255.255.0.
-
Click OK.
-
Go to Policy & Objects > Address and create an address for internet subnet 192.168.1.0.
-
-
Configure the LDAP server:
-
Go to User & Authentication > LDAP Servers and click Create New.
-
Specify Name and Server IP/Name.
-
Set Distinguished Name to dc=fortinet-fsso,dc=com.
-
Set Bind Type to Regular.
-
Set Username to cn=admin,ou=testing,dc=fortinet-fsso,dc=com.
-
Set Password.
-
Click OK.
-
-
Configure PKI users and a user group:
To use certificate authentication, use the CLI to create PKI users.
config user peer edit user1 set ca CA_Cert_1 set mfa-server "ldap-AD" set mfa-mode subject-identity next endWhen you have create a PKI user, a new menu is added to the GUI:
-
Go to User & Authentication > PKI to see the new user.
-
Go to User & Authentication > User > User Groups and create a group agentlessvpn-group.
-
Add the PKI peer object you created as a local member of the group.
-
Add a remote group on the LDAP server and select the group of interest.
You need these users to be members using the LDAP browser window.
-
-
Configure Agentless VPN portals.
-
Go to VPN > Agentless VPN Portals, and click Create New.
-
Enter a name, such as agentless-portal.
-
Under Predefined Bookmarks, click Create New, and enter the following details:
Field
Value
Name
Windows Server
Type
RDP
Host
192.168.1.114
Port
3389
Single Sign-On
Disable
Username
Set the username to log in to Windows Server.
Password
Set the password to log in to Windows Server.
Port
3389
-
Click OK to save the predefined bookmark.
-
Click OK to save the portal settings.
-
Create another Agentless VPN portal and name it portal-access-disabled.
-
Click OK to save the portal settings.
-
Disable Agentless VPN for the newly created portal (that is, portal-access-disabled) using CLI:
config vpn ssl web portal edit "portal-access-disabled" set web-mode disable next end
-
-
Configure Agentless VPN settings:
-
Go to VPN > Agentless VPN Settings.
-
Select the Listen on Interface(s), in this example, wan1.
-
Set Listen on Port to 10443.
-
Set Server Certificate to the authentication certificate.
-
In Authentication/Portal Mapping, select All Other Users/Groups, and click Edit.
-
Use Portal dropdown to select portal-access-disabled.
-
Click OK.
-
-
In Authentication/Portal Mapping, click Create New.
-
Set Users/Groups to agentlessvpn-group.
-
Set Portal to agentless-portal.
-
Click OK.
-
-
Click Apply to save the Agentless VPN settings.
-
-
Configure Agentless VPN firewall policy.
-
Go to Policy & Objects > Firewall Policy, and click Create New.
-
Set Name to Agentless VPN firewall policy.
-
Set Schedule to always and Action to Accept.
-
Set Incoming interface to Agentless VPN interface (ssl.root).
-
Choose an Outgoing Interface. This example uses port1.
-
Set the Source to all and User/group to agentlessvpngroup.
-
In this example, the Destination is the internal, protected subnet 192.168.1.0.
-
Set Service to ALL.
-
Click OK.
-
To configure Agentless VPN using the CLI:
-
Configure the interface and firewall address:
config system interface edit "wan1" set vdom "root" set ip 172.20.120.123 255.255.255.0 next end -
Configure internal interface and protected subnet, then connect the port1 interface to the internal network:
config system interface edit "port1" set vdom "root" set ip 192.168.1.99 255.255.255.0 next endconfig firewall address edit "192.168.1.0" set subnet 192.168.1.0 255.255.255.0 next end -
Configure the LDAP server:
config user ldap edit "ldap-AD" set server "172.18.60.206" set cnid "cn" set dn "dc=fortinet-fsso,dc=com" set type regular set username "cn=admin,ou=testing,dc=fortinet-fsso,dc=com" set password ldap-server-password next end -
Configure PKI users and a user group:
config user peer edit user1 set ca CA_Cert_1 set mfa-server "ldap-AD" set mfa-mode subject-identity next endconfig user group edit "agentlessvpn-group" set member "ldap-AD" "user1" config match edit 1 set server-name "ldap-AD" set group-name "CN=group3,OU=Testing,DC=Fortinet-FSSO,DC=COM" next end next end -
Configure Agentless VPN portal and predefine RDP bookmark for windows server.
config vpn ssl web portal edit "agentless-portal" set web-mode enable config bookmark-group edit "gui-bookmarks" config bookmarks edit "Windows Server" set apptype rdp set host "192.168.1.114" set port 3389 set logon-user "your-windows-server-user-name" set logon-password your-windows-server-password next end next end next end -
Configure another Agentless VPN portal and disable Agentless VPN on it.
config vpn ssl web portal edit "portal-access-disabled" set web-mode disable next end -
Configure Agentless VPN settings:
config vpn ssl settings set servercert "server_certificate" set source-interface "wan1" set source-address "all" set default-portal "agentless-portal" config authentication-rule edit 1 set groups "agentlessvpn-group" set portal "agentless-portal" next end end -
Configure one Agentless VPN firewall policy to allow remote user to access the internal network. This policy does not allow traffic initiated from internal network to remote client.
config firewall policy edit 1 set name "Agentless VPN firewall policy" set srcintf "ssl.root" set dstintf "port1" set srcaddr "all" set dstaddr "192.168.1.0" set action accept set schedule "always" set service "ALL" set nat enable set groups "agentlessvpngroup" next end
To see the results of Agentless VPN portal:
-
In a web browser, log into the portal http://172.20.120.123:10443.
A message requests a certificate for authentication.
-
Select the user certificate. It does not require username and password.
You can connect to the Agentless VPN web portal.
To check the Agentless VPN connection using the GUI:
-
On FortiGate, go to Dashboard > Agentless VPN Monitor to verify the list of Agentless VPN users.
If the Agentless VPN Monitor is hidden, click + under the Dashboard, search for Agentless VPN Monitor, and add it to the display.
-
Go to Log & Report > System Events, and use the dropdown to select VPN Events to view VPN logs.
To check the Agentless VPN connection using the CLI:
get vpn ssl monitor Agentless VPN Login Users: Index User Auth Type Timeout From HTTP in/out HTTPS in/out 0 test3 1(1) 229 10.1.100.254 0/0 0/0 Agentless VPN sessions: Index User Source IP Duration I/O Bytes Tunnel/Dest IP
To check the real-time authentication debug logs using the CLI:
Below is a sample output of diagnose debug application fnbamd -1 while the user connects. This is a shortened output sample of a few locations to show the important parts. This sample shows lookups to find the group memberships (three groups total) of the user and that the correct group being found results in a match.
[1148] fnbamd_ldap_recv-Response len: 16, svr: 172.18.60.206 [829] fnbamd_ldap_parse_response-Got one MESSAGE. ID:4, type:search-result [864] fnbamd_ldap_parse_response-ret=0 [1386] __fnbamd_ldap_primary_grp_next-Auth accepted [910] __ldap_rxtx-Change state to 'Done' [843] __ldap_rxtx-state 23(Done) [925] fnbamd_ldap_send-sending 7 bytes to 172.18.60.206 [937] fnbamd_ldap_send-Request is sent. ID 5 [753] __ldap_stop-svr 'ldap-AD' [53] ldap_dn_list_del_all-Del CN=test3,OU=Testing,DC=Fortinet-FSSO,DC=COM [399] ldap_copy_grp_list-copied CN=group3,OU=Testing,DC=Fortinet-FSSO,DC=COM [399] ldap_copy_grp_list-copied CN=Domain Users,CN=Users,DC=Fortinet-FSSO,DC=COM [2088] fnbamd_auth_cert_check-Matching group 'agentlessvpn-group' [2007] __match_ldap_group-Matching server 'ldap-AD' - 'ldap-AD' [2015] __match_ldap_group-Matching group 'CN=group3,OU=Testing,DC=Fortinet-FSSO,DC=COM' - 'CN=group3,OU=Testing,DC=Fortinet-FSSO,DC=COM' [2091] fnbamd_auth_cert_check-Group 'agentlessvpn-group' matched [2120] fnbamd_auth_cert_result-Result for ldap svr[0] 'ldap-AD' is SUCCESS [2126] fnbamd_auth_cert_result-matched user 'test3', matched group 'agentlessvpn-group'
You can also use diagnose firewall auth list to validate that a firewall user entry exists for the Agentless VPN user and is part of the right groups.