GithubHelp home page GithubHelp logo

puppetlabs / cloudfront-middleware Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaronburchfield/cloudfront-middleware

0.0 5.0 1.0 5 KB

Securely access a munki repo with Amazon CloudFront

Makefile 18.94% Python 67.09% Shell 13.97%

cloudfront-middleware's Introduction

What is CloudFront Middleware?

CloudFront Middleware enables managed clients to securely access a munki repo from Amazon's CloudFront Global Content Delivery Network. CloudFront has lower transit costs than using S3 directly and can offer better performance to managed clients that are outside of an S3 bucket's region.

CloudFront Middleware uses a CloudFront private key to create and sign requests for private CloudFront resources. Each signed request includes an expiration date after which the request is longer valid.

CloudFront key pairs are available from the AWS Security Credentials dashboard. Each AWS account can have a maximum of two CloudFront key pairs (active or inactive) at a time, allowing for periodic rotation of the private key. It is possible to grant an AWS account other than the CloudFront distribution owner the ability to sign CloudFront requests.

Requirements

  • Amazon S3 bucket with your munki repo inside.
  • CloudFront distribution serving this origin with restricted access to your S3 content.
  • CloudFront private key of an AWS account that is a trusted signer of this CloudFront distribution.

Configure a managed client to access the CloudFront munki repo.

  1. Install middleware_cloudfront.py to /usr/local/munki/.

  2. Set the munki preference SoftwareRepoURL to your CloudFront Distribution URL.

  3. Set CloudFront Middleware preferences for your Access Key ID and the resource expiration timeout in minutes. If unset expiration will default to 60 minutes.

    sudo defaults write com.github.aaronburchfield.cloudfront access_id -string "YOURACCESSKEYID"
    sudo defaults write com.github.aaronburchfield.cloudfront expire_after -int 30
    
  4. If you are using an Alternate Domain Name, set the preference for your domain name.

    sudo defaults write com.github.aaronburchfield.cloudfront domain_name -string "munki.megacorp.com"
    
  5. Install a trusted signer's CloudFront private key and set strict permissions.

    sudo cp pk-YOURACCESSKEYID.pem /usr/local/munki/munkiaccess.pem
    sudo chown root:wheel /usr/local/munki/munkiaccess.pem
    sudo chmod 400 /usr/local/munki/munkiaccess.pem
    
  6. Run munki and verify that signed CloudFront requests are being made.

    sudo managedsoftwareupdate --checkonly -vvv
    

Build a luggage package to install CloudFront Middleware

The included luggage makefile can be used to create an installer package for CloudFront Middleware.

  1. With an AWS Root account generate a CloudFront Key Pair, saving the private key as munkiaccess.pem in the root of this repo.
  2. Replace the Access Key ID on line 4 of the postinstall script with the ID of your CloudFront Key Pair.
  3. make pkg and install.
  4. Set your SoftwareRepoURL to your CloudFront Distribution address and run munki.

cloudfront-middleware's People

Contributors

aaronburchfield avatar

Watchers

James Cloos avatar  avatar Cody Clements avatar Gillian Weisgram avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.