- 08 Dec 2022
- 3 Minutes to read
- DarkLight
Jamf
- Updated on 08 Dec 2022
- 3 Minutes to read
- DarkLight
The Jamf integration enables you to trigger workflows with Jamf events, and interact with all of your data and users in Jamf directly from workflows.
Use Jamf events to trigger Torq workflows
To ingest Jamf events to trigger Torq workflows, you need to create a Jamf trigger integration and use the generated webhook URL (Torq endpoint) to configure a webhook in Jamf.
Configure a Jamf integration in Torq
- Go to Integrations > Triggers.
- Locate Jamf and click Add.
- Type a meaningful name for the integration instance and click Add.
Set up Jamf to send events to Torq
In Jamf, you have to create a Webhook, which defines which events will be sent to the Torq endpoint.
Each Webhook can only have one webhook event that will trigger the webhook. This means that you have to create a new Webhook for each event type, but you can use the same Torq endpoint for each Webhook.
- For instructions on how to create a Webhook in Jamf, see the Jamf documentation. When creating the Webhook, you'll enter the Torq endpoint that you created in the previous step.
- Jamf provides a full list of event types and their payload schemas.
Create a test workflow
There are several ways to generate the Jamf event to trigger the workflow. You can use either an actual event or use a previous event to send to the Torq endpoint in a cURL request.
We'll trigger the test workflow when a MobileDeviceEnrolled
event is received from the webhook and then convert the value for the model
field to all uppercase letters. This will verify that the trigger is working as expected and pass some data from the trigger event to a step.
In our example, we're using the sample payload for this event type as the basis for the trigger event and modifying it in several ways:
- Changing the value of the
model
field to samsung. - Adding integer values to the fields where the expected value is an integer.
- Make sure to replace the
<torq-endpoint>
with the actual endpoint generated when you created the Jamf integration in Torq.
- In Torq, go to the Workflows page and click Create Workflow.
- Type a meaningful name for the workflow, such as
Jamf Mobile Device Enrolled
. - Click the trigger icon, select Jamf, and select the integration you created.
- Send the following cURL request, which will send an event to the workflow.
curl -v -H "Content-Type: application/json" -X POST "<torq-endpoint>" -d '{"event": {"bluetoothMacAddress": "string", "deviceName": "string", "icciID": "string", "imei": "string", "ipAddress": "string", "jssID": 123, "model": "windows", "modelDisplay": "string", "osBuild": "string", "osVersion": "string", "product": "string", "room": "string", "serialNumber": "string", "udid": "string", "userDirectoryID": "string", "username": "string", "version": "string", "wifiMacAddress": "string"}, "webhook": {"eventTimestamp": 123, "id": 123, "name": "string", "webhookEvent": "MobileDeviceEnrolled"}}'
- Check the Event Log and confirm that the event was received.
- (Optional) If you plan to use the Torq endpoint for multiple Jamf event types, add a condition to specify which event type will trigger this workflow. In our example, the
MobileDeviceEnrolled
event type will trigger the workflow.
- Add the step
to_upper
and select the{{ $.event.event.model }}
JSONpath. Set the value formodel
field to samsung. - Check the Execution Log and confirm that the value for the
result
field is SAMSUNG.
Use Jamf steps in a Torq workflow
To use Jamf steps in Torq workflows, you have a to create a Jamf steps integration, which requires your account username, password, and the account base URL. You'll select this integration for the Integration parameter for Jamf steps.
- Go to Integrations > Steps.
- Locate Jamf and click Add.
- Type a meaningful name for the integration instance.
- Enter your Jamf username and password.
- Enter the base URL for your Jamf instance, for example,
https://<yourcompany>.jamfcloud.com
.
Supported steps
- Add multiple computers to static computer group
- Add single computer to static computer group
- Add user to static user group
- Create computer
- Delete computer
- Delete computer group
- Delete user by ID
- Delete user from computer
- Delete user group
- Disable Bluetooth on computer
- Disable remote desktop
- Erase computer
- Generate access token
- Get computer command by name
- Get computer details by ID
- Get computer group details by ID
- Get computer group details by name
- Get computer details
- Get computer search report
- Get extension attribute by name
- Get mobile device details by ID
- Get policy details by ID
- Get script details by ID
- Get user details by email
- Get user details by ID
- Get user details by name
- Get user group details by ID
- Get user group details by name
- List computer commands
- List computer groups
- List computers
- List policies
- List scripts
- List user groups
- List users
- Lock computer
- Remove computer from static computer group
- Remove extension attribute from computer
- Remove user from static user group
- Rename mobile device
- Schedule OS upgrade
- Set extension attribute for computer
- Unlock user account
Templates
- Rename new iOS device to User / Serial Number (Basic)
- Compliance - Provide temporary Device Admin to Mac users (Intermediate)
- Hunt for specific CVE and attempt remediation (Intermediate)
Torq - Jamf Webinar