cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
184
Views
0
Helpful
1
Replies

Admin API - Add Device Identifier

Craig McFarlane
Level 1
Level 1

Hi. 

Does anyone have a script they can share for adding device identifiers to Duo. I am not looking to use the CSV method as typically we would not be uploading on mass and trying to have a standard command line approach to this. PowerShell would be amazing but dont think this is possible. 

Is anyone doing this via command line for single devices? 

Thanks in advance 

1 Reply 1

DuoKristina
Cisco Employee
Cisco Employee

How often will you be adding trusted device IDs, and how many people will you have doing it? If it's infrequent it may be preferable to add them via the Duo Admin Panel instead of proliferating the API credentials across different systems so people can do it programatically. Any API post is going to have to comply with Duo's signing requirements, which relies on having the API integration secret key locally on the system making the request so it can create the HMAC signature for the request.

I know there is a third-party PowerShell Duo API client: https://github.com/mbegan/Duo-PSModule. I've tested it out a few times before for other API operations. Looks like it hasn't been updated for a few years, and so it doesn't have functions for device ID management. You could add them though if you were very interested in using PowerShell for this.

Usually if I am not using the Python script we provide + CSV (even sometimes a CSV file containing a single device ID) to test this from CLI then I am using our Python API client directly for the POST, or sometimes Postman (making sure I have a working pre-request script for the signing). Caution as I remember there being a third-party Duo Postman workspace that didn't format the request correctly.

Generally we recommend using one of the API clients from the duosecurity GitHub org, or the Python script.

Duo, not DUO.
Quick Links