SSO using RADIUS accounting records
A FortiGate unit can authenticate users transparently who have already authenticated on an external RADIUS server. Based on the user group to which the user belongs, the security policy applies the appropriate UTM profiles. RADIUS SSO is relatively simple because the FortiGate unit does not interact with the RADIUS server, it only monitors RADIUS accounting records that the server emits. These records include the user’s IP address and user group.
After the initial set-up, changes to the user database, including changes to user group memberships, are made on the external RADIUS server, not on the FortiGate unit.
This section describes:
- User’s view of RADIUS SSO authentication
- Configuration Overview
- Configuring the RADIUS server
- Creating the FortiGate RADIUS SSO agent
- Defining local user groups for RADIUS SSO
- Creating security policies
- Example: webfiltering for student and teacher accounts
User’s view of RADIUS SSO authentication
For the user, RADIUS SSO authentication is simple:
- The user connects to the RADIUS server and authenticates.
- The user attempts to connect to a network resource that is reached through a FortiGate unit. Authentication is required for access, but the user connects to the destination without being asked for logon credentials because the FortiGate unit knows that the user is already authenticated. FortiOS applies UTM features appropriate to the user groups that the user belongs to.
Configuration Overview
The general steps to implement RADIUS Single Sign-On are:
- If necessary, configure your RADIUS server. The user database needs to include user group information and the server needs to send accounting messages.
- Create the FortiGate RADIUS SSO agent.
- Define local user groups that map to RADIUS groups.
- Create a security policy which specifies the user groups that are permitted access.
Configuring the RADIUS server
You can configure FortiGate RSSO to work with most RADIUS-based accounting systems. In most cases, you only need to do the following to your RADIUS accounting system:
- Add a user group name field to customer accounts on the RADIUS server so that the name is added to the RADIUS Start record sent by the accounting system to the FortiOS unit. User group names do not need to be added for all users, only to the accounts of users who will use RSSO feature on the FortiGate unit.
- Configure your accounting system to send RADIUS Start records to the FortiOS unit. You can send the RADIUS Start records to any FortiGate network interface. If your FortiGate unit is operating with virtual domains (VDOMs) enabled, the RADIUS Start records must be sent to a network interface in the management VDOM.
Creating the FortiGate RADIUS SSO agent
Once you define a RADIUS SSO (RSSO) agent, the FortiGate unit will accept user logon information from any RADIUS server that has the same shared secret. You can create only one RSSO agent in each VDOM.
Before you create the RSSO agent, you need to allow RADIUS accounting information on the interface that connects to the RADIUS server.
To enable RADIUS access on the interface - web-based manager:
- Go to System > Network > Interfaces and edit the interface to which the RADIUS server connected.
- Select Listen for RADIUS Accounting Messages.
- Select OK.
To enable RADIUS access on the interface - CLI:
In this example, the port2 interface is used.
config system interface
edit port2
set allowaccess radius-acct
end
To create a RADIUS SSO agent:
- Go to User & Device > Authentication > Single Sign-On and select Create New.
- In Type, select RADIUS Single-Sign-On Agent.
- Select Use RADIUS Shared Secret and enter the RADIUS server shared secret.
- Select Send RADIUS Responses.
- Select OK.
To create a RADIUS SSO agent - CLI
config user radius
edit RSSO_Agent
set rsso enable
set rsso-validate-request-secret enable
set rsso-secret <your secret>
set rsso-radius-response enable
end
Selecting which RADIUS attributes are used for RSSO
For RADIUS SSO to work, FortiOS needs to know the user’s endpoint identifier (usually IP address) and RADIUS user group. There are default RADIUS attributes where FortiOS expects this information, but you can change these attributes in the config user radius
CLI command.
RSSO information and RADIUS attribute defaults
RSSO Information | RADIUS Attribute | CLI field |
---|---|---|
Endpoint identifier | Calling-Station-ID | rsso-endpoint-attribute
|
Endpoint block attribute | Called-Station-ID | rsso-endpoint-block-attribute
|
User group | Class | sso-attribute
|
The Endpoint block attribute can be used to block or allow a user. If the attribute value is set to the name of an attribute that indicates whether to block or allow, FortiOS blocks or allows respectively all traffic from that user’s IP address. The RSSO fields are visible only when rsso
is set to enable
.
Configuring logging for RSSO
In the config user radius
CLI command, you can set the following flags in the rsso-log-flags
field to determine which types of RSSO-related events are logged:
protocol-error
— A RADIUS protocol error occurred.profile-missing
— FortiOS cannot find a user group name in a RADIUS start message that matches the name of an RSSO user group in FortiOS.accounting-stop-missed
— a user context entry expired without FortiOS receiving a RADIUS Stop message.accounting-event
— FortiOS did not find the expected information in a RADIUS record.endpoint-block
— FortiOS blocked a user because the RADIUS record’s endpoint block attribute had the value “Block”.- radiusd-other — Other events, described in the log message.
Defining local user groups for RADIUS SSO
You cannot use RADIUS user groups directly in security policies. Instead, you create locally-defined user groups on the FortiGate unit and associate each of them with a RADIUS user group.
To define local user groups for RADIUS SSO:
- Go to User & Device > User > User Groups and select Create New.
- Enter a Name for the user group.
- In Type, select RADIUS Single Sign-On (RSSO).
- In RADIUS Attribute Value, enter the name of the RADIUS user group this local user group represents.
- Select OK.
To define local user groups for RADIUS SSO:
This example creates an RSSO user group called RSSO-1 that is associated with RADIUS user group “student”.
config user group
edit RSSO-1
set group-type rsso
set sso-attribute-value student
end
Creating security policies
RADIUS SSO uses regular identity-based security policies. The RSSO user group you specify determines which users are permitted to use the policy. You can create multiple policies if user groups can have different UTM features enabled, different permitted services, schedules, and so on.
To create a security policy for RSSO - web-based manager:
- Go to Policy & Objects > Policy > IPv4.
- Select Create New.
- Enter the following information.
Incoming Interface | as needed |
Source Address | as needed |
Source User(s) | Select the user groups you created for RSSO. See Defining local user groups for RADIUS SSO. |
Outgoing Interface | as needed |
Destination Address | all |
Schedule | as needed |
Service | as needed |
Action | ACCEPT |
Enable NAT | Selected |
Security Profiles | Select security profiles appropriate for the user group. |
- Select OK.
To ensure an RSSO-related policy is matched first, the policy should be placed higher in the security policy list than more general policies for the same interfaces. - Select OK.
To create a security policy for RSSO - CLI:
In this example, an internal network to Internet policy enables web access for members of a student group and activates the appropriate UTM profiles.
config firewall policy
edit 0
set srcintf internal
set dstintf wan1
set srcaddr all
set dstaddr "all"
set action accept
set rsso enable
set groups "RSSO-student"
set schedule always
set service HTTP HTTPS
set nat enable
set utm-status enable
set av-profile students
set webfilter-profile students
set spamfilter-profile students
set dlp-sensor default
set ips-sensor default
set application-list students
set profile-protocol-options "default"
end
Example: webfiltering for student and teacher accounts
The following example uses RADIUS SSO to apply web filtering to students, but not to teachers. Assume that the RADIUS server is already configured to send RADIUS Start and Stop records to the FortiGate unit. There are two RADIUS user groups, students and teachers, recorded in the default attribute Class. The workstations are connected to port1, port2 connects to the RADIUS server, and port3 connects to the Internet.
Configure the student web filter profile:
- Go to Security Profiles > Web Filter and select Create New (the “+” button).
- Enter the following and select OK.
Name | student |
Inspection Mode | Proxy |
FortiGuard Categories | Enable. Right-click the Potentially Liable category and select Block. Repeat for Adult/Mature Content and Security Risk. |
Create the RADIUS SSO agent:
- Go to User & Device > Authentication > Single Sign-On and select Create New.
- In Type, select RADIUS Single-Sign-On.
- Select Use RADIUS Shared Secret and enter the RADIUS server shared secret.
- Select Send RADIUS Responses.
- Select OK.
Define local user groups associated with the RADIUS SSO user groups:
- Go to User & Device > User > User Groups and select Create New.
- Enter the following and select OK.
Name | RSSO-students |
Type | RADIUS Single Sign-On (RSSO) |
RADIUS Attribute Value | students |
- Select Create New, enter the following and select OK.
Name | RSSO-teachers |
Type | RADIUS Single Sign-On (RSSO) |
RADIUS Attribute Value | teachers |
Create a security policy for students:
- Go to Policy & Objects > Policy > IPv4 and select Create New.
- Enter
Incoming Interface | port1 |
Source Address | all |
Source User(s) | RSSO-students |
Source Device Type | All |
Outgoing Interface | port3 |
Destination Address | all |
Schedule | always |
Service | HTTP, HTTPS |
Action | ACCEPT |
NAT | ON |
Security Profiles | Enable AntiVirus, Web Filter, IPS. In Web Filter, select the student profile. |
- Select OK.
Create a security policy for teachers:
- Go to Policy & Objects > Policy > IPv4 and select Create New.
- Enter
Incoming Interface | port2 |
Source Address | all |
Source User(s) | RSSO-teachers |
Source Device Type | All |
Outgoing Interface | port3 |
Destination Address | all |
Schedule | always |
Service | ALL |
Action | ACCEPT |
NAT | ON |
Security Profiles | Enable AntiVirus and IPS. |
- Select OK.