Security

 View Only
last person joined: yesterday 

Forum to discuss Enterprise security using HPE Aruba Networking NAC solutions (ClearPass), Introspect, VIA, 360 Security Exchange, Extensions, and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

ClearPass Time Source - Next Monday

This thread has been viewed 6 times
  • 1.  ClearPass Time Source - Next Monday

    Posted Aug 31, 2018 03:54 PM

    I'm looking for assistance with adding a filter to the time source auth source. I'm looking for a filter to return the date of the next Monday.

     

    If a user connects on a Monday, the time source filter would return the date of the following Monday. If the same user next connects on a Wednesday, the time source filter would still return the date of the following Monday.

     

    Any help in generating the SQL syntax to place in the filter will be appreciated.



  • 2.  RE: ClearPass Time Source - Next Monday
    Best Answer

    Posted Sep 10, 2018 02:01 PM

    If anyone was interested in the solution for their own environment, here's what I received from TAC.

     

    select date_trunc('day', localtimestamp(0) + interval '1 day' * (select 8 - extract(isodow from date_trunc('hour', localtimestamp(0))) as temp)) as next_monday

     2018-09-10 12_58_52-ClearPass Policy Manager - Aruba Networks.png

     



  • 3.  RE: ClearPass Time Source - Next Monday

    Posted Dec 29, 2023 08:39 AM

    Thanks for sharing the solution.

    What would I need to change if  i would like to get "Next Friday"?




  • 4.  RE: ClearPass Time Source - Next Monday

    EMPLOYEE
    Posted Jan 02, 2024 08:01 AM

    With some help from here, I found the following SQL query that finds the start of the first coming Friday:

    postgres=# select date_trunc('day', localtimestamp(0) + interval '1 day' * ( select ( 12 - extract(isodow from date_trunc('hour', localtimestamp(0)))::int ) % 7 as temp )) as next_friday;
         next_friday
    ---------------------
     2024-01-05 00:00:00
    (1 row)

    If you want 18:00h / 6PM:

    postgres=# select date_trunc('day', localtimestamp(0) + interval '1 day' * ( select ( 12 - extract(isodow from date_trunc('hour', localtimestamp(0)))::int ) % 7 as temp )) + interval '18 hour'  as next_friday;
         next_friday
    ---------------------
     2024-01-05 18:00:00
    (1 row)

    This is standard Postgres SQL time calculations. Postgres is the database system that ClearPass uses under the hood.



    ------------------------------
    Herman Robers
    ------------------------
    If you have urgent issues, always contact your Aruba partner, distributor, or Aruba TAC Support. Check https://www.arubanetworks.com/support-services/contact-support/ for how to contact Aruba TAC. Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.

    In case your problem is solved, please invest the time to post a follow-up with the information on how you solved it. Others can benefit from that.
    ------------------------------