Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

1 star

Watchers

10 watching

Forks

Repository files navigation

baton-jamf

baton-jamf is a connector for Jamf built using the Baton SDK. It communicates with the Jamf API to sync data about users, user accounts, groups, user groups, roles, sites, and managed devices, and can provision Jamf accounts (create/delete) and grant/revoke access to groups, user groups, roles, sites, and managed devices.

Check out Baton to learn more the project in general.

Capabilities

Capability Status
Sync Yes
Account Creation (Users, User Accounts) Yes — one type per connector instance, see create-account-resource-type below
Account Deletion (Users, User Accounts) Yes — except the user account the connector authenticates with
Provisioning (Grant/Revoke) Yes — Groups (userAccount principal only, Group Access accounts only), User Groups (static groups only), Sites (user principal only), Managed Devices (assigned, user principal only, opt-in — see Data Model below), Roles (built-in privilege sets and individual privileges, userAccount/group principal, see below).

Account creation/deletion and Grant/Revoke all require -p/$BATON_PROVISIONING to be set; without it the connector only syncs.

Requires Jamf Pro 11.26.0 or later (GET /api/v1/users was added in 11.26.0). Managed Devices, which are opt-in, use the Jamf Pro API v4 computers-inventory endpoints, added in 11.30.0, and the v2 mobile-devices endpoints.

Authentication

Pick one method with --auth-method:

  • username-password (default): a local Jamf Pro account, set with --username and --password. The connector exchanges them for a short-lived bearer token and requests a new one shortly before it expires.
  • api-client: a Jamf Pro API client, set with --jamf-client-id and --jamf-client-secret. Assign the client API roles that carry the privileges below.

Each method's flags are required only when that method is selected.

Required Jamf privileges

The Administrator privilege set covers everything. For least privilege, grant:

Task Privilege
Startup, config validation, token refresh None — any enabled local Jamf Pro account or API client (every Custom set also keeps Read License Information)
Sync users Read User
Sync user accounts and groups Read Accounts
Sync user groups Read Static User Groups, Read Smart User Groups (Smart is only needed when smart groups exist — it's checked per group)
Sync sites Read Sites, Read Accounts
Sync roles Read API Roles, Read Accounts
Sync managed devices (opt-in) Read Computers, Read Mobile Devices
Create/delete users Create User and Read User (the connector reads the user back after creating); Delete User
Create/delete user accounts Create Accounts and Read Accounts; Delete Accounts
Group Grant/Revoke (userAccount principal) Read Accounts, Update Accounts
Role Grant/Revoke (userAccount/group principal) Read Accounts, Update Accounts (Read API Roles is not needed for writes)
User Group Grant/Revoke (static group) Read Static User Groups, Update Static User Groups
Site Grant/Revoke (user principal) Read User, Update User
Managed Device Grant/Revoke Computers: Read Computers, Update Computers, Read User. Mobile devices: Read Mobile Devices, Update Mobile Devices, Read User, plus Assign Users to Mobile Devices to Grant (clearing the assignee on Revoke doesn't need it)

Read Accounts/Create Accounts/Update Accounts/Delete Accounts cover both admin user accounts and admin groups — Jamf has no separate privilege for account groups. Every write path reads the object first, so each Update privilege above needs its Read counterpart too.

A missing privilege fails the sync or the operation with a permission error.

Group Grant/Revoke adds or removes a userAccount from an admin account group's member list. A group with no members cannot receive its first member through the connector, and Revoke on such a group returns a retryable error instead of reporting success. Only Group Access accounts can usefully be granted membership — a Full or Site Access account's rights come from its own privilege_set, not its groups, so Grant rejects adding one (membership grants it nothing). Do not use Grant/Revoke on directory (LDAP) groups: their membership is managed by the directory and the connector does not detect them.

Smart User Groups cannot be granted/revoked (membership is computed from criteria, not assignable) — the connector rejects these before calling the Jamf API. Site Grant/Revoke is only provisionable for the user principal; userGroup/userAccount/group site membership remains sync-only (single- valued/exclusive, not a true membership list). Managed Device assigned is single-valued — granting it to a new user displaces whichever user was previously assigned. Every device has the assigned entitlement, so Grant also assigns a previously-unassigned device to a user. Computers use the Jamf Pro v4 computers-inventory API. Granting a computer overwrites the assignee's username, name, email, position and phone with the new user's values (Jamf never fills these in on its own for computers); Revoke clears all five. Mobile devices only ever have their username set directly — Jamf derives the assignee's name, email and phone from the directory automatically, and Revoke clears all of them together by clearing the username.

Role Grant/Revoke sets or clears a userAccount or group's role. All three built-in privilege sets (Administrator, Auditor, Enrollment Only) and every individual privilege are grantable — Custom itself is not a role you grant directly. Granting a set displaces whichever one the principal previously held. Revoke moves the principal to Custom with only the Read License Information privilege, which can't be revoked itself. Individual privileges can only be granted while the principal's privilege_set is already Custom: the flow is Revoke the current set first (which moves it to Custom), then Grant the individual privileges — granting a built-in set again later leaves Custom and discards those individual privileges. Group Access accounts are not supported for Role Grant/Revoke — their rights come from their groups, so assign the role to the group instead. Changing a Full or Site Access account's role removes it from any admin group it belonged to. A write rejected for the connector's own Jamf account is reported as a permission error.

Sync cost

Requests per full sync:

Resource type Requests
user ⌈users / 1000⌉
userAccount ⌈accounts / 100⌉
group 1, plus one read per group
userGroup 1, plus one read per user group
site 1, plus per site ⌊users / 1000⌋ + 1, ⌊user groups / 1000⌋ + 1 and ⌈accounts / 100⌉, each only when user, userGroup or userAccount is synced
role 1, plus ⌈accounts / 100⌉ + ⌈Custom accounts / 10⌉ and one read per Custom account, when userAccount is synced
managedDevice max(1, ⌈computers / 100⌉) + max(1, ⌈mobile devices / 100⌉) for the device list, plus max(1, ⌈computers / 1000⌉) + max(1, ⌈mobile devices / 1000⌉) for the grants

Validation adds one request, plus one token request per new process (each Lambda container) and each time the token expires. Most SDK calls make one request; the largest is a role grants page of Custom accounts, which reads each one's details (up to 11). A group or user group detail comes back whole, so that read grows with the size of the group. For example, 50,000 users, 1,000 accounts (300 of them Custom), 50 groups, 200 user groups, 20 sites holding the users and 20,000 devices come to roughly 1,000 requests; sync time is about that count times the instance's API response time.

Jamf Pro console admin account creation (userAccount)

When --create-account-resource-type=userAccount, a created account is Enabled with Full Access, and its privilege_set profile field controls its access level: Administrator, Auditor (the default), Enrollment Only, or Custom. A random password is generated and returned once, as plaintext, in the provisioning response — the connector does not store it.

For Custom, set at least one of the following profile fields to a list of Jamf privilege names for that category — the connector rejects the request otherwise, since a Custom account with no privileges at all would have no access:

  • privileges_jss_objects
  • privileges_jss_settings
  • privileges_jss_actions
  • privileges_recon
  • privileges_casper_admin
  • privileges_casper_remote
  • privileges_casper_imaging

Conversely, setting any of these fields when privilege_set is not Custom is also rejected — they only apply to Custom accounts.

Privilege names are validated server-side by Jamf, not by this connector — an invalid name returns a Jamf API error rather than a local validation error.

Getting Started

Prerequisites

  1. Jamf Pro instance

brew

brew install conductorone/baton/baton conductorone/baton/baton-jamf
baton-jamf
baton resources

docker

docker run --rm -v $(pwd):/out -e BATON_USERNAME=jamfUsername -e BATON_PASSWORD=jamfPassword -e BATON_INSTANCE_URL=https://jamfProServerUrl.example.com public.ecr.aws/conductorone/baton-jamf:latest -f "/out/sync.c1z"
docker run --rm -v $(pwd):/out ghcr.io/conductorone/baton:latest -f "/out/sync.c1z" resources

source

go install github.com/conductorone/baton/cmd/baton@main
go install github.com/conductorone/baton-jamf/cmd/baton-jamf@main

BATON_USERNAME=jamfUsername BATON_PASSWORD=jamfPassword BATON_INSTANCE_URL=https://jamfProServerUrl.example.com baton-jamf
baton resources

Data Model

baton-jamf pulls down information about the following Jamf resources:

  • Users
  • Groups
  • User Accounts
  • User Groups
  • Roles
  • Sites
  • Managed Devices — opt-in in C1. Self-hosted runs sync it along with every other type unless --sync-resource-types/$BATON_SYNC_RESOURCE_TYPES leaves it out (e.g. user,userAccount,group,userGroup,role,site). Provisioning for devices is only available when managedDevice is included in the sync.

Account creation/deletion and Grant/Revoke (see Capabilities above) all require -p/$BATON_PROVISIONING.

Contributing, Support, and Issues

We started Baton because we were tired of taking screenshots and manually building spreadsheets. We welcome contributions, and ideas, no matter how small -- our goal is to make identity and permissions sprawl less painful for everyone. If you have questions, problems, or ideas: Please open a Github Issue!

See CONTRIBUTING.md for more details.

baton-jamf Command Line Usage

baton-jamf

Usage:
  baton-jamf [flags]
  baton-jamf [command]

Available Commands:
  capabilities       Get connector capabilities
  completion         Generate the autocompletion script for the specified shell
  config             Get the connector config schema
  health-check       Check the health of a running connector
  help               Help about any command

Flags:
      --auth-method string                  ($BATON_AUTH_METHOD)
      --client-id string                    The client ID used to authenticate with ConductorOne ($BATON_CLIENT_ID)
      --client-secret string                The client secret used to authenticate with ConductorOne ($BATON_CLIENT_SECRET)
      --create-account-resource-type string Which Jamf account type C1 should create when provisioning accounts. 'user' (default) creates directory users; 'userAccount' creates Jamf Pro console admin accounts. Only one type can be created at a time per connector instance. ($BATON_CREATE_ACCOUNT_RESOURCE_TYPE) (default "user")
  -f, --file string                         The path to the c1z file to sync with ($BATON_FILE) (default "sync.c1z")
  -h, --help                                help for baton-jamf
      --instance-url string                 required: Base URL of your Jamf Pro instance, including https:// (for example https://yourcompany.jamfcloud.com) ($BATON_INSTANCE_URL)
      --jamf-client-id string               required: Client ID of a Jamf Pro API client ($BATON_JAMF_CLIENT_ID)
      --jamf-client-secret string           required: Client secret of a Jamf Pro API client ($BATON_JAMF_CLIENT_SECRET)
      --log-format string                   The output format for logs: json, console ($BATON_LOG_FORMAT) (default "json")
      --log-level string                    The log level: debug, info, warn, error ($BATON_LOG_LEVEL) (default "info")
      --password string                     required: Password for your Jamf Pro instance ($BATON_PASSWORD)
  -p, --provisioning                        This must be set in order for provisioning actions to be enabled ($BATON_PROVISIONING)
      --skip-entitlements-and-grants         This must be set to skip syncing of entitlements and grants ($BATON_SKIP_ENTITLEMENTS_AND_GRANTS)
      --skip-full-sync                      This must be set to skip a full sync ($BATON_SKIP_FULL_SYNC)
      --sync-resource-types strings         The resource type IDs to sync ($BATON_SYNC_RESOURCE_TYPES)
      --sync-resources strings              The resource IDs to sync ($BATON_SYNC_RESOURCES)
      --ticketing                           This must be set to enable ticketing support ($BATON_TICKETING)
      --username string                     required: Username for your Jamf Pro instance ($BATON_USERNAME)
  -v, --version                             version for baton-jamf

Use "baton-jamf [command] --help" for more information about a command.

See --help for the full, up-to-date list of flags (this trims flags shared by every Baton connector that are rarely needed, e.g. OpenTelemetry and worker-tuning options).

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

1 star

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages