Skip to content

Commit 8c870c3

Browse files
authored
Merge pull request #436 from smallstep/max/jamf-restrict-identical-version
Add section on restricting Jamf re-deployment of identical version
2 parents 2b59ded + a823607 commit 8c870c3

File tree

1 file changed

+77
-16
lines changed

1 file changed

+77
-16
lines changed

tutorials/connect-jamf-pro-to-smallstep.mdx

Lines changed: 77 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ This API client will allow Smallstep to read your Jamf device inventory and mana
4444
1. In Jamf Pro, choose ⚙️ **Settings**
4545
2. Under the **System** tab, choose **API Roles and Clients**
4646
3. Add an **API Role**
47-
47+
4848
Display name: Smallstep
49-
49+
5050
For Privileges, choose:
51-
51+
5252
- Read Mobile Devices
5353
- Read Computers
5454
4. Next, in the **API Clients** tab, add a **Client**
@@ -118,12 +118,12 @@ This step will install a script on your client devices that bootstraps the conne
118118
2. In the Script tab:
119119
- Mode: `Shell/Bash`
120120
- Content:
121-
121+
122122
```console
123123
launchctl stop com.smallstep.launchd.Agent
124124
/Applications/SmallstepAgent.app/Contents/MacOS/SmallstepAgent svc install
125125
```
126-
126+
127127
4. Choose **Save**
128128

129129
#### Create an Agent Installation Policy
@@ -137,9 +137,9 @@ Next, we’ll configure the Script we just created to run on your client devices
137137
- Display name: Smallstep Agent
138138
- Trigger: Login
139139
- Execution Frequency: Ongoing
140-
140+
141141
*Note: With this policy, the package will be installed at the device’s next check-in, typically within 15 minutes.*
142-
142+
143143
2. Under Options → Packages → Configure
144144
- Choose the **Smallstep Agent** package you created earlier
145145
- Distribution Point: (choose desired distribution point)
@@ -159,7 +159,7 @@ In this step, we’ll tie everything together by creating a managed policy to en
159159
3. Download the Root Certificate
160160
4. Under the Provisioners section of the page, choose the provisioner beginning with **`integration-jamf`**
161161
5. Temporarily save the **URL shown on the page, eg.** `https://agents.example.ca.smallstep.com/scep/integration-jamf-b967f507`
162-
2. In the Smallstep dashboard, choose ⚙️ **Settings**
162+
2. In the Smallstep dashboard, choose ⚙️ **Settings**
163163
1. Temporarily save the **Team Slug** value
164164
3. In Jamf Pro, choose 🖥️ **Computers**
165165
4. Under the **Content Management** tab, Choose **Configuration Profiles**
@@ -182,15 +182,15 @@ In this step, we’ll tie everything together by creating a managed policy to en
182182
- Key Size: 2048
183183
- Allow all apps access: ☑️
184184
5. Select Options → Application & Custom Settings → External Applications
185-
185+
186186
Add new custom settings:
187-
187+
188188
- Options → External Applications → Source: Custom Schema
189189
- Options → External Applications → Preference Domain: `com.smallstep.Agent`
190190
- Options → External Applications → Custom Schema
191191
1. Choose Add Schema
192192
2. Copy the following JSON in to the window and choose Save
193-
193+
194194
```json
195195
{
196196
"title": "Smallstep Agent (com.smallstep.agent)",
@@ -211,7 +211,7 @@ In this step, we’ll tie everything together by creating a managed policy to en
211211
}
212212
}
213213
```
214-
214+
215215
- Options → External Applications → Custom Schema → Smallstep Details: Team: (paste the Team Slug you saved earlier)
216216
- Options → External Applications → Custom Schema → Smallstep Details: Certificate URI: `mackms:label=$PROFILE_IDENTIFIER;se=false;tag=`
217217
1. Finally, set the profile scope:
@@ -221,6 +221,67 @@ In this step, we’ll tie everything together by creating a managed policy to en
221221

222222
The devices that you scoped will receive a certificate and have the agent installed and running.
223223

224+
#### Configure Jamf to prevent re-deploying identical packages (optional)
225+
226+
By default, Jamf will attempt to re-deploy the configured package profile to every scoped Computer on a cadence. Each Computer will attempt to install the distributed package, regardless of any existing version already installed. The Smallstep Agent pkg has built in logic to skip any unnecessary install logic when the currently installed version matches the version being distributed. However, configuring Jamf to prevent identical package re-deploys can reduce wasted cycles across your entire fleet of managed computers as well as reduce resource usage of your Jamf tenant.
227+
228+
1. In Jamf Pro Configure an Extension Attribute that reports the currently installed version on each computers
229+
1. In Jamf Pro under Settings → Computer Management → Extension Attributes → New
230+
- Display Name: SmallstepAgent Version
231+
- Data type: String
232+
- Inventory display: General
233+
- Input Type: Script
234+
- Mode: Shell/Bash
235+
-
236+
```shell
237+
#!/bin/bash
238+
239+
APP="/Applications/SmallstepAgent.app"
240+
PLIST="$APP/Contents/Info.plist"
241+
242+
if [ -f "$PLIST" ]; then
243+
# Prefer marketing version, fall back to build number
244+
VERSION=$(/usr/bin/defaults read "$PLIST" CFBundleShortVersionString 2>/dev/null)
245+
if [ -z "$VERSION" ]; then
246+
VERSION=$(/usr/bin/defaults read "$PLIST" CFBundleVersion 2>/dev/null)
247+
fi
248+
echo "<result>$VERSION</result>"
249+
else
250+
echo "<result>Not Installed</result>"
251+
fi
252+
```
253+
- Save
254+
2. In Jamf Pro Create a new Smart Computer Group
255+
1. In Jamf Pro, go to Computers → Smart Computer Groups → New
256+
2. On the Computer Group tab
257+
- Display Name: Needs SmallstepAgent Version
258+
3. On the Criteria tab
259+
- Select "SmallstepAgent Version" from the available criteria
260+
- If "SmallstepAgent Version" is not visible in the initially displayed list, select "Show Advanced Criteria" to display a more complete list
261+
- Operator: Is
262+
- Value: <Current version of the SmallstepAgent pkg that was configured earlier in the Package Distribution step, e.g., '0.60.1'>
263+
- Save
264+
3. Restrict Smallstep Agent installation policy to the newly created Smart Computer Group
265+
1. In Jamf Pro, go to Computers → Profiles → Smallstep Agent
266+
2. From the Scope tab, choose Edit
267+
3. Choose Add, then choose the Computer Group tab
268+
4. Choose Needs SmallstepAgent Version
269+
5. Remove all other scopes
270+
6. Save
271+
272+
#### Upgrading / Downgrading the Smallstep Agent package
273+
274+
1. Update the package
275+
1. Download the new Smallstep Agent version
276+
2. Follow the steps in the section titled "Create an Agent Package for Distribution" above with the new version
277+
2. Update the Smart Computer Group criteria (optional)
278+
279+
This step is ony required if you have configured a Smart Computer Group.
280+
1. In Jamf Pro, go to Computers → Smart Computer Groups → Needs SmallstepAgent Version
281+
2. Choose the Criteria tab, then choose Edit
282+
3. Set the value to the new version that you uploaded in the previous step.
283+
4. Save
284+
224285
### Option 2: Install via a software management tool
225286

226287
If you're using a software management tool:
@@ -230,7 +291,7 @@ If you're using a software management tool:
230291
3. Create a user launch agent file on the endpoint, in `/Users/<USER>/Library/LaunchAgents/com.smallstep.launchd.Agent.plist` for the primary user of the device.
231292

232293
The Smallstep agent does not yet support multi-user deployments on macOS&mdash;it must be installed for a single user:
233-
294+
234295
```
235296
<?xml version="1.0" encoding="UTF-8"?>
236297
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -295,11 +356,11 @@ This step will install a script on your client devices that uninstalls the Small
295356
2. In the Script tab:
296357
- Mode: `Shell/Bash`
297358
- Content:
298-
359+
299360
```bash
300361
launchctl stop com.smallstep.launchd.Agent
301362
launchctl remove com.smallstep.launchd.Agent
302-
363+
303364
/Applications/SmallstepAgent.app/Contents/MacOS/SmallstepAgent svc uninstall
304365
rm -rf /Applications/SmallstepAgent.app
305366
if pkgutil --packages | grep -q com.smallstep.Agent; then
@@ -320,7 +381,7 @@ Next, we’ll configure the Script we just created to run on your client devices
320381
- Display name: Smallstep Agent Uninstall
321382
- Trigger: Recurring Check-in
322383
- Execution Frequency: Ongoing
323-
384+
324385
*Note: With this policy, the package will be removed at the device’s next check-in, typically within 15 minutes.*
325386

326387
2. Under Options → Scripts → Configure

0 commit comments

Comments
 (0)