GithubHelp home page GithubHelp logo

pombredanne / ghe-backup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trailofbits/ghe-backup

0.0 2.0 0.0 158 KB

Encrypted Backups to S3 for GitHub Enterprise

License: MIT License

Shell 100.00%

ghe-backup's Introduction

ghe-backup

Encrypted Backups to S3 for GitHub Enterprise.

Features

  • Supports making complete backups from GitHub Enterprise servers
  • Supports arbitrary backup locations
  • Supports encrypting backups with GPG
  • Supports syncing backups to AWS S3

Getting Started

  1. Setup SSH access on your GHE server
  2. Create a PGP key to use for backups
  3. (Optional) Configure an AWS S3 user and bucket
  4. (Optional) Install and configure aws-cli
  5. Configure ghe-backup variables

1. Github Enterprise SSH Access

Enable SSH access to the Github Enterprise server through the management console with a public key from your backup server. Restrict access to only your backup server with the from option in your SSH public key. OS X users may want to use Homebrew to install GnuPG.

2. GnuPG backup key

Create a new GPG key with gpg --gen-key and set a blank password. Store an offline backup of your key with gpg -ao keyname-private.key --export-secret-keys key_id.

3. Configure AWS S3

Create a new S3 bucket via the AWS management console and use an IAM policy to restrict its access. Optionally, configure lifecycle rules to automate backups to Glacier.

{
	"Statement": [
		{
			"Sid": "UNIQUE_ID",
			"Action": "s3:*",
			"Effect": "Allow",
			"Resource": "arn:aws:s3:::BUCKET_NAME/*"
		},
		{
			"Sid": "UNIQUE_ID",
			"Action": ["s3:ListAllMyBuckets"],
			"Effect": "Allow",
			"Resource": "arn:aws:s3:::*"
		},
		{
			"Sid": "UNIQUE_ID",
			"Action": "s3:*",
			"Effect": "Allow",
			"Resource": "arn:aws:s3:::BUCKET_NAME"
		}
	]
}

4. Setup aws-cli

Install the AWS Command Line Interface with pip install aws-cli. Create a configuration file in ~/.aws/config and set the aws_access_key, aws_secret_access_key, and region using the appropriate parameters from the previous step.

5. Configure the script

Set the appropriate SERVER, the BACKUPS_DIR you want to use, name or email of the PGP_RECIPIENT, enable or disable S3_BACKUP and the S3_BUCKET you want to use. Run ghe-backup without arguments to begin the backup. Add it to cron to run as often as you want.

More info

See the GitHub Enterprise documentation for more info about backing up and restoring your installation.

ghe-backup's People

Contributors

dguido avatar mrowe avatar postmodern avatar

Watchers

 avatar  avatar

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.