A Few Notes on LetsEncrypt
I'd originally planned to write a post about configuring Burp Collaborator with LetsEncrypt, but after re-reading an article I'd used to do part of the provisioning, I couldn't find much else to add.
One area I did want to dig into a bit more was LetsEncrypt itself, specifically the DNS plugins.
DNS Plugins
Part of the LetsEncrypt enrollment process is proving you own the domain you're requesting a certificate for. There are a few ways of doing this, but I'm most interested in the DNS route.
When running certbot
with the certonly
flag, you'll be provided with a special TXT record. You then add this record to the domain for which you're requesting the certificate, proving that you own the domain, and your certificate is issued.
I'm not a big fan of manual processes so I went poking around the LetsEncrypt documentation to figure out how I could automate this. Turns out there are DNS plugins available to automate the addition, validation, and removal of that TXT challenge.
An added benefit to this technique is I don't need to make any modifications to the firewall or the software that may already be using ports required for verification.
I'm going to focus on Cloudflare, but the process should be similar for the other providers.
Installation
To install certbot
on Ubuntu 18.04:
|
|
Next, create your cloudflare.ini
file:
|
|
Ensure the correct permissions are set:
|
|
Configuration
Finally, unleash certbot
:
|
|
From the above:
certonly
- We're not using "automatic" installation.--dns-cloudflare
- Use the Cloudflare DNS plugin.--dns-cloudflare-credentials
- Path to our credential file. Permissions must be0600
.-d *.example.com
- We want a wildcard certificate forexample.com
.--agree-tos
- Don't prompt for ToS.-m you@example.com
- Email address for urgent notifications.-n
- Run in non-interactive mode.--server https://acme-v02.api.letsencrypt.org/directory
- Required for wildcard certificates.
If all goes well, you should see something like this:
|
|
Testing
To ensure we've got everything set up correctly:
|
|
Note that you'll need to leave your cloudflare.ini
file on the server for auto-renew to work.
Updates
I spent a bit of time researching how updates work but I'm pretty sure that was for naught. Reviewing the install process I found the following:
|
|
Those files, respectively, contain the following:
|
|
I'm not super familiar with systemd so I did a bit more digging:
|
|
And there you have it!