Developer

 View Only
Expand all | Collapse all

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

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

    Posted Jun 10, 2024 11:09 AM
    Edited by cauliflower Jun 10, 2024 11:48 AM

    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

    Posted Jun 11, 2024 06:05 AM

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