NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.6k stars 2.62k forks source link

DNS CAA record generation #4054

Open D-side opened 1 week ago

D-side commented 1 week ago

Is your feature request related to a problem? Please describe.

As a security hardening measure it's possible to advertise certificate issuing restrictions to CAs using DNS Certification Authority Authorization records (aka DNS CAA).

The simplest CAA value is just an identifier for a CA. This type can be added today with relative ease already with no help from NPM. For Let's Encrypt this is just letsencrypt.org.

Let's Encrypt in particular allows specifying an account that's allowed to request certificates (and not just anyone who happens to be pointed at by the domain), as well as challenge types: https://letsencrypt.org/docs/caa/#what-to-put-in-the-record

Getting to Let's Encrypt account URI in NPM currently seems to require breaking into a container's data volume and finding it there.

It's located in: /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/$HASH/regr.json, which looks something like this:

{"body": {}, "uri": "https://acme-v02.api.letsencrypt.org/acme/acct/12345678"}

Describe the solution you'd like

Ideally, NPM could generate values for the CAA records, considering it knows the CA (Let's Encrypt), the account URI and the challenge type(-s?) it's going to use. The user would have to add the generated records manually, likely in their registrar's UI.

CAA restriction to a specific account would also mean that in an event of a data loss just spinning up a new instance of NPM at the same address is no longer enough and either:

Describe alternatives you've considered

At a minimum, I'd love access to the account URI somewhere in the web UI. That at least plugs the need to look into container's storage, but not having to look up Let's Encrypt's documentation for keywords like parameter names and values for challenge types would also be nice to have. Doing the rest manually isn't much of a problem.

Additional context

A bunch of reading materials on CAA:

Notable gotchas: