Security

 View Only
Expand all | Collapse all

CLEARPASS ACTIVE SESSION LIMIT

This thread has been viewed 93 times
  • 1.  CLEARPASS ACTIVE SESSION LIMIT

    Posted Nov 21, 2024 07:23 AM
    Edited by ajorigenes17 Nov 21, 2024 07:24 AM

    Good Day,

    We have implemented 802.1X authentication at our university to manage network access for over 1,200 users daily. Recently, the client requested limiting active user sessions to a maximum of three devices per user.

    Initially, we configured the enforcement policy using unique device counts, which worked as expected. However, we encountered an issue: if a user's device employs randomized MAC addresses, we must either remove these entries from the endpoint repository or manually use the actual MAC address of the device. This process occurs frequently and has become a challenge.

    To address this, we shifted to using an active session count approach, which limits users to three active sessions. While this works as intended-rejecting new sessions if a user already has three active sessions-we have observed a recurring issue. Some users are being rejected by the network due to the active session limit, even when they are only using a single device or have just one active session recorded in the controller.

    After extensive testing and analysis, we discovered that this issue occurs when a user roams between access points (APs), such as moving to a different room. The device re-authenticates with ClearPass, and this is counted as a new session, even though it's the same device with the same MAC address.

    My questions are:

    1. How can we prevent this issue from occurring?
    2. How does the active session count feature actually work?



  • 2.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Nov 21, 2024 09:51 AM

    You can see this by looking at the query for the filter.

    SELECT COUNT(*) AS active_count FROM radius_acct WHERE (username = '%{Authentication:Username}' OR calling_station_id = '%{Connection:Client-Mac-Address-NoDelim}') AND start_time >=  NOW() - INTERVAL '2 day' AND  end_time is NULL;

    The query counts all currently active sessions associated with the username or the active MAC address.

    To prevent what you are seeing you would want to create a new filter with a query that only counts the current username + MAC address combination once.  Or you could look at enabling 802.11r to prevent the full reauthentication on roam.



    ------------------------------
    Carson Hulcher, ACEX#110
    ------------------------------



  • 3.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Nov 21, 2024 11:11 AM

    Do you have that query so I can test it. With session limit in insight repository




  • 4.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Nov 21, 2024 11:17 AM

    And also what is the purpose of this query?

     AND start_time >=  NOW() - INTERVAL '2 day' AND  end_time is NULL;




  • 5.  RE: CLEARPASS ACTIVE SESSION LIMIT
    Best Answer

    Posted Nov 21, 2024 11:45 AM

    Counts all active sessions that show activity within the last two days.

    My version of the query looks at the last updated column and counts all sessions that aren't the current.

    ******
    [Insight Repository]
    +++++++++++++
    ARUBA VERSION
    New filter "Custom-ConcurrentSessions-PreAuth-User" to find concurrent sessions currently active through interim accounting updates
    To be used in role mappings for Application/WebAuth where %{Authentication:Username} will exist
    SELECT count(distinct calling_station_id) as active_sessions
    FROM radius_acct
    WHERE end_time IS null
    AND username = '%{Authentication:Username}'
    AND LEFT(ssid,LENGTH('%{Application:WebLoginURL:essid}')) = '%{Application:WebLoginURL:essid}'
    AND updated_at > now() - interval '12 minutes'
    - active_sessions: ActiveSessions-PreAuth-User, Integer
    ******
    [Insight Repository]
    +++++++++++++
    ARUBA VERSION
    New filter "Custom-ConcurrentSessions-User" to find concurrent sessions currently active through interim accounting updates
    To be used in role mappings where %{Authentication:Username} will exist
    SELECT count(distinct calling_station_id) as active_sessions
    FROM radius_acct
    WHERE end_time IS null
    AND username = '%{Authentication:Username}'
    AND ssid = '%{Connection:SSID}'
    AND calling_station_id != '%{Connection:Client-Mac-Address-NoDelim}'
    AND updated_at > now() - interval '12 minutes'
    - active_sessions: ActiveSessions-User, Integer
    ******
    [Insight Repository]
    +++++++++++++
    ARUBA VERSION
    New filter "Custom-ConcurrentSessions-Endpoint" to find concurrent sessions currently active through interim accounting updates
    To be used in role mappings where %{Endpoint:Username} will exist
    SELECT count(distinct calling_station_id) as active_sessions
    FROM radius_acct
    WHERE end_time IS null
    AND username = '%{Endpoint:Username}'
    AND ssid = '%{Connection:SSID}'
    AND calling_station_id != '%{Connection:Client-Mac-Address-NoDelim}'
    AND updated_at > now() - interval '12 minutes'
    - active_sessions: ActiveSessions-Endpoint, Integer



    ------------------------------
    Carson Hulcher, ACEX#110
    ------------------------------



  • 6.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Nov 22, 2024 02:11 AM

    Thank you for this, after we apply the configuration, it works fine based on our preference. what does this mean in query ? AND updated_at > now() - interval '12 minutes' 




  • 7.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Nov 22, 2024 11:09 AM

    That's where I make sure that the accounting for the device has been updated within the last 12 minutes, which is why I call out that interim accounting needs to be enabled.  Interval should be set to 10 minutes or the query modified based on whatever interval is used.



    ------------------------------
    Carson Hulcher, ACEX#110
    ------------------------------



  • 8.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Dec 09, 2024 08:37 AM

    Hi do you have a working configuration sample with this? 




  • 9.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Jan 06, 2026 02:05 AM

    For this to work, you must be running ClearPass version 6.12 or later. ClearPass versions 6.10 and earlier use only the UserDB/TipsDB databases.Starting with ClearPass 6.12, AppExternal is now supported, which allows the use of custom database queries.

    -------------------------------------------



  • 10.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Jan 06, 2026 02:31 AM
    Edited by chulcher Jan 06, 2026 02:33 AM

    I probably created these queries on ClearPass 6.8 and 6.9, but no guarantees that they'd work on older versions as there were some security changes/cleanup done that made many of the custom queries non-functional for a bit.



    ------------------------------
    Carson Hulcher, ACEX#110
    ------------------------------



  • 11.  RE: CLEARPASS ACTIVE SESSION LIMIT

    Posted Jan 06, 2026 02:36 AM

    I already tried it in 6.10 it seems not working . since 6.10 is out of support we tried to upgrade to 6.11 then 6.12 and applied this query then it able to work based on our preference. anyway, thanks for the confirmation

    -------------------------------------------