Security

 View Only
Expand all | Collapse all

ClearPass converting endpoint data to Guest Device Import format

This thread has been viewed 11 times
  • 1.  ClearPass converting endpoint data to Guest Device Import format

    Posted Apr 07, 2026 06:45 AM
    Edited by GorazdKikelj Apr 08, 2026 09:15 AM

    ClearPass has this nice feature to having all detected/discovered endpoints stored in it's database. The sad thing is, that you can't export data from endpoint db into [Guest Device Repository]. Exported XML format do not match required import XML format. This would be a useful feature in Endpoint export function.

    Here I offer three options how to do this conversion.

    The easiest is to use SQL statement and read endpoint db directly. 

    [Edit] Updated SQL to take into account correct MAC addresses only and numeric values for Role ID field.

    COPY (
    SELECT
      upper(substring(mac_address, 1,2) || '-' ||
            substring(mac_address, 3,2) || '-' ||
            substring(mac_address, 5,2) || '-' ||
            substring(mac_address, 7,2) || '-' ||
            substring(mac_address, 9,2) || '-' ||
            substring(mac_address, 11,2)) as mac,
      CASE WHEN (hostname IS NOT NULL AND hostname != '') THEN hostname ELSE mac_address END AS visitor_name,
       CASE
        WHEN lower(device_category) = 'printer' THEN '5'
        WHEN lower(device_category) = 'camera' THEN '6'
        WHEN lower(device_category) = 'computer' THEN '7'
        ELSE '2'
      END AS role_id,
      1 as mac_auth,
      0 as do_expire,
      'Device imported from Endpoint: ' || mac_address || ' (' || hostname || ')' as note
      FROM public.tips_endpoints_view
      WHERE device_category LIKE 'Printer'
        AND mac_address ~ '^[A-Fa-f0-9:\-]*$'
    ) TO stdout
    WITH CSV HEADER;
    I publish two python scripts to my github https://github.com/GorazdKikelj/clearpass 

    conv_endpoint_to_guest.py expect Endpoint XML export file as input and return XML formatted for Guest Devices import.

    cp_get_endpoint.py use REST API to gather endpoints from ClearPass and return CSV file for import into Guest Devices.

    Hopefully it will be useful for somebody.

    Best, Gorazd



    ------------------------------
    Gorazd Kikelj
    MVP Guru 2025
    ------------------------------



  • 2.  RE: ClearPass converting endpoint data to Guest Device Import format

    Posted Apr 07, 2026 09:48 PM

    thanks for sharing



    ------------------------------
    If my post was useful accept solution and/or give kudos.
    Any opinions expressed here are solely my own and not necessarily that of HPE or Aruba.
    ------------------------------