Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/mdl.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
},
{
"pattern": "^https://datatracker.ietf.org"
},
{
"pattern": "^https://.*jamf.com"
}
],
"replacementPatterns": [
Expand Down
267 changes: 77 additions & 190 deletions tutorials/connect-fleet-dm-to-smallstep.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ html_title: Integrate Fleet DM with Smallstep Tutorial
description: Connect Fleet DM with Smallstep for device security. Complete guide for deploying certificates and syncing device inventory using Fleet's device management platform.
---

Smallstep can integrate with [Fleet DM](https://fleetdm.com/) to deploy certificates to your Fleet-managed devices. Fleet has a native Smallstep integration that makes it easy to configure Dynamic SCEP for certificate enrollment.
Smallstep can integrate with [Fleet DM](https://fleetdm.com/) to deploy certificates to your Fleet-managed devices.

In this document, we will configure your Fleet instance for use with your Smallstep team.

Expand All @@ -18,7 +18,7 @@ You will need:

Client requirements:

- For SCEP certificate enrollment, devices must be MDM-enrolled in Fleet
- For enrollment, devices must be MDM-enrolled in Fleet
- The Smallstep agent will need to reach the following domains:
```
smallstep.com
Expand All @@ -33,13 +33,16 @@ Client requirements:

Supported platforms:

- macOS, iOS, iPadOS (via `.mobileconfig` profiles)
- macOS — Smallstep agent and osquery extension for full device identity sync, with configuration provided through a `.mobileconfig` profile
- Linux (via agent software deployment)
- Windows Pro or Enterprise — Fleet does not yet support its native Smallstep CA type on Windows, so Windows enrollment goes through Smallstep's NDES-compatible endpoints, configured in Fleet as a Dynamic SCEP CA.

# Apple devices (macOS, iOS, iPadOS)
# macOS

This flow uses Fleet's native Smallstep CA integration. Devices receive a SCEP certificate via a `.mobileconfig` profile, and the Smallstep agent (on macOS) takes over from there.
macOS enrollment combines two pieces:

- A `.mobileconfig` profile, generated by Smallstep and imported into Fleet, that bootstraps the Smallstep agent, which then takes over enrollment.
- The Smallstep osquery extension registers additional device identity information directly in Fleet, for a richer device inventory and seamless enrollment experience.

## Step 1. Get a Fleet API token

Expand Down Expand Up @@ -92,204 +95,69 @@ The default role for API-only users is **Observer**, which grants read-only acce
</div>
</Alert>

## Step 2. Connect Fleet to Smallstep

## Step 2. Create a Smallstep enrollment report in Fleet

Create a Fleet report to collect the enrollment data. Smallstep reads this report during device sync to include additional device identity details alongside the standard Fleet device inventory.

1. In Fleet, go to **Reports**
2. Ensure **All Fleets** is active. If not, the report won't apply to all your hosts.
3. Click **Add report**
4. Enter the following query:

```sql
SELECT * FROM smallstep_enrollment;
```
5. Click **Save**; a modal should appear
6. In the modal, enter the following details:
- A **Name** for the query, such as "Smallstep Enrollment"
- Optionally, a **Description**
- The **Interval** can be set to **Every hour**. While testing, a shorter interval is helpful
- Optionally, enable the **Observers can run** checkbox
- Enable **macOS** as **Target**
- Select **All hosts**
7. Click **Save**
8. Note the numeric ID of the Smallstep enrollment report that was just created

## Step 3. Connect Fleet to Smallstep

Now you'll add your Fleet API credentials to Smallstep.

1. In the Smallstep console, go to [**Settings → Device Management**](https://smallstep.com/app/?next=/settings/devices)
2. Under Available Providers, find **Fleet** and click **Connect**
3. Fill in the fields:
- **Name/Alias**: An optional identifier for this connection (for example, `Production Fleet`)
- **API Base URL**: Your Fleet server URL (for example, `https://fleet.example.com`)
- **API Token**: Paste the API token from the previous step
- **Name/Alias**: An optional identifier for this connection (for example, `Production Fleet`)
- **Enrollment Query ID**: The numeric ID of the Fleet enrollment report from the previous step
4. Click **Connect MDM**
5. After connecting, temporarily save the following values:
- **SCEP URL** (for example, `https://your-team.scep.smallstep.com/p/agents/integration-fleet-abc123`)
- **SCEP Challenge URL** (for example, `https://your-team.scep.smallstep.com/webhook/abc123-def4-5678-9abc-def012345678/challenge`)
- **Challenge Username**
- **Challenge Password**
- Under **Authority Certificates**, download the Root CA certificate.

Within a few minutes, you will see your Fleet devices in the [Devices](https://smallstep.com/app/?next=/devices/all) tab. Your Smallstep device inventory syncs from Fleet approximately every four hours.

## Step 3. Add the Smallstep Certificate Authority in Fleet

Now we'll add the Smallstep SCEP credentials to Fleet.
Within a few minutes, you will see your Fleet devices in the [Devices](https://smallstep.com/app/?next=/devices/all) tab. Your Smallstep device inventory syncs from Fleet approximately every eight hours.

1. In Fleet, go to **Settings** (click your profile icon in the top right)
2. Navigate to **Integrations → Certificate authorities**
3. Click **Add CA**
4. From the dropdown, select **Smallstep**
5. Fill in the fields:
- **Name**: A unique identifier using letters, numbers, and underscores only (for example, `SMALLSTEP_AGENT`). Fleet will create configuration profile variables with this name as a suffix.
- **SCEP URL**: Paste the SCEP URL from Smallstep
- **Challenge URL**: Paste the SCEP Challenge URL from Smallstep
- **Username**: Paste the Challenge Username from Smallstep
- **Password**: Paste the Challenge Password from Smallstep
6. Click **Add CA**
## Step 4. Download the configuration profile

Fleet will test the CA connection after you create it.

<Alert severity="info">
<div>
If you plan to use GitOps instead of the Fleet UI, skip this step and see the [GitOps section below](#gitops-configure-fleet-with-fleetctl) for the YAML-based alternative.
</div>
</Alert>
Fleet deploys certificates and configuration to devices using a configuration profile. You can download this from the Smallstep dashboard and upload it to Fleet. No need to build the payloads or paste certificate data by hand.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description notes that the .mobileconfig from the web console currently still has to be tweaked manually for this flow to work — specifically (1) removing the Certificate key and (2) setting CAFingerprint to the SHA256 of the agent's root. That seems to contradict the "No need to build the payloads or paste certificate data by hand" instruction here (and the "bundles everything required" follow-up on line 147).

Should these steps document the manual Certificate removal and CAFingerprint change, or is the console expected to emit a ready-to-upload profile before this merges? Want to make sure we're not shipping instructions that won't work end-to-end yet.

(Note: the Jamf doc has the equivalent "no need to build the payloads by hand" claim on its line 136 — may warrant the same caveat if it applies there too.)

@hslatman hslatman Jul 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console is expected to fill the correct info. That change won't be online before this gets tested, though. So just manual for now, and this can be merged after.

For Jamf there's no need to change it, as it still uses SCEP in that case.


## Step 4. Create SCEP configuration profiles

Fleet deploys certificates to devices using configuration profiles. You'll need to create profiles that include the SCEP payload with Fleet's dynamic variables.

For macOS, iOS, and iPadOS, Fleet provides these variables for Smallstep certificate enrollment:

| Variable | Description |
|----------|-------------|
| `$FLEET_VAR_SMALLSTEP_SCEP_CHALLENGE_SMALLSTEP_AGENT` | The dynamic SCEP challenge string |
| `$FLEET_VAR_SMALLSTEP_SCEP_PROXY_URL_SMALLSTEP_AGENT` | The SCEP proxy URL for certificate requests |
| `$FLEET_VAR_SCEP_RENEWAL_ID` | A unique renewal identifier for the device |
| `$FLEET_VAR_HOST_END_USER_EMAIL_IDP` | The end user's email from the identity provider |

If you used a different name when adding the CA in Fleet, replace `SMALLSTEP_AGENT` accordingly.

### SCEP profile (`smallstep-agent.mobileconfig`)

Create a file called `smallstep-agent.mobileconfig` with the following structure.

This profile contains three payloads:

1. **SCEP payload**: Issues a provisional SCEP certificate that the Smallstep agent uses for bootstrapping into a Device Attested environment
2. **Root CA trust payload**: Installs the Smallstep Agent Root CA so the agent can validate its certificate chain.
To create this payload, open the downloaded `.pem` file in a text editor and copy the Base64-encoded certificate contents (everything between `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`, not including those lines)
You will paste this value inside the `<data>` field of the Root CA trust payload below.
3. **Agent Configuration**: A configuration payload for the Smallstep Agent that includes your Smallstep team slug.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<!-- Payload 1: SCEP Certificate Enrollment -->
<dict>
<key>PayloadDisplayName</key>
<string>Smallstep SCEP</string>
<key>PayloadIdentifier</key>
<string>com.smallstep.scep</string>
<key>PayloadType</key>
<string>com.apple.security.scep</string>
<key>PayloadUUID</key>
<string>C15F6CB6-473E-4B66-9B5B-A7B01C07152F</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadContent</key>
<dict>
<key>Challenge</key>
<string>$FLEET_VAR_SMALLSTEP_SCEP_CHALLENGE_SMALLSTEP_AGENT</string>
<key>Key Type</key>
<string>RSA</string>
<key>Key Usage</key>
<integer>5</integer>
<key>Keysize</key>
<integer>2048</integer>
<key>Subject</key>
<array>
<array>
<array>
<string>CN</string>
<string>step-agent-bootstrap</string>
</array>
</array>
<array>
<array>
<string>OU</string>
<string>$FLEET_VAR_SCEP_RENEWAL_ID</string>
</array>
</array>
</array>
<key>URL</key>
<string>$FLEET_VAR_SMALLSTEP_SCEP_PROXY_URL_SMALLSTEP_AGENT</string>
</dict>
</dict>
<!-- Payload 2: Smallstep Agent Root CA Trust -->
<dict>
<key>PayloadDisplayName</key>
<string>Smallstep Agent Root CA</string>
<key>PayloadIdentifier</key>
<string>com.smallstep.root-ca</string>
<key>PayloadType</key>
<string>com.apple.security.pem</string>
<key>PayloadUUID</key>
<string>CCE7C356-A5DB-4796-86B5-E8DFAEA7F08E</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadContent</key>
<data>
<!-- Paste the Base64-encoded Root CA certificate here -->
</data>
</dict>
<!-- Payload 3: Smallstep Agent Settings -->
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.smallstep.Agent</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.smallstep.Agent.settings</string>
<key>PayloadUUID</key>
<string>EBEA31C0-C9A4-4862-A939-E16DA63DE35B</string>
<key>PayloadDisplayName</key>
<string>Smallstep Agent Settings</string>
<key>TeamSlug</key>
<string><team-slug></string>
<key>Certificate</key>
<string>mackms:label=step-agent-bootstrap;se=false;tag=</string>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Smallstep Agent</string>
<key>PayloadIdentifier</key>
<string>com.smallstep.Agent</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>18F9A37B-AEDB-4D9E-808F-F946ACBF3A46</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Smallstep Certificate</string>
<key>PayloadIdentifier</key>
<string>com.smallstep.certificate-profile</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>AD981C97-F3F4-41D8-996A-9DE254012810</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
```
1. In the Smallstep console, go to [**Settings → Device Management**](https://smallstep.com/app/?next=/settings/devices)
2. Open your Fleet connection, then choose the **Settings** tab
3. Under **Configuration Profile (macOS only)**, click **Download** to save the profile. The downloaded file is named `fleet-<connection-id>.mobileconfig`.

- If you used a different CA name in Fleet, replace `SMALLSTEP_AGENT` in the variable names accordingly.
- Replace the `<team-slug>` value with your Smallstep team slug
The downloaded profile bundles everything required to enroll a device: your root and intermediate CA certificates, the Smallstep agent settings, and the Login Items entry for the agent.

## Step 5. Upload the configuration profile to Fleet
## Step 6. Upload the configuration profile to Fleet

1. In the Fleet console, go to **Controls → OS settings → Configuration profiles**
2. Click **Add profile**
3. Upload your `smallstep-agent.mobileconfig` file
4. Scope the profile to the teams or labels containing your macOS, iOS, or iPadOS hosts
3. Upload the `fleet-<connection-id>.mobileconfig` file you downloaded in the previous step
4. Scope the profile to the teams or labels containing your macOS hosts

The profile will be deployed to devices at their next MDM check-in. Fleet automatically substitutes the `$FLEET_VAR_*` values per host.
The profile will be deployed to devices at their next MDM check-in.

## Step 6. Deploy the Smallstep agent (macOS)
## Step 7. Deploy the Smallstep agent

The macOS Smallstep agent picks up the bootstrap certificate from the keychain and uses it to register the device with Smallstep.
The macOS Smallstep agent picks up the configuration that Fleet deployed to the device, and uses it to register the device with Smallstep.

Deploy the agent using Fleet's [software deployment](https://fleetdm.com/guides/deploy-software-packages) feature:

Expand All @@ -299,20 +167,37 @@ Deploy the agent using Fleet's [software deployment](https://fleetdm.com/guides/

Alternatively, you can use a separate software management system such as [Munki](https://github.com/munki/munki) to deploy the agent. See the [Smallstep Agent manual installation guide](../platform/smallstep-agent.mdx#macos-installation) for detailed instructions.

iOS and iPadOS do not run the Smallstep agent — the SCEP certificate issued by the profile is the end of the flow on those platforms.
## Step 8. Deploy the osquery extension

Smallstep provides an osquery extension that registers additional device identity information directly in Fleet. When Smallstep syncs your device inventory from Fleet, it reads this data to enable a seamless enrollment experience on macOS.

1. Download the `step-agent-osquery` package for macOS from [Smallstep's releases](https://releases.smallstep.com).
1. In Fleet, go to **Software**
1. Click **Add software**. Ensure a fleet is selected; software is configured per-fleet
1. Select **Custom package**
1. Click **Choose file**, and select the `step-agent-osquery` package that was downloaded before
1. Enable **Deploy**
1. Click **Add software**.

A modal should appear, showing the package upload progress.

After upload, a Fleet policy is created that automatically triggers package installation if the package is not yet installed.

See https://fleetdm.com/guides/deploying-custom-osquery-extensions-in-fleet-a-step-by-step-guide for additional guidance and some troubleshooting options when deploying osquery extensions.

Alternatively, you can use a separate software management system such as [Munki](https://github.com/munki/munki) to deploy the osquery extension.

## Step 7. Confirmation (Apple)
## Step 9. Confirmation

To confirm certificate deployment:

1. In the Fleet console, go to **Hosts** and select an Apple device that received the profile
1. In the Fleet console, go to **Hosts** and select a macOS device that received the profile
2. Check the **OS settings** status to verify the profile was applied successfully
3. In the Smallstep console, go to [**Devices**](https://smallstep.com/app/?next=/devices/all) and confirm the device is enrolled with a certificate

On the device itself:

- **macOS**: Open **Keychain Access** and look for a certificate issued by your Smallstep authority
- **iOS / iPadOS**: Go to **Settings → General → VPN & Device Management** to view the installed profile
- Check the output of `/Applications/SmallstepAgent.app/Contents/MacOS/SmallstepAgent status`

# Linux

Expand Down Expand Up @@ -599,7 +484,7 @@ fleet-gitops/
├── teams/
│ └── team.yml
└── lib/
├── smallstep-agent.mobileconfig
├── fleet-<connection-id>.mobileconfig
└── smallstep-agent-setup.sh
```

Expand Down Expand Up @@ -633,13 +518,13 @@ export SMALLSTEP_CHALLENGE_PASSWORD='your-challenge-password'

## Add configuration profiles

In your team YAML file, reference the profile files:
Download the configuration profile for your Fleet connection from the Smallstep dashboard, as described in **Step 5** of the macOS section above, and place the `fleet-<connection-id>.mobileconfig` file in your `lib/` directory. Then reference it from your team YAML file:

```yaml
controls:
macos_settings:
custom_settings:
- path: ../lib/smallstep-agent.mobileconfig
- path: ../lib/fleet-<connection-id>.mobileconfig
```

## Add the Smallstep agent software
Expand Down Expand Up @@ -695,15 +580,17 @@ Add the Smallstep enrollment query to your team YAML. Fleet will collect results
```yaml
queries:
- name: Smallstep enrollment
description: Collects Smallstep enrollment data including TPM EK for device identity sync
description: Collects Smallstep enrollment data for device identity sync
query: SELECT * FROM smallstep_enrollment;
interval: 3600
platform: linux
platform: darwin,linux,windows
automations_enabled: true
logging: snapshot
discard_data: false
```

The `smallstep_enrollment` table is provided by the Smallstep osquery extension, which runs on macOS, Linux, and Windows. Restrict the `platform` list to the operating systems you deploy the extension to.

## Apply the configuration

Run `fleetctl gitops` to apply the configuration:
Expand Down
Loading
Loading