Nov 02, 2016 Composer for OS X and Jamf Pro. Jamf Pro Overview Demo - Duration: 6:08. Jamf 17,335 views. Mac image deployment - Create Custom package. Deploying a Package Policy with Jamf.
- Mac Os X 10.7 Download Free
- Mac Os X Update
- Mac Os X Versions
- Create A Mac Os X Package For Jamf 7
- Create A Mac Os X Package For Jamf 10
- Create A Mac Os X Package For Jamf Pro
This project is a reference implementation to build a Slack interface to Jamf Pro. It could be used for most any REST endpoint though if you wanted to pull the logic for handling the Jamf URI structure. Because I’m still trying to figure out where to hide secrets in slack, it requires an API gateway. I’ll hopefully remove that requirement in a future iteration. If there is a future iteration. It’s really just meant for reference. Add to it, remove from it, mock it, whatevers… <3
Usage
Basically you send it a /q followed by an endpoint and it spits out json. Syntax is pretty much as follows:
/q
As an example, let’s say you wanted to query computers for a list of devices, simply enter:
/q computers
Based on the list of devices, if you wanted to query for device id 8 then run:
![Create A Mac Os X Package For Jamf Create A Mac Os X Package For Jamf](/uploads/1/2/6/5/126582852/681989850.png)
/q computers 8
To see a full list of endpoints, check out https://developer.jamf.com/apis/classic-api/index.
Installation
The general steps you’ll follow to get this Slack Bot working are as follows:
- Perform dependency installs
- Download the code
- Prep node app.js
- Create .env file in root folder
Dependencies
First, let’s prep the host. Per the package.json file, the packages you’d need to install (e.g. via npm) include:
⋅⋅* “async”: “^3.1.0”,
⋅⋅* “axios”: “^0.19.0”,
⋅⋅* “chalk”: “^2.4.2”,
Mac Os X 10.7 Download Free
⋅⋅* “cheerio”: “^1.0.0-rc.3”,
⋅⋅* “dotenv”: “^8.1.0”,
⋅⋅* “express”: “^4.17.1”,
⋅⋅* “fs”: “0.0.1-security”,
⋅⋅* “logger”: “0.0.1”,
⋅⋅* “moment-timezone”: “^0.5.27”,
⋅⋅* “mysql2”: “^1.7.0”,
⋅⋅* “path”: “^0.12.7”,
⋅⋅* “request”: “^2.88.0”,
![Mac Mac](/uploads/1/2/6/5/126582852/417231737.png)
⋅⋅* “rollbar”: “^2.13.0”,
⋅⋅* “sequelize”: “^5.19.6”,
⋅⋅* “slack-node”: “^0.1.8”,
⋅⋅* “xml-js”: “^1.6.11”
Building the Project
Next, download all the files in this project. Then we’ll start by editing the .env file in the project. These settings include the following:
⋅⋅*PORT = 3000
⋅⋅*NODE_ENV = development
⋅⋅*SLACK_AUTH_TOKEN = <this is an auth token that we’ll grab later in this readme>
⋅⋅*POST_SERVER_ITEM_ACCESS_TOKEN = <this is a bot token that we’ll grab later in this readme>
Mac Os X Update
⋅⋅*USERNAME=
⋅⋅*PASSWORD=
⋅⋅*API_END_POINT = <replace with the URL to your API, like https://krypted.jamfcloud.com/JSSResource>
Setup In Your Slack Instance
Mac Os X Versions
We’ll come back here and put in the auth token and server item so no need to know those juuuust yet. Next, we’ll create the app in Slack. To do so, browse to https://api.slack.com/apps and click on New Slack App. Provide a name for the app and enter the Development Slack Workspace that you’ll be installing the app into. I’d recommend using a development space before promoting to your master Slack instance. Once you’ve selected the appropriate information, click Create App.
Create A Mac Os X Package For Jamf 7
Next, let’s create the bot user. For this, click on Bot Users in the app sidebar and then provide a name for the bot. This is what the response will appear as in Slack when you run a query. So you might say “Jamf Pro” or “Daneel” or “Siri” but it will look like a Slack user is responding with some information about the endpoint being queried so this is what that response displays as. Click Save to commit those changes.
Create A Mac Os X Package For Jamf 10
Now click Edit Command. This is where we call the app we just uploaded. I use /q as my command (for query) but you can choose to use something else (my initial tests used /askjamf but that was too much typing as I’m kinda’ lazy). The bot has been taught to return with a list if there’s no parameter provided or informaton about a specific object if there is a param. So you can put that text in there or leave it blank. The Request URL is the most important thing here. That’s the URL to the .js app.
Create A Mac Os X Package For Jamf Pro
Next, click on “Oauth & Permissions”Here, copy the OAuth Access Token into that SLACK_AUTH_TOKEN field in the .env file and then click Save again. Almost done. Next you’ll need the POST_SERVER_ITEM_ACCESS_TOKEN. Per https://docs.rollbar.com/docs/nodejs, that is in your rollbar config.
It’s pretty common to use keys for ARD for shuttling data back and forth. In an environment where you’re using one tool to image computers and another tool to then perform patch management, the Computer Information fields in ARD are a place where you can keep this information and not run the risk of it getting overwritten with a software update. In the past few weeks we’ve looked at importing information into DeployStudio, using a csv file and from the command line. We also looked at populating those ARD fields with scripts, using an example of populating the information with the username or computername and then keying administrative users from that.But in many environments, once the system has been imaged, it needs to move into a mode of patch management. Having this data already in the ARD fields (or a custom plist you drop somewhere else in the system such as /Library/Preferences) then allows you to easily have information follow the computer from the moment you get the serials (cradle) to the retirement of the device (grave). To import information into Casper, we’re going to use the jamf command with the recon verb. Recon will use an -endUsername option that populates the user who has the computer based on the first field in ARD, which we have populated with the users shortname from our directory service./usr/sbin/jamf recon -endUsername $(defaults read /Library/Preferences/com.apple.RemoteDesktop Text1)jamf can also be used to create accounts, be they administrative (-admin), hidden from the list at LoginWindow and the Accounts System Preference pane (-hidden), SSH-only (-secureSSH) or standard user accounts. If you don’t already have access to log into the host via recon, once you have the Casper package installed, create an account. For this example, we’ll use jamfadmin as the username (replacing MySecretPassword with your desired password):
/usr/sbin/jamf createAccount -username jamfadmin -realname “JAMF Administrative Account” -password MySecretPassword –home /var/jamfadmin -hiddenUser -admin -secureSSHAnd if you wanted to also create a user with administrative rights, rather than use our previous options, you could run the following, which would create the information based on the ARD fields rather than an Open Directory account (thus leveraging a local pull of a mobile home of a sort, or replacing the mobile home functionality if you don’t have a directory service):
/usr/sbin/jamf createAccount -username $(defaults read /Library/Preferences/com.apple.RemoteDesktop Text1) -realname “$(defaults read /Library/Preferences/com.apple.RemoteDesktop Text2)” -password MySecretPassword –home /Users/$(defaults read /Library/Preferences/com.apple.RemoteDesktop Text1) -admin