live the dream

86
Integrating AutoPkg and the Casper Suite with JSSImporter Live the Dream

Upload: others

Post on 11-Sep-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Live the Dream

Integrating AutoPkg and the Casper Suite

with JSSImporterLive the Dream

Page 2: Live the Dream

What are we Trying to Do

Keep software up-to-date on client machines.

Test software before deployment.

Minimize IT involvement, mistakes, and time.

Prioritize important software.

Page 3: Live the Dream

Virtuous Behavior

Laziness as a virtue.

Trading one kind of labor for another.

The path is not easy, but it's not hard either.

Creating a safe space to iterate.

It's all in the reflexes.

Page 4: Live the Dream

How does Casper install Software? 1. Package up software (Composer)

2. Package is uploaded to distribution points.

3. Policy is created. Scoped to desired machines/groups.

4. Targets check-in periodically, and run any queued policies. Once. (Even if it fails).

Page 5: Live the Dream

and when software is updated?1. Download new version.

2. Test it out?

3. Package it up.

4. Upload it to distribution points.

5. Edit Policy to install new version.

6. Flush the logs!

Page 6: Live the Dream

Two Points of Pain1. Almost all software must be

repackaged.

2. Clicking on a bunch of web forms to deploy.

Page 7: Live the Dream

If you don't mind repetition, I have the cure...

Page 8: Live the Dream

Hasselhoff Infinite Recursion

Page 9: Live the Dream

Our Perception Our Sad Reality

Quality Control

*Especially in small organizations

Page 10: Live the Dream

Solving Point of Pain #1

AutoPkg

It's a black box

Page 11: Live the Dream
Page 12: Live the Dream
Page 13: Live the Dream

Solving Pain #2

Take a cue from Munki and automate.

Page 14: Live the Dream

What does Munki do?"Munki is a set of tools that... can be used by OS X administrators to manage software installs (and in many cases removals) on OS X client machines."

Manages multiple versions of software in Catalogs.

Manifests gather together groupings of software to install, and Catalogs from which to pull.

Clients check for updates to their available software, and install any that are available, on a schedule.

Page 15: Live the Dream

Development Testing Production

Page 16: Live the Dream

AutoPkg + Munki

Already built in.

Most major software already cooked up.

Page 17: Live the Dream

What exactly does a Munki recipe do?Extends a download or pkg recipe.

Specifies metadata about product.

Adds product to Catalog: (testing)

Copies files to Munki repo.

All of the deployment is handled elsewhere.

Page 18: Live the Dream

So basically it just copies software to a fileshare. Is this enough for Casper admins?

i.e., what happens if you simply upload a package with Casper Admin?

Page 19: Live the Dream

JSSImporter & python-jss

* Not the actual Allister Banks

Page 20: Live the Dream

Making it happen on Casper

Policies should not install more than one product.

Each product deployed by two policies:

Testing (self service)

Production (automated)

Page 21: Live the Dream

Deploy to ProductionProbably Automated

Can and should be bulk created (python-jss/jss_helper)

OR duplicated to remove the risk of error.

Variance as Documentation: Policies should only differ in installation-dependent ways.

(Extra scripting, reboots, etc)

Naming Convention: Install NetHack-3.4.3

Page 22: Live the Dream

Deploy to Testing"Official" Workflow Overview

1. Upload package to all configured distribution points.

2. Self-service policy offers new package to testing computers.

3. Test software.

4. Promote to production.

Page 23: Live the Dream

The Testing Group

Page 24: Live the Dream

Details of Self-Service

Scoped to Smart Group: NetHack-update-smart Frequency: Ongoing

Installs package, then recons.

Client drops out of Smart Group.

*No true version comparisons

Page 25: Live the Dream

RelaxThis is all you need to know. But.

Page 26: Live the Dream

Going Further

Setting things up.

Writing Recipes.

Alternate Workflows.

Mad Skills.

Page 27: Live the Dream

Installation & Configuration

https://github.com/sheagcraig/JSSImporter/releases/latest

Page 28: Live the Dream

Settings

API_USERNAME & API_PASSWORD

JSS_URL

JSS_VERIFY_SSL

JSS_REPOS

Page 29: Live the Dream
Page 30: Live the Dream

Create an API User

System Settings

JSS User Accounts and Groups

Page 31: Live the Dream

Needs Create, Read, and Update privileges for:

• Categories

• Smart Computer Groups

• Static Computer Groups

• Distribution Points

• (only needs "Read")

• Extension Attributes

• Packages

• Policies

• Scripts

*Permissions required even if not using!

Page 32: Live the Dream

defaults write com.github.autopkg JSS_URL https://test.jss.private:8443 defaults write com.github.autopkg API_USERNAME <apiUser> defaults write com.github.autopkg API_PASSWORD <apiPassword> defaults write com.github.autopkg JSS_VERIFY_SSL -bool <true or false>

Page 33: Live the Dream

Warning for Crazy Password People:

Bash shell escaping and XML escaping are not the same!

defaults write ./test.plist Password -string "L33tP@$$w0rd!" bash: !": event not found

Defaults will handle the XML encoding for you. Just editing the plist will not. defaults write ./test.plist Password -string '!@#$%^&*()<>?'

Page 34: Live the Dream

Configuring Distribution Points (JSS_REPOS)

JSS_REPOS is an array of dicts!

Two kinds of distribution points settings:

• Automatically Configured FileShare Distribution Point

• JDS

Page 35: Live the Dream

Check the documentation for in-depth instructions on how to PlistBuddy this, OR

you can edit it in your favorite text editor (which is vim)...

but you probably have to plutil -convert xml1 ~/Library/Preferences/com.github.autopkg.plist

first, and make sure to defaults read com.github.autopkg

afterwards.

Page 36: Live the Dream
Page 37: Live the Dream
Page 38: Live the Dream
Page 39: Live the Dream

Basic Usage

JSS Recipes Repo: https://github.com/autopkg/jss-recipes

autopkg repo-add jss-recipes

autopkg search <product>

Page 40: Live the Dream
Page 41: Live the Dream

Ensure you have recipe's parentautopkg info <Recipe>

Page 42: Live the Dream

Run the recipeautopkg run <Product>.jss

Page 43: Live the Dream

What HappensFirst Run 1. Create categories. 2. Copy package to

distribution points. 3. Create extension

attributes. 4. Create static and smart

groups. 5. Create scripts. 6. Create policy. 7. Attach icon to policy.

Subsequent Runs 1. Update package if new. 2. Update extension

attributes. 3. Update groups. 4. Update scripts 5. Update policy

*Update means manual UI changes are lost: "Declarative".

Page 44: Live the Dream

Test Packages

Page 45: Live the Dream

Promote Package to Production

Manual Edit production policy: • Name • Package • Flush logs • But no.

Automagical jss_helper promote -u

https://github.com/sheagcraig/jss_helper

Page 46: Live the Dream
Page 47: Live the Dream

Flush

Page 48: Live the Dream

Other Cool Stuff with jss_helper

Page 49: Live the Dream

computer and mobile device groups computers and mobile devices policies configuration profiles (computer & md) categories imaging configurations packages

Research Objects

Page 50: Live the Dream
Page 51: Live the Dream

There's also: https://yourjss.company.org:8443/api (If you're still into clicking... Remember the Hoff)

Page 52: Live the Dream

jss_helper installs

Page 53: Live the Dream

jss_helper scoped

Page 54: Live the Dream

Writing JSS RecipesWriting JSS recipes is primarily about applying your already-designed workflow to a new product.

Workflow is described in PolicyTemplate and SmartGroupTemplate.

Page 55: Live the Dream

Text Substitution

Autopkg and JSSImporter attempt to replace any string value wrapped in %'s with the value of a variable.

E.g. %version% is replaced with 18.0.0.194.

Applies to recipes as well as xml templates.

Page 56: Live the Dream

PolicyTemplate.xml

Design a policy in web UI, then edit out unnecessary elements.

Page 57: Live the Dream

PolicyTemplate.xml

Or start with standard and edit in changes.

Page 58: Live the Dream

PolicyTemplate.xml

Or start with standard and edit in changes.

Page 59: Live the Dream

SmartGroupTemplate.xml

Page 60: Live the Dream

Writing the JSS Recipe

Copy an existing recipe, make edits, diff.

Page 61: Live the Dream

Writing the recipeOnce Policy and SmartGroup are designed, most recipes differ only in a few ways. To reuse:• Edit the description.

• Edit the identifier

• Edit the NAME

• Edit the SELF_SERVICE_ICON

• Edit the SELF_SERVICE_DESCRIPTION

• Edit the Category

• Edit the ParentRecipe

Page 62: Live the Dream

Standard jss-recipes

Filename is <Product>.jss.recipe

Identifier is com.github.jss-recipes.jss.<Product>

Page 63: Live the Dream

Argument Doubling (*only edit the Input)

Page 64: Live the Dream

Extra Arguments

os_requirements: 10.10.x, 10.9.5, 10.9.6

site_name / site_id

jss_inventory_name: Microsoft OneNote vs. MSOneNote

scripts

extension_attributes

Page 65: Live the Dream

JSSRecipeCreatorhttps://github.com/sheagcraig/JSSRecipeCreator

Takes a parent recipe as input.

Will prompt for every important value OR -a for full-auto ease.

JSSRecipeCreator -a ~/Library/RecipeRepos/com.github.autopkg.sheagcraig-recipes/OpenEmu/OpenEmu.pkg.recipe

Page 66: Live the Dream
Page 67: Live the Dream
Page 68: Live the Dream
Page 69: Live the Dream

• Standard Mode prompts for: • Recipe Filename • Identifier • NAME • PolicyTemplate • Package Category • Policy Category • Scope • Self Service Icon • Self Service Description

Page 70: Live the Dream

Overriding JSS Recipes

Copy templates, icons to: ~/Library/AutoPkg/RecipeOverrides/

...if you want different ones.

Remove things you don't need to change, edit things you do.

autopkg make-override NetHack.jss

Page 71: Live the Dream
Page 72: Live the Dream

AppStoreApphttps://github.com/autopkg/nmcspadden-recipes

Requires pyasn1: sudo easy_install -U pyasn1

Create a JSS Recipe for each app.

• Name: (App's name)

• ParentRecipe: com.github.nmcspadden.pkg.appstore

App must be present!

* Not the actual Nick McSpadden

Page 73: Live the Dream
Page 74: Live the Dream

Alternate Workflows• Automatically deploy packages to testing computers.

• Add packages to distribution points only.

• Multiple JSSImporter steps create multiple policies:

• Install policy

• Notification policy

• Bad Idea: Use JSSImporter to automatically deploy software to all computers.

Page 75: Live the Dream
Page 76: Live the Dream

Alternate Workflows• Automatically deploy packages to testing computers.

• Add packages to distribution points only.

• Multiple JSSImporter steps create multiple policies:

• Install policy

• Notification policy

• Bad Idea: Use JSSImporter to automatically deploy software to all computers.

Page 77: Live the Dream
Page 78: Live the Dream

Alternate Workflows• Automatically deploy packages to testing computers.

• Add packages to distribution points only.

• Multiple JSSImporter steps create multiple policies:

• Install policy

• Notification policy

• Bad Idea: Use JSSImporter to automatically deploy software to all computers.

Page 79: Live the Dream

Add 2nd JSSImporter

Page 80: Live the Dream

NotificationPolicy

Page 81: Live the Dream
Page 82: Live the Dream

Other Stuff

Automate your AutoPkg with AutoPkgr

http://www.lindegroup.com/autopkgr/

LaunchDaemon and autopkg -l <my_list>

Page 83: Live the Dream

My JSS has 90 Google Chrome packages......and there's no room for my emergency security updates to Adobe Flash!

Spruce

https://github.com/sheagcraig/spruce

Audit unused packages, scripts.

And more coming!

Page 84: Live the Dream
Page 85: Live the Dream

JSSImporter as a Management ToolCan be configured to populate:

Extension attributes

Example: Computer Information Fields

XProtect State

Scripts

SavingThrow

Page 86: Live the Dream