Skip to content

castironclay/skyhook

Repository files navigation

Skyhook

Build a VPN topology spanning multiple cloud providers using Docker, Terraform, Ansible, and Wireguard.

Standard Setup Steps

Tools Required

Available Cloud Providers

Env File

Create your .env file for your provider credentials. This will be mounted in to the skyhook container from the same directory as this README. You may use "placeholder" as a value for any providers you may not have accounts for. AWS is the only required provider due to SQS and DynamoDB being used.

/skyhook/.env

DESTROY_URL=
BUILD_URL=
DYNAMODB_TABLE_NAME=
AWS_ACCOUNT_ID=
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
TF_VAR_LINODE_TOKEN=
TF_VAR_AZ_APP_ID=
TF_VAR_AZ_TENANT=
TF_VAR_AZ_SECRET=
TF_VAR_AZ_SUB_ID=
GOOGLE_APPLICATION_CREDENTIALS=
TF_VAR_GOOGLE_PROJECT=

Build required images

cd docker/builder/
docker build -t skyhook-builder .

cd docker/destroyer/
docker build -t skyhook-destroyer .

cd docker/plugins/
docker build -t skyhook-plugins .

Start containers

docker-compose up -d

Tail logs

docker-compose logs -f

Setting credentials for env file

Amazon Web Services

  1. Use your AWS_ACCESS_KEY for AWS_ACCESS_KEY
  2. Use your AWS_SECRET_ACCESS_KEY for AWS_SECRET_ACCESS_KEY

Microsoft Azure

Install Azure CLI tools

  1. az login
  2. use tenantId for TF_VAR_AZ_TENANT and id for TF_VAR_AZ_SUB_ID
  3. az account set --subscription="PUT-YOUR-SUB-ID-HERE"
  4. az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/PUT-YOUR-SUB-ID-HERE"
  5. use password for TF_VAR_AZ_SECRET and appId for TF_VAR_AZ_APP_ID

Google Cloud Project

  1. Use your service account key for GOOGLE_SERVICE_ACCOUNT_KEY

Linode

  1. Use your Linode API key for TF_VAR_LINODE_TOKEN

Build a stack

Enter the providers you wish to use. An SQS message will be sent which will be picked up by the builder container. Ansible-playbook logs can be seen by tailing docker-compose logs or container logs.

castironclay@mbp skyhook % python3 build.py 
Provider 1: aws
Provider 2: linode
Provider 3: aws

Connect to mesh

After the mesh is deployed you can move to your project's folder and run connect.sh.

cd projects/(your project)
chmod +x connect.sh
./connect.sh

Decommission a stack

A list of existing stacks will be presented. Enter the stack you wish to destroy. An SQS message will be sent which will be picked up by the destroyer container.

castironclay@mbp skyhook % python3 decom.py 
['1h7sbh']
Project name: 1h7sbh