This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the script content of a Jamf Pro Extension Attribute called | |
# "slack - :lock: Security Health Status" | |
# Because it has "slack -" in its title, our /jamf Slack app will display the output of its results in each Mac's health summary report. | |
# It checks to see if the Mac has SIP and FV enabled and is running the required 3rd party AV agent | |
# Based on the results, it displays the appropriate emoji and also provides appropriate links to relevant kb articles or Jamf Self Service policies. | |
# Author: @taniacomputer | |
# Last modified: 4/12/2019 | |
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# slackapp_idSearch.py | |
# This function is invoked by an SNS topic | |
# and runs a Jamf Pro equivalent of a computer id search, | |
# formatting the results and sending them back to Slack | |
# Author: @taniacomputer | |
# Last modified: 20/11/2019 | |
import json | |
import boto3 | |
from botocore.vendored import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# slackapp_run_matchSearch.py | |
# This function is invoked by an SNS topic | |
# and runs a Jamf Pro equivalent of an advanced search | |
# formatting the results and sending them back to Slack | |
# Author: @taniacomputer | |
# Last modified: 20/11/2019 | |
import json | |
from botocore.vendored import requests | |
import boto3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# slackapp_initial_slash_command_invoked.py | |
# This function is invoked from a Slack slash command | |
# It verifies the request, responds to it, and invokes the SNS topic for the | |
# second lambda function, if required. | |
# Author: @taniacomputer | |
# Last modified: 20/11/2019 | |
import json | |
import hashlib | |
import hmac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from urllib import parse as urlparse | |
def lambda_handler(event, context): | |
message_from_slack = dict(urlparse.parse_qsl(event["body"])) | |
response_url = message_from_slack["response_url"] | |
message_for_slack = "*Request received from Slack slash command:*\n" + str(event) + "\n\n*Request body _before_ decoding:*\n" + event["body"] + "\n\n*Request body _after_ decoding:*\n" + str(message_from_slack) | |
response_json = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WEBHOOK_URL=<SLACK WEBHOOK URL> | |
IMAGE=<EXTERNALLY HOSTED IMAGE> | |
JSS=<JSS ADDRESS> | |
# API Account that has read access to Jamf Pro Server Objects > Computers | |
API_USER=<API USERNAME> | |
API_PW=<API PASSWORD> | |
UDID=$(system_profiler SPHardwareDataType | grep "UUID" | sed s/"Hardware UUID: "/''/g | sed 's/^ *//') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SLACK_WEBHOOK="https://hooks.slack.com/services/A123456" | |
IMAGE="https://<s3bucket>/MBPJamf.png" | |
SSID="acme-wifi" | |
danger=0 | |
computer_name=$(scutil --get ComputerName) | |
primary_user=$(cat /etc/.seek) | |
title="SEEK Setup Completed for *$computer_name*" | |
text="*JSS ID:* $JSS_ID\n*Primary User:*" |