Giter Club home page Giter Club logo

terraform-scaleway-hashistack's People

Contributors

balupton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

terraform-scaleway-hashistack's Issues

fix no route to host/origin from master

module.cluster_master.scaleway_server.server (remote-exec): removed directory: ‘/tmp/tmp.66tWeni7GL’
module.cluster_master.scaleway_server.server (remote-exec): shred -u ../data/local/files/consul.zip
module.cluster_master.scaleway_server.server (remote-exec): ● consul.service - consul agent
module.cluster_master.scaleway_server.server (remote-exec):    Loaded: loaded (/etc/systemd/system/consul.service; enabled; vendor preset: disabled)
module.cluster_master.scaleway_server.server (remote-exec):    Active: active (running) since Fri 2018-04-27 16:27:11 UTC; 710ms ago
module.cluster_master.scaleway_server.server (remote-exec):  Main PID: 2624 (consul)
module.cluster_master.scaleway_server.server (remote-exec):    CGroup: /system.slice/consul.service
module.cluster_master.scaleway_server.server (remote-exec):            └─2624 /usr/local/bin/consul agent -config-dir=/etc/systemd/system/consul.d

module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] consul: Adding LAN server par1_master_0 (Addr: tcp/10.10.36.185:8300) (DC: global)
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: Started DNS server 127.0.0.1:53 (tcp)
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: Started HTTPS server on 127.0.0.1:8500 (tcp)
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: started state syncer
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: Retry join LAN is supported for: aliyun aws azure digitalocean gce os scaleway softlayer
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: Joining LAN cluster...
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: (LAN) joining: [10.10.36.189]
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [INFO] agent: (LAN) joined: 0 Err: 1 error(s) occurred:
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: * Failed to join 10.10.36.189: dial tcp 10.10.36.189:8301: connect: no route to host
module.cluster_master.scaleway_server.server (remote-exec): Apr 27 16:27:11 par1_master_0 consul[2624]: 2018/04/27 16:27:11 [WARN] agent: Join LAN failed: <nil>, retrying in 30s

solve: vault+tls: unable to talk with Consul backend

vault is failing according to consul, however vault is running fine, with the exception of this error message:

check unable to talk with Consul backend: error="Unexpected response code: 500 (CheckID "vault:10.10.36.185:8200:vault-sealed-check" does not have associated TTL)

tls certificate issuer and updater

Summary:

Generating the nomad certs on origin did not work as the nomad machines would then have certs which did not include their private_ips in the certs ip_sans, which would cause the cert to be rejected from the local instance.

I then tried to generate the nomad certs on the nomad machines. That fixes the ip_sans issue, but then prevents nomad to nomad communication as each nomad instance then has different certs.

Solving this seems to require a certificate issuer and update service.

Possible Solutions:

Local polling + local issuance:

  1. Create a poll service on each machine that polls a vault secret (that contains issued pki combo json) every 30 seconds, if there is a change, then reconfigure the local nomad service.
  2. When a new nomad service is required, append another vault secret with the new private_ip, then generate a new pki combo with all the private_ips from the earlier secret, put that combo json into the secret at step 1.
  3. To setup the vault secrets, vault policies and tokens would need to be created for the polling and writing requirement. Or just use the cluster_token in memory.

Developer issuance in pre:

  1. For each new server that was just issued but not yet configured, the terraform script then remotes into existing services and updates their TLS cert to include the new server's private_ip.
  2. Generation of the PKI bundle could occur locally or on origin, then propagated.

Developer issuance in post:

  1. All services have TLS off at the start
  2. Then once all servers are deployed and running, remote into origin, generate the certs containing all their private_ips, then remote into each server and inject the cert, and reconfigure their services.

Abandon local TLS entirely for Cloudflare Argo Tunnel:

  1. Cloudflare Argo Tunnel only allows connections from cloudflare servers and users you give access to via Cloudflare Access. Argo Tunnel also encrypted all traffic by generating a local certificate on the machine that then interfaces with the Cloudflare endpoint. Accomplished by #8

Assessment:

Local polling allows short TTL on local TLS. Accomplishes #4

Local polling AND dev issuance in pre, would involve reloading for all existing servers, when each new server added.

Dev issuance in post, would involve reloading for all servers, but only once in post.

Reloading may induce downtime if not timed to be simultaneous.

Conclusion:

Argo Tunnel should be explored. It could turn out to be easiest and most secure. And may turn out to be able to be used with service TLS.

At a later point, implement service TLS. It would require 1-3 weeks by estimate to get the options for it going.

upgrade for latest hashicorp product versions

Notable Changes

Links

Terraform

HCL2 solves a lot of the issues we were having.

Terraform Cloud also solves the encrypted/secure env var issues.

Terraform Modules

HashiCorp now has full starter kits for a secure environment on AWS. If only they did this when this project was started, it would have saved me months of figuring out how to do it securely and integrated myself.

Consul, Vault, Nomad

The new versions support federation and automatic TLS, which was the most difficult part of this entire setup back when this project was being authored. Upgrading to them should save a lot of time.

Boundary

Boundary is a new project that simplifies ssh and access into the machines.

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.