Developer

 View Only
last person joined: 6 days ago 

Expand all | Collapse all

ClearPass Python API - generate random mPSK that matches CPPM password rules

This thread has been viewed 6 times
  • 1.  ClearPass Python API - generate random mPSK that matches CPPM password rules

    Posted 7 days ago

    Hello,

    We are using the Python API to create devices in ClearPass, this seems to work well. But we would also like to generate the mPSK using ClearPass, There is a "random-mpsk" call which looks like it would do that. However it doesn't seem to generate an mPSK that passes validation for the mPSK settings that we have on ClearPass.

    This is what the docs say:

    API random mpsk generator

    Maybe we need to supply a value for random_mpsk_method? But if so what are the available options for this?

    Thank you,

    Guy



  • 2.  RE: ClearPass Python API - generate random mPSK that matches CPPM password rules

    EMPLOYEE
    Posted 7 days ago

    Interesting... my first response would be that if you have a Python script already, why not generate the password there and just put that in to have real full control over your passwords.

    But, one way to get the available options is to go in Clearpass Guest to Administration » Aruba Integrations » MPSK Configuration. There is a form with a dropdown of the different options, which you can get from the page source or 'inspect' in your browser developer tools:

    <option label="Random digits" value="nwa_digits_password">Random digits</option>
    <option label="Random lowercase letters" value="nwa_letters_password">Random lowercase letters</option>
    <option label="Random lowercase letters excluding vowels" value="nwa_novowels_password">Random lowercase letters excluding vowels</option>
    <option label="Random letters and digits" value="nwa_lettersdigits_password">Random letters and digits</option>
    <option label="Random mixed case letters and digits" value="nwa_alnum_password">Random mixed case letters and digits</option>
    <option label="Random letters, digits and symbols" value="nwa_strong_password">Random letters, digits and symbols</option>
    <option label="Random words separated by a small number" value="nwa_words_password" selected="selected">Random words separated by a small number</option>
    <option label="Format picture" value="nwa_picture_password">Format picture</option>

    If I try the following body in the API:

    { "random_mpsk_method": "nwa_lettersdigits_password", "random_mpsk_length": 24 }

    ... I get:

    {
      "mpsk": "bf3u33kigv3e82av4syhnciq"
    }

    Hope this helps... but as mentioned, I would personally write my own password generator.



    ------------------------------
    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.
    ------------------------------