All Projects → homebysix → pre-commit-macadmin

homebysix / pre-commit-macadmin

Licence: other
Pre-commit hooks for Mac admins.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pre-commit-macadmin

LAPSforMac
Local Administrator Password Solution for Mac
Stars: ✭ 29 (-32.56%)
Mutual labels:  mac, apple, macadmin, jamf
blade runner
Blade Runner is a Jamf Pro based Python application that automates and implements a framework to offboard, secure erase and document deprecated Mac systems.
Stars: ✭ 24 (-44.19%)
Mutual labels:  mac, macadmin, jamf
Macvars
command library for scripting osx
Stars: ✭ 34 (-20.93%)
Mutual labels:  mac, apple, macadmin
mac scripts
A collection of scripts used to Manage Mac OS X computers.
Stars: ✭ 38 (-11.63%)
Mutual labels:  apple, macadmin, jamf
Mac admin
Helpful scripts & configuration profiles for the Mac admin community
Stars: ✭ 139 (+223.26%)
Mutual labels:  mac, apple, macadmin
kinobi
An external patch definition server for Jamf Pro
Stars: ✭ 76 (+76.74%)
Mutual labels:  macadmin, jamf
python-jamf
`python-jamf` is a library for connecting to a Jamf Server that maps directly to the Jamf Pro Classic API. It is the basis for the `jctl` tool to automate patch management & packages and many other items.
Stars: ✭ 37 (-13.95%)
Mutual labels:  autopkg, jamf
Clean-macOS
💻 A simple script to setup a clean environment on macOS
Stars: ✭ 155 (+260.47%)
Mutual labels:  mac, apple
management tools
A collection of scripts and packages to simplify OS X management.
Stars: ✭ 93 (+116.28%)
Mutual labels:  mac, macadmin
Macos Egpu Cuda Guide
Set up CUDA for machine learning (and gaming) on macOS using a NVIDIA eGPU
Stars: ✭ 187 (+334.88%)
Mutual labels:  mac, apple
Notarize
Notarization status monitoring tool for macOS, supporting multiple developer accounts.
Stars: ✭ 90 (+109.3%)
Mutual labels:  mac, apple
mbpfan
A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer
Stars: ✭ 680 (+1481.4%)
Mutual labels:  mac, apple
cleanup manager
Cleanup Manager helps you clean up folders on your Mac's hard drive.
Stars: ✭ 22 (-48.84%)
Mutual labels:  mac, macadmin
jamfpro-extension-attributes
🔍 A repository for EAs to use for reporting in the Jamf Pro Server
Stars: ✭ 30 (-30.23%)
Mutual labels:  macadmin, jamf
munki-rebrand
Script to rebrand Munki's Managed Software Center
Stars: ✭ 85 (+97.67%)
Mutual labels:  macadmin, munki
Quickeys
A mac menu bar app that provides note taking functionality though a quick dropdown menu.
Stars: ✭ 54 (+25.58%)
Mutual labels:  mac, apple
jamfscripts
Scripts I use non API related
Stars: ✭ 15 (-65.12%)
Mutual labels:  macadmin, jamf
brewfile
🍎 Brewfile to install softwares in macOS for engineers
Stars: ✭ 37 (-13.95%)
Mutual labels:  mac, apple
AutoBrew
AutoBrew: Homebrew deployments made easy
Stars: ✭ 71 (+65.12%)
Mutual labels:  jamf, munki
Ultratabsaver
The open source Tab Manager Extension for Safari.
Stars: ✭ 178 (+313.95%)
Mutual labels:  mac, apple

Pre-Commit Hooks for Mac Admins

CodeQL

This repository contains hooks for pre-commit that may be useful to Mac admins, client engineers, and other Apple-focused IT professionals.

Requirements

To use these hooks, you first need to install pre-commit using the instructions here: https://pre-commit.com/#install

Adding hooks to your pre-commit config

For any hook in this repo you wish to use, add the following to your pre-commit config:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.12.2
    hooks:
    -   id: check-plists
    # -   id: ...

After adding a hook to your pre-commit config, it's not a bad idea to run pre-commit autoupdate to ensure you have the latest version of the hooks.

Hooks available

General

  • check-git-config-email

    This hook checks to ensure the Git config email matches one of the specified domains: args: ['--domains', 'pretendco.com', 'contoso.com', '--']

  • check-plists

    This hook checks XML property list (plist) files for basic syntax errors.

  • check-munkipkg-buildinfo

    This hook checks MunkiPkg build-info files to ensure they are valid.

  • check-outset-scripts

    This hook checks Outset scripts to ensure they're executable.

AutoPkg

  • check-autopkg-recipe-list

    This hook checks AutoPkg recipe lists (in txt, plist, yaml, or json format) for common issues.

  • check-autopkg-recipes

    This hook checks AutoPkg recipes to ensure they meet various requirements and conventions.

    • Optionally specify your preferred AutoPkg recipe and/or override prefix, if you wish to enforce them: args: ['--override-prefix=com.yourcompany.autopkg.']
      (default: local.)
      args: ['--recipe-prefix=com.github.yourusername.']
      (default: com.github.)

    • Optionally specify the version of AutoPkg for which you want to ignore MinimumVersion mismatches with processors. args: ['--ignore-min-vers-before=0.5.0']
      (default: 1.0.0)
      Specifying 0.1.0 will not ignore any MinimumVersion mismatches.

    • If you're a purist, you can also enable strict mode. This enforces recipe type conventions, all processor/MinimumVersion mismatches, forbids <!-- --> style comments, and ensures all processor input variables (arguments) are valid.
      args: ['--strict']
      (default: False)

  • forbid-autopkg-overrides

    This hook prevents AutoPkg overrides from being added to the repo.

  • forbid-autopkg-trust-info

    This hook prevents AutoPkg recipes with trust info from being added to the repo.

Jamf

  • check-jamf-extension-attributes

    This hook checks Jamf extension attributes for common issues. (Looks for EAs in a path containing jamf/extension_attributes or jss/extension_attributes.)

  • check-jamf-scripts

    This hook checks Jamf scripts for common issues. (Looks for scripts in a path containing jamf/scripts or jss/scripts.)

  • check-jamf-profiles

    This hook checks Jamf profiles for common issues. (Looks for profiles in a path containing jamf/profiles or jss/profiles.)

Munki

  • check-munki-pkgsinfo

    This hook checks Munki pkginfo files to ensure they are valid.

    • Specify your preferred list of pkginfo catalogs, if you wish to enforce it, followed by -- to signal the end of the list:
      args: ['--catalogs', 'testing', 'stable', '--']

    • Specify your preferred list of pkginfo categories, if you wish to enforce it, followed by --:
      args: ['--categories', 'Productivity', 'Design', 'Utilities', 'Web Browsers', '--']

    • Specify required pkginfo keys, followed by --:
      args: ['--required-keys', 'category', 'description', 'developer', 'name', 'version', '--']
      (default: description, name)

  • check-munkiadmin-scripts

    This hook ensures MunkiAdmin scripts are executable.

  • munki-makecatalogs

    This hook runs the "makecatalogs" command to ensure all referenced packages are present and catalogs are up to date.

Note about combining arguments

When combining arguments that take lists (for example: --required-keys, --catalogs, and --categories), only the last list needs to have a trailing --. For example, if you use the check-munki-pkgsinfo hook with only the --catalogs argument, your yaml config would look like this:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.12.2
    hooks:
    -   id: check-munki-pkgsinfo
        args: ['--catalogs', 'testing', 'stable', '--']

But if you also use the --categories argument, you would move the trailing -- to the end, after all the lists, like this:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.12.2
    hooks:
    -   id: check-munki-pkgsinfo
        args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']

The -- only serves as a signal to the hook that the list of arguments is complete, and is only needed for "list" type arguments.

If it looks better to your eye, feel free to use a multi-line list for long arguments:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.12.2
    hooks:
    -   id: check-munki-pkgsinfo
        args: [
            '--required-keys', 'description', 'name', 'developer', 'category', 'version',
            '--catalogs', 'testing', 'stable',
            '--categories', 'Communication', 'Design', 'Engineering', 'macOS', 'Printers',
                'Productivity', 'Security',  'Utilities', 'Web Browsers',
            '--']

Recommendations

If you find my hooks useful, you may also want to use one or more of the Python, Markdown, and Git-related hooks listed here: https://pre-commit.com/hooks.html

Specifically, here are a few I use for Mac admin work:

  • check-added-large-files
  • check-executables-have-shebangs
  • check-merge-conflict
  • check-yaml
  • detect-aws-credentials
  • detect-private-key
  • mixed-line-ending
  • no-commit-to-branch
  • trailing-whitespace
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].