Giter Site home page Giter Site logo

angela-d / letsencrypt-intranet-automation Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 1.0 46 KB

Automate wildcard SSL dispersal of private, non-public facing websites using Let's Encrypt SSL certificates.

License: GNU General Public License v3.0

Shell 61.50% PowerShell 38.50%
letsencrypt letsencrypt-certificates letsencrypt-windows letsencrypt-utils ssl syncthing letsencrypt-cli letsencrypt-https letsencrypt-service synology synology-nas

letsencrypt-intranet-automation's Introduction

Let's Encrypt Intranet Automation for Wildcard SSL

This is more of a documentation repo, as opposed to scripting, as no environment will be exactly the same. This also isn't something that's typically done more than once, negating the need for a 'setup script.'

There's many different ways this can be done, if you know of a more efficient way, please share!!

acme.sh being another method of achieving SSL automation.

  • Currently, Let's Encrypt doesn't offer certs to sites without public-facing DNS. There's a lot of situations where you wouldn't want to place sensitive domains in DNS and even just opening port 80 for Let's Encrypt could reveal 'too much info,' by just advertising the existence of these subdomains.

  • To circumvent this, set up an internal, non-public-facing Debian server that will handle all SSL certificate transactions for all of the internal sites.

  • I also have a separate public-facing server running BIND for DNS, that handles the public side of things. I will base my notes off of this, assuming your environment will be the same.

Adjust things for your environment as you see fit!

Topology

  • DNS server (Ubuntu or Debian) - public facing
  • Cert server (distributor) obtains a wildcard SSL from a parent domain referenced in DNS server (Ubuntu or Debian) - internal
  • Internal servers receive certs from Cert server via Syncthing
  • All internal sites utilize a subdomain, so a wildcard cert is issued to them; allowing all to use the same certificate
  1. Initial setup with the DNS & Cert servers - Public-facing DNS + distributor server steup

Optional, Environment-Specific Setups

  1. Syncthing on Debian - Notes for Linux-based http intranet server setups
  2. NPS/Radius - Network policy SSL for wifi authentication
  3. Synology - https cert for the Synology NAS
  4. Windows - Getting certs onto a Windows machine via Syncthing, from the Cert server

Post-renewal Hooks on the Cert server

After your Cert server is setup, you can put your hook scripts in /etc/letsencrypt/renewal-hooks

I left a sample of popular applications like Synology, Snipeit, PRTG and Papercut in scripts/renewal-hooks/deploy

In modern versions of certbot on Ubuntu/Debian, you don't need to specify the post-renewal hooks in your certbot renew cron, just the presence of scripts in this directory should see them run after a successful renewal.

The post-renewal scripts will take a copy of the live certificate created by Let's Encrypt, rename & convert (if necessary) for its destination server.

Potential Bugs after Setup

Depending on your naming scheme for the /etc/letsencrypt/renewal-hooks/deploy scripts, if the primary cert directory you're pulling from (ie. /home/syncthing/example.com/ if you go by the nginx example) doesn't get updated before nginx.sh runs, you'll run into a chicken and egg situation; so you'll want to ensure the renewal scripts are ordered accordingly.. something like 01-primary.sh, 02-nginx.sh)

An alternative approach is to simply copy from /etc/letsencrypt/live/example.com/cert.pem and so on.

letsencrypt-intranet-automation's People

Contributors

angela-d avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

snk0752

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.