Home > Jamf Pro, Jamf Pro API, Scripting > Reporting on Jamf Pro API Role permissions
As part of reporting on Jamf Pro API clients and assigned API roles, I had previously written a script to report on the following information:
It later occurred to me that a more comprehensive report which includes the permissions assigned to the roles may be wanted, so I’ve now written a separate script which reports on the following:
For more details, please see below the jump.
The script is named Generate_Jamf_Pro_API_Role_Privileges_Report.sh and is available via the link below:
This script connects to the Jamf Pro API on a Jamf Pro server and reports the API Roles, their assigned API privileges and which API clients (if any) are assigned to those API client roles.
Three items are required to use this script:
If setting up an API client with limited rights, here are the required API role privileges for the API client on the Jamf Pro server:
You should see similar output to what’s shown below when using the Generate_Jamf_Pro_API_Role_Privileges_Report.sh script to generate a report:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| username@computername ~ % /Users/Shared/Jamf_Pro_API_Role_Privileges_Report/Jamf_Pro_API_Role_Privileges_Report.sh | |
| Please enter your Jamf Pro server URL : https://jamf.pro.server.here | |
| Please enter your Jamf Pro API client ID : 88ab021a-6b2e-478e-ae57-7b2208664c7c | |
| Please enter the API client secret for the 88ab021a-6b2e-478e-ae57-7b2208664c7c API client ID: | |
| Report being generated. File location will appear below once ready. | |
| Role Name Role ID Privilege Name Assigned API Client(s) | |
| Create API Roles and Update API Roles 28 Create API Roles 125ed256-21e1-42b6-bb77-afe3c917a940 (Disabled) | |
| Create API Roles and Update API Roles 28 Update API Roles 125ed256-21e1-42b6-bb77-afe3c917a940 (Disabled) | |
| Read Computers API Role 29 Read Computers 47da63c0-1386-4c55-851b-cc0098621f26 (Enabled) | |
| Read API Roles and API Integrations 30 Read API Integrations 88ab021a-6b2e-478e-ae57-7b2208664c7c (Enabled) | |
| Read API Roles and API Integrations 30 Read API Roles 88ab021a-6b2e-478e-ae57-7b2208664c7c (Enabled) | |
| Create Computers API Role 31 Create Computers (No API Client assigned) | |
| Report available here: /var/folders/ps/2_yw29gj711c9d7c5w5jhyv80000gp/T/tmp.OG0uCcS4CL.tsv | |
| username@computername ~ % |
As part of the script’s run, a report will be generated and you’ll be notified of where it is stored. The report will be in TSV format and appear similar to what’s shown below:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Role Name | Role ID | Privilege Name | Assigned API Clients | |
|---|---|---|---|---|
| Create API Roles and Update API Roles | 28 | Create API Roles | 125ed256-21e1-42b6-bb77-afe3c917a940 (Disabled) | |
| Create API Roles and Update API Roles | 28 | Update API Roles | 125ed256-21e1-42b6-bb77-afe3c917a940 (Disabled) | |
| Read Computers API Role | 29 | Read Computers | 47da63c0-1386-4c55-851b-cc0098621f26 (Enabled) | |
| Read API Roles and API Integrations | 30 | Read API Integrations | 88ab021a-6b2e-478e-ae57-7b2208664c7c (Enabled) | |
| Read API Roles and API Integrations | 30 | Read API Roles | 88ab021a-6b2e-478e-ae57-7b2208664c7c (Enabled) | |
| Create Computers API Role | 31 | Create Computers | (No API Client assigned) |