Fleet to JSM Assets

Fleet to JSM Assets

Fleet to JSM Assets Integration Guide

This guide explains how to use OnLink to import Fleet data into JSM Assets. It covers the Fleet API connection, sample data, field mapping, validation, and optional query parameters.

Overview

OnLink can import Fleet API responses into JSM Assets object types by using mapping statements such as key:, map:, and config:. The same approach can be used for Fleet object types such as devices, users, circuits, and wireless data, provided the corresponding Fleet API endpoint and Assets object type are configured.

The high-level process is:

  1. Create or confirm the target JSM Assets schema and object type.

  2. Configure an OnLink Assets Data Source that uses Basic Auth to connect to Fleet.

  3. Set the API method and Fleet endpoint, then fetch sample data.

  4. Map Fleet JSON fields to JSM Assets attributes.

  5. Use Get Data to validate the result, then run the import.

Prerequisites

  • A JSM Assets schema and object type for the data you want to import.

  • OnLink installed and available from Manage your apps.

  • A Fleet username and password with access to the required API endpoints.

  • Permission in JSM Assets to configure data sources, mappings, and imports.

  • The Fleet API endpoint URL for the object type you plan to import.

Supported Fleet object types

The examples on this page use Fleet devices. The same pattern can be adapted for other Fleet data, such as Assets, Devices, and Cloud objects, by selecting the appropriate Fleet API endpoint and mapping the returned JSON fields to the matching Assets attributes.

1. Prepare Fleet credentials

Before configuring OnLink, confirm that you have a Fleet username and password with access to the required API endpoints. For Fleet authentication details, see https://fleetdm.com/docs/rest-api/rest-api .

Keep the credentials available for the OnLink data source configuration.

2. Configure the OnLink data source

  1. In OnLink, add an Assets Data Source.

  2. Set Authentication Type to Bearer Token Static

  3. Provide Token.

 

3. Configure the API method

Use a GET request to retrieve records from the Fleet API. For example, to fetch devices, configure the request as follows:

  1. Set Method to GET.

  2. Set URL to the Fleet API endpoint, for example: https://fleetdm.com/docs/rest-api/rest-api#list-hosts . In the sample below the URL use apifleet.com, please replace with your hostname.

  3. Set Response data path to hosts.

  4. Leave other settings at their defaults unless the endpoint requires query parameters.

GET /api/v1/fleet/hosts

 

4. Fetch sample data

Save the connection, then run it to fetch sample values from Fleet. Use the returned sample JSON to confirm that the endpoint is correct and to identify the field names needed for mapping.

Sample response

{ "hosts": [ { "created_at": "2020-11-05T05:09:44Z", "updated_at": "2020-11-05T06:03:39Z", "id": 1, "detail_updated_at": "2020-11-05T05:09:45Z", "last_restarted_at": "2020-11-01T03:01:45Z", "software_updated_at": "2020-11-05T05:09:44Z", "label_updated_at": "2020-11-05T05:14:51Z", "policy_updated_at": "2023-06-26T18:33:15Z", "last_enrolled_at": "2023-02-26T22:33:12Z", "seen_time": "2020-11-05T06:03:39Z", "hostname": "Annas-MacBook-Pro.local", "uuid": "392547dc-0000-0000-a87a-d701ff75bc65", "platform": "darwin", "osquery_version": "5.15.0", "os_version": "macOS 15.2", "build": "24C101", "platform_like": "darwin", "code_name": "", "uptime": 8305000000000, "memory": 2084032512, "cpu_type": "arm64e", "cpu_subtype": "ARM64E", "cpu_brand": "Apple M1", "cpu_physical_cores": 8, "cpu_logical_cores": 8, "hardware_vendor": "Apple Inc.", "hardware_model": "MacBookPro17,1", "hardware_version": "", "hardware_serial": "C0124FXASD6G", "computer_name": "Anna's MacBook Pro", "timezone": null, "display_name": "Anna's MacBook Pro", "public_ip": "123.45.678.910", "primary_ip": "192.12.345.678", "primary_mac": "36:34:a5:6b:7b:5c", "distributed_interval": 10, "config_tls_refresh": 10, "logger_tls_period": 8, "status": "offline", "display_text": "Annas-MacBook-Pro.local", "team_id": null, "fleet_id": null, "team_name": null, "fleet_name": null, "gigs_disk_space_available": 174.98, "percent_disk_space_available": 71, "gigs_total_disk_space": 246, "additional": {}, "pack_stats": [ { "pack_id": 0, "pack_name": "Global", "type": "global", "query_stats": [ { "scheduled_query_name": "Get recently added or removed USB drives", "scheduled_query_id": 5535, "query_name": "Get recently added or removed USB drives", "discard_data": false, "last_fetched": null, "automations_enabled": false, "description": "Returns a record every time a USB device is plugged in or removed", "pack_name": "Global", "average_memory": 434176, "denylisted": false, "executions": 2, "interval": 86400, "last_executed": "2023-11-28T00:02:07Z", "output_size": 891, "system_time": 10, "user_time": 6, "wall_time": 0 } ] } ], "issues": { "failing_policies_count": 1, "critical_vulnerabilities_count": 2, // Fleet Premium only "total_issues_count": 3 }, "geolocation": { "country_iso": "US", "city_name": "New York", "geometry": { "type": "point", "coordinates": [40.6799, -74.0028] } }, "mdm": { "encryption_key_available": false, "enrollment_status": "Pending", "dep_profile_error": true, "name": "Fleet", "server_url": "https://example.fleetdm.com/mdm/apple/mdm", "device_status": "unlocked", "pending_action": "" }, "software": [ { "id": 1, "name": "glibc", "version": "2.12", "source": "rpm_packages", "generated_cpe": "cpe:2.3:a:gnu:glibc:2.12:*:*:*:*:*:*:*", "last_opened_at": "2021-08-18T21:14:00Z", "vulnerabilities": [ { "cve": "CVE-2009-5155", "details_link": "https://nvd.nist.gov/vuln/detail/CVE-2009-5155", "cvss_score": 7.5, // Fleet Premium only "epss_probability": 0.01537, // Fleet Premium only "cisa_known_exploit": false, // Fleet Premium only "cve_published": "2022-01-01T12:32:00Z", // Fleet Premium only "cve_description": "In the GNU C Library (aka glibc or libc6) before 2.28, parse_reg_exp in posix/regcomp.c misparses alternatives, which allows attackers to cause a denial of service (assertion failure and application exit) or trigger an incorrect result by attempting a regular-expression match.", // Fleet Premium only "resolved_in_version": "2.28" // Fleet Premium only } ], "installed_paths": ["/usr/lib/some-path-1"] } ], "policies": [ { "id": 1, "name": "Gatekeeper enabled", "query": "SELECT 1 FROM gatekeeper WHERE assessments_enabled = 1;", "description": "Checks if gatekeeper is enabled on macOS devices", "resolution": "Fix with these steps...", "platform": "darwin", "response": "fail", "fleet_maintained": true, "critical": false } ], "users": [ { "uid": 0, "username": "root", "type": "", "groupname": "root", "shell": "/bin/bash" }, { "uid": 1, "username": "bin", "type": "", "groupname": "bin", "shell": "/sbin/nologin" } ], "labels": [ { "created_at": "2021-08-19T02:02:17Z", "updated_at": "2021-08-19T02:02:17Z", "id": 6, "name": "All Hosts", "description": "All hosts which have enrolled in Fleet", "query": "SELECT 1;", "platform": "", "label_type": "builtin", "label_membership_type": "dynamic" }, { "created_at": "2021-08-19T02:02:17Z", "updated_at": "2021-08-19T02:02:17Z", "id": 9, "name": "CentOS Linux", "description": "All CentOS hosts", "query": "SELECT 1 FROM os_version WHERE platform = 'centos' OR name LIKE '%centos%'", "platform": "", "label_type": "builtin", "label_membership_type": "dynamic" }, { "created_at": "2021-08-19T02:02:17Z", "updated_at": "2021-08-19T02:02:17Z", "id": 12, "name": "All Linux", "description": "All Linux distributions", "query": "SELECT 1 FROM osquery_info WHERE build_platform LIKE '%ubuntu%' OR build_distro LIKE '%centos%';", "platform": "", "label_type": "builtin", "label_membership_type": "dynamic" } ] } ] }

Pagination notes

Fleet API responses are paginated. Use the following configuration.

 

5. Configure the Assets import and mapping

After the connection is established, create the Assets import by following the JSM Assets Data Synchronization guide.

Use the fetched API sample to identify the Fleet JSON field names and map them to the corresponding JSM Assets attributes. The key: mapping should identify the stable unique value used to match and update existing Assets objects.

Mapping

Purpose

Mapping

Purpose

key:id=Device ID

Uses the Fleet host id field as the unique key for matching and updating JSM Assets objects.

map:hostname=Hostname

Maps the Fleet host hostname to Hostname. The system-reported hostname of the device.

map:uuid=UUID

Maps the Fleet host uuid to UUID. The universally unique identifier assigned to the device.

map:platform=Platform

Maps the Fleet host platform to Platform. The OS platform type (e.g., darwin, windows, linux).

map:os_version=OS Version

Maps the Fleet host os_version to OS Version. The human-readable operating system version (e.g., macOS 15.2).

map:hardware_serial=Serial Number

Maps the Fleet host hardware_serial to Serial Number. The hardware serial number of the device.

map:hardware_model=Model

Maps the Fleet host hardware_model to Model. The hardware model identifier (e.g., MacBookPro17,1).

map:hardware_vendor=Vendor

Maps the Fleet host hardware_vendor to Vendor. The manufacturer of the device (e.g., Apple Inc.).

map:computer_name=Computer Name

Maps the Fleet host computer_name to Computer Name. The user-friendly display name of the device.

map:primary_mac=MAC Address

Maps the Fleet host primary_mac to MAC Address. The primary MAC address of the device.

map:primary_ip=IP Address

Maps the Fleet host primary_ip to IP Address. The primary IP address of the device.

Mapping guidance

  • Start with one unique key: mapping so OnLink can identify whether to create or update an Assets object.

  • Add map: entries for each Fleet field you want to store in Assets.

  • Compare the Fleet sample JSON with the Assets object type attributes before running an import.

  • If a value is nested in the JSON response, inspect the sample output carefully and use the field path supported by the OnLink mapping configuration.

6. Validate and run the import

  1. Use Get Data to preview the data returned by Fleet.

  2. Confirm that the sample records contain the expected fields and values.

  3. Use Get Data to preview the data returned by Fleet.

  4. Review object type mappings and attribute names for spelling and case consistency.

  5. Run the import only after the previewed data and mapping are correct.

Optional filtering

Use Fleet API query parameters to limit the records returned by the endpoint. For supported filters, refer to the Fleet API documentation for the endpoint you are using.

For supported filters, see the Fleet https://fleetdm.com/docs/rest-api/rest-api#list-hosts.

Example: to filter on hosts that are online, add this query parameter:

status=online