Why API? Using the REST API in an education environment. JAMF Software, LLC



Similar documents
QuickStart Guide for Managing Mobile Devices. Version 9.2

QuickStart Guide for Mobile Device Management

QuickStart Guide for Mobile Device Management. Version 8.6

About This Document 3. Integration and Automation Capabilities 4. Command-Line Interface (CLI) 8. API RPC Protocol 9.

Jenkins XML API and Mobile Devices

Creating a generic user-password application profile

Copyright 2013, 3CX Ltd.

Fairsail REST API: Guide for Developers

How To Convert A Lead In Sugarcrm

Mobile Device Management Version 8. Last updated:

Product Manual. MDM On Premise Installation Version 8.1. Last Updated: 06/07/15

Sophos Mobile Control Technical guide

Lead Management in Sugar 7

QuickStart Guide for Client Management. Version 8.7

DiskPulse DISK CHANGE MONITOR

Qlik REST Connector Installation and User Guide

Secure Coding SSL, SOAP and REST. Astha Singhal Product Security Engineer salesforce.com

Mobility Manager 9.5. Users Guide

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

SAP Cloud Identity Service Document Version: SAP Cloud Identity Service

Tivoli Endpoint Manager BigFix Dashboard

An Oracle White Paper June RESTful Web Services for the Oracle Database Cloud - Multitenant Edition

QualysGuard WAS. Getting Started Guide Version 4.1. April 24, 2015

Version /10. Xerox ColorQube 9301/9302/9303 Internet Services

SSLSmart Smart SSL Cipher Enumeration

Business Application Development Platform

An Introduction To The Web File Manager

NMS300 Network Management System

Wind River. Intelligent Device Platform XT EMS Profile EMS DEVICE MANAGEMENT USER'S GUIDE WIND RIVER 1.0

User's Manual. Intego VirusBarrier Server 2 / VirusBarrier Mail Gateway 2 User's Manual Page 1

Data Mailbox. support.ewon.biz. Reference Guide

TOTAL DEFENSE MOBILE SECURITY USER S GUIDE

WebSpy Vantage Ultimate 2.2 Web Module Administrators Guide

QuickStart Guide for Managing Computers. Version 9.2

User Guide. Version 3.2. Copyright Snow Software AB. All rights reserved.

Marketing Rockstar s Guide to Marketo

ISL Online Integration Manual

WWPass External Authentication Solution for IBM Security Access Manager 8.0

Apple Client Management with JAMF. Andrew D Huston Client Infrastructure Group Informa8on Services Kent State University

Publishing Reports in Tableau

A Quick Introduction to Google's Cloud Technologies

McAfee Web Gateway Administration Intel Security Education Services Administration Course Training

Intel HTML5 Development Environment. Tutorial Building an Apple ios* Application Binary

Sophos Mobile Control Installation guide. Product version: 3

Using the Cisco OnPlus Scanner to Discover Your Network

Build it with Drupal 8

Building a BYOD Program Using the Casper Suite. Technical Paper Casper Suite v9.4 or Later 17 September 2014

XIA Configuration Server

FireEye App for Splunk Enterprise

Table of Contents. Search Results.21. Equipment Change Request...10 Equipment Removal Request...11 Disposed..12 Not found 12

ios Deployment Simplified FileMaker How To Guide

Cloud Elements! Events Management BETA! API Version 2.0

Your Mission: Use F-Response Cloud Connector to access Google Apps for Business Drive Cloud Storage

Selenium An Effective Weapon In The Open Source Armory

Living Requirements Document: Sniffit

Slide.Show Quick Start Guide

Sophos Mobile Control Administrator guide. Product version: 3.6

Quick Start Guide. Installation and Setup

SOA Software API Gateway Appliance 7.1.x Administration Guide

BarTender Integration Methods. Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER

Grandstream Networks, Inc.

AVG Business SSO Partner Getting Started Guide

QualysGuard WAS. Getting Started Guide Version 3.3. March 21, 2014

RP Pocket PC Scanner Reference Manual For PPT8800

Introduction to Stanford Box

Sophos Mobile Control Startup guide. Product version: 3.5

PAW Web Filter Version 0.30 (release) This Software is Open Source. project.sourceforge.net

Portal Version 1 - User Manual

Electronic Ticket and Check-in System for Indico Conferences

Sophos Mobile Control User guide for Android

KonyOne Server Prerequisites _ MS SQL Server

AdRadionet to IBM Bluemix Connectivity Quickstart User Guide

Executive Summary On IronWASP

Cloud Elements ecommerce Hub Provisioning Guide API Version 2.0 BETA

U of S Course Tools. Working with the Syllabus Tool For Instructors

Work with PassKey Manager

Google Drive: Access and organize your files

REDCap General Security Overview

SSLSmart Smart SSL Cipher Enumeration

Quick Start Guide Mobile Entrée 4

Mobile Device Management Version 8. Last updated:

SHIPSTATION / MIVA MERCHANT SETUP GUIDE

Getting Started Guide for Developing tibbr Apps

The Automatic HTTP Requests Logging and Replaying Subsystem for CMS Plone

Sabre Red Apps. Developer Toolkit Overview. October 2014

Protecting the Infrastructure: Symantec Web Gateway

Junos Space. Service Now User Guide. Release Published: Copyright 2013, Juniper Networks, Inc.

Copyright 2013, 3CX Ltd.

Uploading Ad Cost, Clicks and Impressions to Google Analytics

Sophos Mobile Control Installation guide. Product version: 3.5

Shipbeat Magento Module. Installation and user guide

Casper Suite. Security Overview

Egnyte Single Sign-On (SSO) Installation for OneLogin

Transcription:

Why API? Using the REST API in an education environment.

Brad Schmidt Technical Services Operations Manager Hopkins Public Schools

Why API? Presentation agenda: Briefly - What is an API? What is the JSS API? How I ve used the API in my environment Lessons Learned, things to watch out for Resources Q&A

Let s talk to our JSS Copyright: Lucas Films - Thanks George/Disney?

What s an API? It stands for Application Programming Interface The JSS API lets us communicate with the JSS using a script or a program Safe(r) than going right to MySQL Eas(ier) than going right to MySQL

CRUD - Create, Read, Update, Delete Use HTTP to make the connection POST - Create objects GET - Read objects PUT - Update an existing object DELETE - Delete an object

Be careful what you say Copyright: Lucas Films - Thanks George/Disney?

Ways to communicate All methods use the HTTP protocol Python - requests, python-jss, httplib Bash/Shell - curl Ruby - jss-api gem Browser - https://dev.jss.com:8443/api

Python example using requests (tiny) >>> import requests >>> r = requests.get('https://jss.com:8443/jssresource/categories', auth=( user, pass )) >>> print r.text

Python example using requests >>> import requests >>> r = requests.get('https://jss.com:8443/jssresource/ categories', auth=( user, pass )) >>> print r.text

Bash example using requests (tiny) $ curl -u username:password https://jss.com:8443/jssresource/categories/

Bash example using requests $ curl -u username:password https://jss.com: 8443/JSSResource/categories

Example XML returned <categories> <category> <id>53</id> <name>brad s cool scripts</name> </category> <category> <id>40</id> <name>brad s cool packages</name> </category> </categories>

JSON and XML GET JSON and XML POST/PUT XML only Both are markup languages - Think HTML XML seems easier to work with in BASH JSON seems easier to work with in Python It comes down to personal preference

Acting on the data Now what? Get information from the JSS, work with the data in a script, send data back to the JSS. Import data into the JSS Export data from the JSS

Your logo here

Example 1 - Import Asset Tags Request: Have all the asset tags in the JSS CSV provided from vendors Obviously not going to hand enter No import function in the JSS

Example 1 - Import Asset Tags Solution: Script to import the tags using API Get a list of devices without asset tags Update the record with the asset tag Find the serial number in the CSV and return the asset tag

Example 1 - Import Asset Tags JSS:Advanced search API GET devices without asset tags The script takes each record and checks for it by serial number in the CSV. The script uses the API PUT command to update the device record with the found asset tag

Example 1 - Import Asset Tags Benefits: We now have asset tags in our JSS Helpful to do other cool things with the JSS.

Example 1 - Import Asset Tags

Example 2 - Wipe a $%# (lot) of ipads Request: We need to wipe 10,000+ ipads Option 1: Have techs do it one by one Option 2: Have students do it (My pref) Option 3: Create a script to wipe them Option 4: Wipe them all at once via API

Example 2 - Wipe a $%# (lot) of ipads Solution: Barcode Scanner + Script Create a bash script and present a GUI input window asking for the asset tag Use a barcode scanner to input the tag The script triggers a wipe command

Example 2 - Wipe a $%# (lot) of ipads Script launches a dialog window that asks for an asset tag Look up the device in the JSS and get the serial number. API GET Send an API PUT command with XML to trigger a wipe command, JSS issues the wipe

Example 2 - Wipe a $%# (lot) of ipads Benefits: The device is wiped on your terms The script triggers a wipe command Opens other options like processing repairs

Actual footage:

Example 3 - Process locked ipads Request: Exclude students from Config Profile Students get locked into Notes when they download a restricted app Security and training implications Existing workflow is a hassle

Example 3 - Process locked ipads Solution: Create an app to help process Written using Python and TKinter Anyone can use Uses the JSS match function

Example 3 - Process locked ipads Smart Group in JSS reads EA value. Smart Group is excluded from scope of CP GUI asks for search criteria, finds device and changes EA value on device Staff member removes restricted app. Presses update button in GUI An update inventory command is issued and the EA is cleared - API PUT JSS sends command to remove profile since the scope changed; restriction removed

Example 3 - Process locked ipads

Example 3 - Process locked ipads Benefits: Only certain staff members get access Not prone to error Much faster process

Example 4 - vshare Request: What is vshare? Get rid of it! A method to install pirated apps Apps can contain malware Installs as an in-house app with a provisioning profile

Example 4 - vshare Solution: Find them and wipe them Detect vshare E D I N D E Set an Extension Attribute Send the wipe command Send an email

Example 4 - vshare Advanced Search in the JSS looking for devices with vshare Script gets the list of devices in the using API GET Script sends an email Script changes an EA value so it falls out of the Advanced Search API PUT Script sends the remote command to wipe the device API PUT

Example 5 - Get to know your JSS Request: Identify the impact of a bug in the JSS Double and single quotes were being escaped in the advanced command field of policies Needed a list of policies since we had over 500

Example 5 - Get to know your JSS Solution: Bash script to get URLs of policies Used Curl to download all policies Used Bash to filter out polices with quotes Returned a list of policies and their URL, command, and policy name

Example 5 - Get to know your JSS Script to get a list of policies API GET Bash parses through list and returns the values I want

Example 6 - My latest creation Request: Key people need reports from the JSS Export/send these reports manually. Ugh! I could give them credentials to the JSS Link to another reporting system

Example 6 - My latest creation Solution: Use the Google Sheets API I developed a Python script to export any Advanced Search to a Google Sheet Downloads the data from JSS, uploads data to the Google Sheet

Example 6 - My latest creation Create any advanced device search in the JSS Script looks up the devices in advanced search API GET Script opens a connection to a Google Sheet Sheets API Script updates the Sheet with the headers and values of the search

Example 6 - My latest creation Benefits: I no longer need to run these reports manually No need to train users Least privilege Reports sent on time

Screenshot

Lessons Learned The road can be bumpy Come up with the logic, then script Have a development JSS with your prod data You can come across bugs in the API Use git/version control & test often!

Lessons Learned, cont. This stuff can be hard to share Some of my scripts have been very niche or you only need them once Genericizing scripts takes a lot of time

Resources https://your.jss.com:8443/api https://gist.github.com/kbareis https://bryson3gps.wordpress.com/the-unofficialjss-api-docs/ https://github.com/bradschm https://github.com/pixaranimationstudios/jss-apigem

Resources, cont. https://github.com/sheagcraig/python-jss https://github.com/burnash/gspread http://www.ofb.net/~egnor/xml2/ https://github.com/jamfit https://github.com/jamfsupport

Questions? Comments?

Thank you!