Security

last person joined: 4 days ago 

Enterprise security using ClearPass Policy Management, ClearPass Security Exchange, IntroSpect, VIA, 360 Security Exchange, Extensions and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

Getting started with ClearPass API and Python

Jump to Best Answer
This thread has been viewed 4 times
  • 1.  Getting started with ClearPass API and Python

    Posted Sep 08, 2020 06:31 PM

    Hello,

     

    I've done the steps needed to get going with the API (I think). I've had a play with cURL and with the built-in API Explorer. It all looks good. My question is really are there any resources specifically for Python? Or do I just write a standard Python script using Python modules like request & json? I haven't used a REST API before.

     

    My use-case is pretty  simple, I just want to get a list of devices from Guest, check the status of the people who have registered them (by running their IDs through our own identity db) and then delete any devices in Guest that belong to users who are now cancelled (ie have left the university). Before I start I just want to make sure there isn't anything I'm missing about how to do this.

     

    Thank you



  • 2.  RE: Getting started with ClearPass API and Python
    Best Answer

    Posted Sep 08, 2020 07:31 PM

    The developer gives you some examples using Requests. 

     

    https://developer.arubanetworks.com/aruba-cppm/reference#deviceget



  • 3.  RE: Getting started with ClearPass API and Python

    Posted Sep 09, 2020 05:51 AM

    aah this looks brilliant - thank you



  • 4.  RE: Getting started with ClearPass API and Python

    Posted Sep 09, 2020 06:19 AM
      |   view attached

    I bashed this Python program primarily to teach myself Python. This uses Python3. The program is reasonably logically setup with helpful comments - though I'm new to Python. It sets up the RESTful API's Bearer and then allows updating of various Endpoint and Guest Device attributes. Hopefully the README file is self explanatory?

    WARNING: This has only had rudimentary testing but is provided to show the principles. Treat with care

    Attachment(s)

    zip
    inject_restful_api.zip   8 KB 1 version


  • 5.  RE: Getting started with ClearPass API and Python

    Posted Sep 09, 2020 08:38 AM

    Thank you - I'll take a look