Skip to content

Instantly share code, notes, and snippets.

View grahampugh's full-sized avatar

Graham Pugh grahampugh

View GitHub Profile
@grahampugh
grahampugh / Firefox.jamf.recipe.yaml
Created May 13, 2022 08:22
Firefox.jamf recipe in YAML format
Description: |
Downloads the latest version of Firefox and makes a pkg. Then, uploads the package to the Jamf Pro Server and creates a Self Service Policy and Smart Group.
Identifier: com.example.jamf.Firefox
MinimumVersion: "2.3"
ParentRecipe: com.github.autopkg.pkg.Firefox_EN
Input:
NAME: Firefox
CATEGORY: Productivity
GROUP_NAME: "%NAME%-update-smart"
@grahampugh
grahampugh / PolicyTemplate.xml
Created May 13, 2022 08:14
PolicyTemplate for a standard JSS recipe
<policy>
<general>
<name>Install Latest %PROD_NAME%</name>
<enabled>true</enabled>
<frequency>Ongoing</frequency>
<category>
<name>%POLICY_CATEGORY%</name>
</category>
</general>
<scope>
@grahampugh
grahampugh / SmartGroupTemplate.xml
Created May 13, 2022 08:13
SmartGroupTemplate for a standard jss recipe
<computer_group>
<name>%group_name%</name>
<is_smart>true</is_smart>
<criteria>
<criterion>
<name>Application Title</name>
<priority>0</priority>
<and_or>and</and_or>
<search_type>is</search_type>
<value>%JSS_INVENTORY_NAME%</value>
@grahampugh
grahampugh / Firefox.jss.recipe
Created May 13, 2022 08:10
Firefox.jss recipe in plist format
<?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>Description</key>
<string>Downloads Firefox disk image and builds a package, then uploads to the JSS..</string>
<key>Identifier</key>
<string>com.example.jss.Firefox</string>
<key>Input</key>
<dict>
@grahampugh
grahampugh / Firefox.jss.recipe.yaml
Created May 13, 2022 08:08
Firefox.jss recipe in yaml format
Description: |
Downloads Firefox disk image and builds a package, then uploads to the JSS.
Identifier: com.example.jss.Firefox
ParentRecipe: com.github.autopkg.pkg.Firefox_EN
MinimumVersion: "2.3"
Input:
NAME: Firefox
CATEGORY: Productivity
GROUP_NAME: "%NAME%-update-smart"
@grahampugh
grahampugh / Jamf Cloud Package Upload.bash
Last active May 6, 2022 19:17
Bash code to upload a package to Jamf Cloud
#!/bin/bash
# Jamf Cloud URL and credentials
url="https://somecompany.jamfcloud.com"
user=SOMEUSER
pass=SOMEPASSWORD
# path to the package to be uploaded
pkg_path="/path/to/somepackage.pkg"
@grahampugh
grahampugh / README.md
Last active January 26, 2022 15:24
Test the Jamf Pro dbfileupload endpoint.

Usage

dbfileupload.sh --jss someserver --user username --pass password --pkg /path/to/pkg.pkg

(don't include https:// or .jamfcloud.com)

@grahampugh
grahampugh / fix_log4j.sh
Last active December 17, 2021 09:52
Replaces vulnerable log4j jars in a multi-context Jamf instance
#!/bin/bash
: <<DOC
https://docs.jamf.com/technical-articles/Mitigating_the_Apache_Log4j_2_Vulnerability.html
deletes:
/usr/share/tomcat8/webapps/*/WEB-INF/lib/log4j-1.2-api-2.13.3.jar
/usr/share/tomcat8/webapps/*/WEB-INF/lib/log4j-api-2.13.3.jar
/usr/share/tomcat8/webapps/*/WEB-INF/lib/log4j-core-2.13.3.jar
/usr/share/tomcat8/webapps/*/WEB-INF/lib/log4j-slf4j-impl-2.13.3.jar
@grahampugh
grahampugh / AutoPkg-verify-trust-info.sh
Created June 10, 2020 13:12
Runs through a recipe list and verifies trust info. Creates a trusted recipe list and sends untrusted recipes to a Slack incoming web hook.
#!/bin/bash
#
# AutoPkg verify trust of existing recipes
# by Graham Pugh
# server name, used as the username in Slack
server="$1"
# slack webhook, e.g. https://hooks.slack.com/services/ASBCDSDAD/SDFGASDF/SDFAvSDfASDFvsdfA
slack_webhook_url="$2"
@grahampugh
grahampugh / privileges-time-limited-elevation.sh
Created May 20, 2020 13:56
A script for Jamf Pro Self Service to grant time-limited elevated user rights
#!/bin/bash
## Privileges time-limited elevation
## v. 0.1 - G. Pugh 2020-05-20
# Sets admin privileges for defined number of minutes
duration_minutes=$4
# Privileges installer policy trigger name
policy_trigger_name="Privileges-install"