All Projects → errygg → Hashiconf 2018

errygg / Hashiconf 2018

Labels

Projects that are alternatives of or similar to Hashiconf 2018

Peladonerd
Repo con los archivos que uso para mi videos en youtube
Stars: ✭ 716 (+3013.04%)
Mutual labels:  hcl
Terraform Aws Ecs
Terraform AWS ECS stack
Stars: ✭ 16 (-30.43%)
Mutual labels:  hcl
Gitlab Ecs Terraform
Installing GitLab on Amazon ECS by Terraform
Stars: ✭ 18 (-21.74%)
Mutual labels:  hcl
Tack
Terraform module for creating Kubernetes cluster running on Container Linux by CoreOS in an AWS VPC
Stars: ✭ 734 (+3091.3%)
Mutual labels:  hcl
Terraform tutorial vpc
Stars: ✭ 7 (-69.57%)
Mutual labels:  hcl
Terraform Google Gitlab Runner
Terraform module for provisioning a GitLab CI Runner in a GCP project using the docker+machine executor.
Stars: ✭ 17 (-26.09%)
Mutual labels:  hcl
Vscode Terraform
A Visual Studio Code extension for Hashicorp Terraform
Stars: ✭ 672 (+2821.74%)
Mutual labels:  hcl
Jenkins Fargate
Stars: ✭ 22 (-4.35%)
Mutual labels:  hcl
Gcp Terraform Samples
Stars: ✭ 16 (-30.43%)
Mutual labels:  hcl
Rancher Flocker
Packaging and deploying Flocker on top of Rancher
Stars: ✭ 17 (-26.09%)
Mutual labels:  hcl
Terraform Aws Demo
Stars: ✭ 6 (-73.91%)
Mutual labels:  hcl
Terraform Aws Openvpn
Terraform AWS OpenVPN Stack
Stars: ✭ 7 (-69.57%)
Mutual labels:  hcl
Terraform Google Jenkins
This module handles the creation of a GCE instance running Jenkins, configured to run builds on Google Cloud.
Stars: ✭ 17 (-26.09%)
Mutual labels:  hcl
Okd
The self-managing, auto-upgrading, Kubernetes distribution for everyone
Stars: ✭ 729 (+3069.57%)
Mutual labels:  hcl
Terraform Ecs Fargate Service Discovery
Stars: ✭ 19 (-17.39%)
Mutual labels:  hcl
Sentinel Attack
Tools to rapidly deploy a threat hunting capability on Azure Sentinel that leverages Sysmon and MITRE ATT&CK
Stars: ✭ 676 (+2839.13%)
Mutual labels:  hcl
Kallewheel
A custom color wheel extension for Adobe Photoshop
Stars: ✭ 16 (-30.43%)
Mutual labels:  hcl
Terraform Openstack Rke
Terraform Openstack RKE
Stars: ✭ 23 (+0%)
Mutual labels:  hcl
Terraform Aks Autoscaler
AKS cluster with node autoscaler and horizontal pod autoscaler.
Stars: ✭ 19 (-17.39%)
Mutual labels:  hcl
Terraform Aws Vpc Peering
A Terraform module to configure a VPC Peering connection in AWS.
Stars: ✭ 17 (-26.09%)
Mutual labels:  hcl

Vault SSH for HashiConf 2018

This repo holds the notes, slides, and configurations for my talk at HashiConf 2018.

Setup

The demo for this talk includes an enterprise versions of Vault and Consul using Terraform Enterprise (https://app.terraform.io) to setup all the infrastructure. More specifically, the following explains the setup:

  • Terraform Enterprise is used to spin up the Vault/Consul clusters
  • 3 node Vault Enterprise cluster with a 3 node Consul Enterprise cluster
  • Vault is publicly accessible via AWS load balancer endpoint
  • Consul is only accessible to Vault
  • Script is used to setup the Vault SSH Secrets Engine and associated roles
  • Terraform Enterprise is used to spin up the SSH clients in 2 separate workspaces

The Terraform workspace used to build the Vault/Consul cluster is located at: https://github.com/errygg/vault-guides/tree/master/operations/provision-vault/quick-start/terraform-aws.

Note: This demo was performed using Terraform Enterprise; however, the same demo can be accomplished using Terraform OSS using the terraform command in place of the UI.

Note: This demo uses configuration for Vault SSH found here: https://www.vaultproject.io/api/secret/ssh/index.html

Spin up and Configure Vault

  1. Run the terraform workspace to spin up the Vault/Consul cluster

  2. Configure Vault via UI - 1 key share, 1 threshold

  3. Download the keys & unseal with the master key

  4. Run terraform to configure Vault SSH backend and users

  > cd ./scripts
  > . ./vault_env.sh <Vault URL> <JSON file downloaded from unsealing Vault>
  > ./configure_vault.sh

OTP Client Admin Configuration

  1. Spin up the OTP client via Terraform Enterprise

  2. Create the OTP role for the vampire users as the root user

  > . ./scripts/vault_env.sh <VAULT_ADDR> <credentials json file>
  > vault write ssh/roles/vampires key_type=otp default_user=bob cidr_list="<IP address of OTP instance>/32"

Login with Bob the Vampire

  1. Authenticate with Vault as Bob
  > export VAULT_TOKEN=`vault login -token-only -method=userpass username=bob`
  1. Get the OTP for the client
  > vault ssh -role=vampires -mode=otp -strict-host-key-checking=no [email protected]<IP address of OTP instance>
  1. SSH into the client
  > ssh [email protected]<IP address of OTP instance>

Enter the password from the key field in the write response from step 3.

  1. cat out the PAM and ssh configs
  > cat /etc/pam.d/sshd
  > cat /etc/ssh/sshd_config

Exit out and try the password again and we'll see you can't login. OTP FTW!

CA Client Admin Configuration

  1. Spin up the CA client via Terraform Enterprise

Login with Suzy

  1. Authenticate with Vault
  > export VAULT_NAMESPACE=zombies
  > export VAULT_TOKEN=`vault login -token-only -method=userpass username=suzy`
  1. Public key is accessible via the /public_key endpoint
  > curl http://<VAULT_ADDR>/v1/ssh/public_key
  1. Test that we can't actually ssh to the node as Suzy
  > ssh [email protected]<IP address of CA instance>
  1. Sign the local ssh key, putting it next to the default key allows a simpler ssh command
  > vault write -field=signed_key ssh/sign/zombies public_key=@$HOME/.ssh/id_rsa.pub > ~/.ssh/id_rsa-cert.pub
  > chmod 600 ~/.ssh/id_rsa-cert.pub
  1. SSH into the instance with our new signed key
  > ssh [email protected]<IP address of CA instance>
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].