Skip to content

Instantly share code, notes, and snippets.

@brysontyrrell
brysontyrrell / jamfpro-template.yaml
Last active Mar 26, 2022
Deploy Jamf Pro using Fargate and Aurora Serverless (non production)
View jamfpro-template.yaml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
AvailabilityZone1:
Type: String
Default: a
AvailabilityZone2:
Type: String
View install_packages_github_actions.yaml
name: Automated Unit Tests
on: [pull_request]
jobs:
automated-unit-tests:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
View publish_package_github_actions.yaml
name: Publish Package
on:
push:
branches:
- main
jobs:
publish:
View repository_installer_role.yaml
AWSTemplateFormatVersion: 2010-09-09
# See https://github.com/aws-actions/configure-aws-credentials#sample-iam-role-cloudformation-template
Parameters:
GitHubOrg:
Type: String
RepositoryName:
Type: String
View repository_publisher_role.yaml
AWSTemplateFormatVersion: 2010-09-09
# See https://github.com/aws-actions/configure-aws-credentials#sample-iam-role-cloudformation-template
Parameters:
GitHubOrg:
Type: String
RepositoryName:
Type: String
View github_oidc_provider.yaml
AWSTemplateFormatVersion: 2010-09-09
# This can only be deployed once per account.
Resources:
GitHubOIDC:
Type: AWS::IAM::OIDCProvider
Properties:
Url: https://token.actions.githubusercontent.com
ClientIdList:
View codeartifact_repository.yaml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
DomainName:
Type: String
AllowedPattern: "^[a-z][a-z0-9-]{0,48}[a-z0-9]$"
RepositoryName:
Type: String
@brysontyrrell
brysontyrrell / JamfUAPIAuthToken.py
Created Oct 19, 2016
Generate a token for the Jamf Universal API (UAPI) that will auto-refresh as needed.
View JamfUAPIAuthToken.py
import datetime
import logging
import requests
import urlparse
class JamfUAPIAuthToken(object):
def __init__(self, jamf_url, username, password):
"""
:param jamf_url: Jamf Pro URL
:type jamf_url: str
@brysontyrrell
brysontyrrell / cipher.py
Last active Jan 28, 2022
AES256 encryption using pyca/cryptography
View cipher.py
import base64
import os
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
class AESCipher(object):
block_size = algorithms.AES.block_size / 8
View api-queue-template.yaml
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Creates an API Gateway to publish data to a SQS queue.
Resources:
ApiQueue:
Type: AWS::SQS::Queue
ApiRole: