All Projects → tozny → Rancher Lets Encrypt

tozny / Rancher Lets Encrypt

Licence: mit
Automatically create and manage certificates in Rancher using Let's Encrypt webroot verification via a minimal service

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Rancher Lets Encrypt

Rancher Letsencrypt
🐮 Rancher service that obtains and manages free SSL certificates from the Let's Encrypt CA
Stars: ✭ 318 (+261.36%)
Mutual labels:  letsencrypt, ssl-certificates, rancher
Concert
Concert is a console based certificate generation tool for https://letsencrypt.org.
Stars: ✭ 196 (+122.73%)
Mutual labels:  letsencrypt, ssl-certificates
Certbot Route53
Helping create Let's Encrypt certificates for AWS Route53
Stars: ✭ 159 (+80.68%)
Mutual labels:  letsencrypt, ssl-certificates
Letscertbot
Let's Certbot is a tool builds automated scripts base on Certbot for obtaining, renewing, deploying SSL certificates.
Stars: ✭ 84 (-4.55%)
Mutual labels:  letsencrypt, ssl-certificates
Docker Nginx Gunicorn Flask Letsencrypt
Boilerplate code for setting up Nginx + Gunicorn + Flask + automated LetsEncrypt certificates (https) using docker-compose.
Stars: ✭ 117 (+32.95%)
Mutual labels:  letsencrypt, ssl-certificates
gitlab-docker-rancher-letsencrypt-setup
Automated private dev environment with docker, gitlab CI/CD...
Stars: ✭ 15 (-82.95%)
Mutual labels:  letsencrypt, rancher
docker-nginx-certbot
Automatically create and renew website certificates for free using the Let's Encrypt certificate authority.
Stars: ✭ 367 (+317.05%)
Mutual labels:  letsencrypt, ssl-certificates
ght-acme.sh
Shell script to sign certificate by the letsencrypt CA
Stars: ✭ 31 (-64.77%)
Mutual labels:  letsencrypt, ssl-certificates
Certes
A client implementation for the Automated Certificate Management Environment (ACME) protocol
Stars: ✭ 357 (+305.68%)
Mutual labels:  letsencrypt, ssl-certificates
Ssl Proxy
🔒 Simple zero-config SSL reverse proxy with real autogenerated certificates (LetsEncrypt, self-signed, provided)
Stars: ✭ 427 (+385.23%)
Mutual labels:  letsencrypt, ssl-certificates
Docker Letsencrypt Certgen
Docker image to generate, renew, revoke RSA and/or ECDSA SSL certificates from LetsEncrypt CA using certbot and acme.sh clients in automated fashion
Stars: ✭ 64 (-27.27%)
Mutual labels:  letsencrypt, ssl-certificates
Nginx Le
Nginx with automatic let's encrypt (docker image)
Stars: ✭ 475 (+439.77%)
Mutual labels:  letsencrypt, ssl-certificates
Certify
SSL Certificate Manager UI for Windows, powered by Let's Encrypt. Download from certifytheweb.com
Stars: ✭ 1,075 (+1121.59%)
Mutual labels:  letsencrypt, ssl-certificates
Castore
Up-to-date certificate store for Elixir.
Stars: ✭ 62 (-29.55%)
Mutual labels:  ssl-certificates
Esp8266workshop
IoT workshop based on ESP8266, a DHT11/22 and neopixel RGB LED
Stars: ✭ 71 (-19.32%)
Mutual labels:  ssl-certificates
Terraform Rancher Ha Example
Terraform files for deploying a Rancher HA cluster in AWS
Stars: ✭ 61 (-30.68%)
Mutual labels:  rancher
Dockerize Your Dev
Docker compose a VM to get LetsEncrypt / NGINX proxy auto provisioning, ELK logging, Prometheus / Grafana monitoring, Portainer GUI, and more...
Stars: ✭ 61 (-30.68%)
Mutual labels:  letsencrypt
Mailserver
⚠️ UNMAINTAINED - Simple and full-featured mail server using Docker
Stars: ✭ 1,267 (+1339.77%)
Mutual labels:  letsencrypt
Acmesharp
An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
Stars: ✭ 1,161 (+1219.32%)
Mutual labels:  letsencrypt
Letsencrypt heroku
Automated letsencrypt setup for heroku
Stars: ✭ 58 (-34.09%)
Mutual labels:  letsencrypt

Rancher Let's Encrypt Service

Let's Encrypt verification

Let's Encrypt has two methods of verifying ownership of domains. The first is through the addition of a custom DNS record (say acme-12321313.subdomain.domain.com). This is what https://github.com/janeczku/rancher-letsencrypt does. That service creates Let's Encrypt challenges via DNS resolution. The other way of proving ownership of domains is through a webserver webroot over HTTP.

Update: The janeczku/rancher-letsencrypt project now supports HTTP webroot verification. The Tozny project was created many months before this feature was added.

Our Service

With our environment, we wanted to do webroot verification for Let's Encrypt and Rancher. We wanted a service that would manage TLS certificates automatically, and renew them as needed. We also wanted this tightly integrated with Rancher for complete automation. This way load balancers (and other services) could automatically pick up certs through the Rancher API. Also, when we update a cert in Rancher, the load balancers will receive the updated cert with zero downtime. We also did not want to give keys for updating DNS records for our entire domain to every rancher environment for security purposes (isolation is best!)

Tozny has been using this service in production for over a year now, and has been battle tested. We renew over 40 subdomains regularly without issue.

How it Works

The service launches two containers:

  • letsencrypt-nginx
  • letsencrypt-python

The letsencrypt-nginx container is stock nginx, but shares the webroot with the letsencrypt-python service container. This way the letsencrypt-python container can add ACME challenges to the <host>/.well-known/acme-challenge/ directory on the webserver for verification. The python container is a sidekick of the nginx container. The containers are launched as a Rancher Service Account, so special environment variables containing the Rancher server API url, and access keys are passed into the container at runtime.

Example Rancher Load Balancer (HAProxy) GUI Config

(Based on Rancher GUI v1.3.3)

  1. Use the "Add Service" dropdown to select "Add Load Balancer" or edit an existing Load Balancer
  2. If empty, fill in the Name
  3. Enter the following into the Port Rules section for each server for which you are requesting a certificate:
Access Protocol Request Host Port Path Target Port
Public HTTP yourserver.name.com 80 /.well-known/ letsencrypt-nginx 80
Example "Target" is based on the default container name letsencrypt-nginx used by this project

Note: If you are using custom haproxy.cfg settings to redirect http traffic to https (or wish to do so now), make sure to exclude the /.well-known/ directory using !{ url_dir /.well-known/ } as in:

frontend 80
  redirect scheme https code 301 if !{ url_dir /.well-known/ } !{ ssl_fc }

This example custom haproxy.cfg will merge the redirect setting with the default Rancher haproxy.cfg frontend definition and set up permanent ("301") redirects to HTTPS for all other HTTP traffic.

Requirements

  • DNS control of domain names (ability to create host.subdomain.domain.com records to point to Rancher IP)
  • Front-end load balancer exposing a privileged port (less than 1024) to the internet for Let's Encrypt verification
  • This Rancher service
  • Rancher Cattle as Container Scheduler/Orchestrator
  • Rancher v1.1.4 - v1.4.2 (versions tested with this service)

How to use

Create a front end load balancer (or use the one in traffic-manager directory). If you are making one, you need to make sure it is a L7 HTTP load balancer on your chosen privileged port. This way the load balancer can redirect /.well-known/* traffic to the letsencrypt-nginx container for verification. You can then route all other traffic to your normal HTTP services. This way only during verification does traffic get directed to the letsencrypt-nginx container.

Rancher Compose

Use rancher-compose up to launch the stack in rancher. In order to get a Let's Encrypt Production certificate, you must set the environment variable STAGING=False. This will then tell the service to use the production Let's Encrypt api instead of the staging api. To use the environment file, you need to pass the path using the --env-file or -e option.

Rancher Catalog (UI)

Add this repository as a catalog to your rancher instance:

  1. Open Rancher
  2. Select Admin in the navigation
  3. Select Settings

In the Catalog section you can add this catalog by entering a name (e.g. rancher-lets-encrypt), the URL to this repository and a branch.

Afterwards you will be able to select the new catalog from the Catalog menu item in the navigation. There you will find the Rancher Let's Encrypt Service. By clicking View Details you can configure the service to your needs and then launch it.

Certificate Workflows

"staging" refers to Let's Encrypt staging API. "production" refers to Let's Encrypt production API.

This flowchart/execution diagram shows all the cases the service deals with, and how it responds to different stages.

  • get certs from rancher API
    • local copy of cert
      • cert in rancher
        • upgrade staging cert to production
          • create cert
          • push to rancher
        • upgrade self signed cert to production
          • create cert
          • push to rancher
        • rancher cert expired
          • local cert expired
            • create cert (renew)
            • push to rancher
          • local cert not expired
            • push to rancher
      • cert not in rancher
        • local cert expired
          • create cert
          • push to rancher
        • local cert not expired
          • push to rancher
    • no local copy of cert
      • create cert
      • push to rancher
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].