ScopeMap is a native macOS app from Jamf Concepts that scans a Jamf Pro environment and shows what reaches a device and why. It answers questions that are hard to answer in the Jamf Pro web interface, such as “why is this Mac getting that policy?” and “what happens if I change this group?”.
To do that it reads a lot of object types, so its API Role needs 39 read privileges. Selecting 39 privileges in the Jamf Pro interface, in every environment, and getting one wrong is not how I want to start using a new tool.
create-jamfscopemap-api-role.sh, part of Mac Admins Toolkit, creates or
updates that role for you through the Jamf Pro API. It can also create an API Client bound to the role.
What the script does
- Authenticates to Jamf Pro.
- Reads the privileges your server offers (
GET /api/v1/api-role-privileges) and checks every privilege name in its list against them. If Jamf has renamed one, the run stops and lists it. Nothing is changed. - Creates the role, or updates it if a role with that name exists (
/api/v1/api-roles). - Optionally creates an API Client with the same name as the role and prints its secret once.
The role is read-only, with no delete rights. Its 39 privileges are all Read privileges: computers and mobile devices, smart and
static groups, policies, macOS and iOS configuration profiles, apps, restricted software, packages, scripts,
printers, patch management, PreStage enrolments, extension attributes, advanced searches, buildings,
departments, categories, sites, accounts, webhooks and a few more. The exact list is the PRIVILEGES array
in the script.
Requirements
/bin/bash,curlandjq, all included with macOS 15 and later- A terminal on an admin Mac. This is not a Jamf policy script
- A Jamf Pro user account with the Administrator privilege set. The README explains why: Jamf Pro only lets you assign API privileges you already hold, so an Administrator account is the simplest way to create the role
Usage
export JAMF_URL="https://yourorg.jamfcloud.com"
export JAMF_USER="admin-account"
export JAMF_ENV="dev" # prod or dev
# Dry run (default): authenticates, validates privilege names, prints the payload, changes nothing
./create-jamfscopemap-api-role.sh
# Real run
DRY_RUN=no ./create-jamfscopemap-api-role.sh
# Real run, also create an API Client and print its secret once
DRY_RUN=no CREATE_CLIENT=yes ./create-jamfscopemap-api-role.sh
The role name has no built-in default. Set ROLE_NAME, or the script asks for it. Environment selection, the
typed PROD confirmation, the URL guard and the optional plist are the same as the other Jamf Pro API tools
in the toolkit. They are described in the toolkit overview.
Things to know
- No duplicate clients. If a client with the role’s name exists, or any client is already assigned the role, no new one is created.
- The secret is shown once. The secret of a new client is printed and not stored. The secret of a client that already exists cannot be shown again. Delete the client in Jamf Pro first if you need a new one.
- Short-lived tokens. A client created by the script gets an access token lifetime of 180 seconds.
- Blueprints and Compliance are not covered. They use Jamf Platform scopes and cannot be set through an API Role.
Get it
The script and README are in Jamf-Pro-ScopeMap-API-Role. Jamf’s own documentation on API Roles and Clients covers the feature itself.