Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Lego | 6,555 | 601 | 8 days ago | 39 | September 01, 2020 | 159 | mit | Go | ||
Let's Encrypt/ACME client and library written in Go | ||||||||||
Certmagic | 4,671 | 565 | 5 days ago | 102 | August 17, 2023 | 10 | apache-2.0 | Go | ||
Automatic HTTPS for any Go program: fully-managed TLS certificate issuance and renewal | ||||||||||
Acme Dns | 1,835 | 2 days ago | 5 | January 11, 2021 | 137 | mit | Go | |||
Limited DNS server with RESTful HTTP API to handle ACME DNS challenges easily and securely. | ||||||||||
Keyvault Acmebot | 777 | 2 days ago | 17 | apache-2.0 | C# | |||||
Automated ACME SSL/TLS certificates issuer for Azure Key Vault (App Gateway / Front Door / CDN / others) | ||||||||||
Posh Acme | 689 | 4 days ago | 15 | mit | PowerShell | |||||
PowerShell module and ACME client to create certificates from Let's Encrypt (or other ACME CA) | ||||||||||
Acme Client | 478 | 163 | 37 | 2 months ago | 46 | October 06, 2023 | 9 | mit | Ruby | |
A Ruby client for the letsencrypt's ACME protocol. | ||||||||||
Certes | 451 | 14 | 29 | a year ago | 52 | October 04, 2021 | 12 | mit | C# | |
A client implementation for the Automated Certificate Management Environment (ACME) protocol | ||||||||||
Appservice Acmebot | 377 | 2 days ago | 1 | apache-2.0 | C# | |||||
Automated ACME SSL/TLS certificates issuer for Azure App Service (Web Apps / Functions / Containers) | ||||||||||
Crypt Le | 336 | 9 months ago | 6 | artistic-2.0 | Perl | |||||
Crypt::LE - Let's Encrypt / Buypass / ZeroSSL and other ACME-servers client and library in Perl for obtaining free SSL certificates (inc. generating RSA/ECC keys and CSRs). HTTP/DNS verification is supported out of the box, EAB (External Account Binding) supported, easily extended with plugins, easily dockerized. | ||||||||||
Acme Nginx | 288 | 1 | a year ago | 13 | October 27, 2022 | 5 | gpl-3.0 | Python | ||
python acme client for nginx |
A simplified DNS server with a RESTful HTTP API to provide a simple way to automate ACME DNS challenges.
Many DNS servers do not provide an API to enable automation for the ACME DNS challenges. Those which do, give the keys way too much power. Leaving the keys laying around your random boxes is too often a requirement to have a meaningful process automation.
Acme-dns provides a simple API exclusively for TXT record updates and should be used with ACME magic "_acme-challenge" - subdomain CNAME records. This way, in the unfortunate exposure of API keys, the effects are limited to the subdomain TXT record in question.
So basically it boils down to accessibility and security.
For longer explanation of the underlying issue and other proposed solutions, see a blog post on the topic from EFF deeplinks blog: https://www.eff.org/deeplinks/2018/02/technical-deep-dive-securing-automation-acme-dns-challenge-validation
yourdomain.tld
and *.yourdomain.tld
, as both of the challenges point to the same subdomain.A client application for acme-dns with support for Certbot authentication hooks is available at: acme-dns/acme-dns-client.
Using acme-dns is a three-step process (provided you already have the self-hosted server set up):
_acme-challenge.domainiwantcertfor.tld. CNAME a097455b-52cc-4569-90c8-7a4b97c6eba8.auth.example.org
)The method returns a new unique subdomain and credentials needed to update your record.
Fulldomain is where you can point your own _acme-challenge
subdomain CNAME record to.
With the credentials, you can update the TXT response in the service to match the challenge token, later referred as ___validation_token_received_from_the_ca___, given out by the Certificate Authority.
Optional:: You can POST JSON data to limit the /update
requests to predefined source networks using CIDR notation.
POST /register
{
"allowfrom": [
"192.168.100.1/24",
"1.2.3.4/32",
"2002:c0a8:2a00::0/40"
]
}
Status: 201 Created
{
"allowfrom": [
"192.168.100.1/24",
"1.2.3.4/32",
"2002:c0a8:2a00::0/40"
],
"fulldomain": "8e5700ea-a4bf-41c7-8a77-e990661dcc6a.auth.acme-dns.io",
"password": "htB9mR9DYgcu9bX_afHF62erXaH2TS7bg9KW3F7Z",
"subdomain": "8e5700ea-a4bf-41c7-8a77-e990661dcc6a",
"username": "c36f50e8-4632-44f0-83fe-e070fef28a10"
}
The method allows you to update the TXT answer contents of your unique subdomain. Usually carried automatically by automated ACME client.
POST /update
Header name | Description | Example |
---|---|---|
X-Api-User | UUIDv4 username received from registration | X-Api-User: c36f50e8-4632-44f0-83fe-e070fef28a10 |
X-Api-Key | Password received from registration | X-Api-Key: htB9mR9DYgcu9bX_afHF62erXaH2TS7bg9KW3F7Z |
{
"subdomain": "8e5700ea-a4bf-41c7-8a77-e990661dcc6a",
"txt": "___validation_token_received_from_the_ca___"
}
Status: 200 OK
{
"txt": "___validation_token_received_from_the_ca___"
}
The method can be used to check readiness and/or liveness of the server. It will return status code 200 on success or won't be reachable.
GET /health
You are encouraged to run your own acme-dns instance, because you are effectively authorizing the acme-dns server to act on your behalf in providing the answer to the challenging CA, making the instance able to request (and get issued) a TLS certificate for the domain that has CNAME pointing to it.
See the INSTALL section for information on how to do this.
Install Go 1.13 or newer.
Build acme-dns:
git clone https://github.com/joohoi/acme-dns
cd acme-dns
export GOPATH=/tmp/acme-dns
go build
Move the built acme-dns binary to a directory in your $PATH, for example:
sudo mv acme-dns /usr/local/bin
Edit config.cfg to suit your needs (see configuration). acme-dns
will read the configuration file from /etc/acme-dns/config.cfg
or ./config.cfg
, or a location specified with the -c
flag.
If your system has systemd, you can optionally install acme-dns as a service so that it will start on boot and be tracked by systemd. This also allows us to add the CAP_NET_BIND_SERVICE
capability so that acme-dns can be run by a user other than root.
Make sure that you have moved the configuration file to /etc/acme-dns/config.cfg
so that acme-dns can access it globally.
Move the acme-dns executable from ~/go/bin/acme-dns
to /usr/local/bin/acme-dns
(Any location will work, just be sure to change acme-dns.service
to match).
Create a minimal acme-dns user: sudo adduser --system --gecos "acme-dns Service" --disabled-password --group --home /var/lib/acme-dns acme-dns
.
Move the systemd service unit from acme-dns.service
to /etc/systemd/system/acme-dns.service
.
Reload systemd units: sudo systemctl daemon-reload
.
Enable acme-dns on boot: sudo systemctl enable acme-dns.service
.
Run acme-dns: sudo systemctl start acme-dns.service
.
If you did not install the systemd service, run acme-dns
. Please note that acme-dns needs to open a privileged port (53, domain), so it needs to be run with elevated privileges.
Pull the latest acme-dns Docker image: docker pull joohoi/acme-dns
.
Create directories: config
for the configuration file, and data
for the sqlite3 database.
Copy configuration template to config/config.cfg
.
Modify the config.cfg
to suit your needs.
Run Docker, this example expects that you have port = "80"
in your config.cfg
:
docker run --rm --name acmedns \
-p 53:53 \
-p 53:53/udp \
-p 80:80 \
-v /path/to/your/config:/etc/acme-dns:ro \
-v /path/to/your/data:/var/lib/acme-dns \
-d joohoi/acme-dns
Create directories: config
for the configuration file, and data
for the sqlite3 database.
Copy configuration template to config/config.cfg
.
Copy docker-compose.yml from the project, or create your own.
Edit the config/config.cfg
and docker-compose.yml
to suit your needs, and run docker-compose up -d
.
Note: In this documentation:
auth.example.org
is the hostname of the acme-dns server*.auth.example.org
records198.51.100.1
is the public IP address of the system running acme-dnsThese values should be changed based on your environment.
You will need to add some DNS records on your domain's regular DNS server:
NS
record for auth.example.org
pointing to auth.example.org
(this means, that auth.example.org
is responsible for any *.auth.example.org
records)A
record for auth.example.org
pointing to 198.51.100.1
AAAA
record pointing to the IPv6 address._acme-challenge
CNAME
subdomain added. The client you use will explain how to do this.You may want to test that acme-dns is working before using it for real queries.
Confirm that DNS lookups for the acme-dns subdomain works as expected: dig auth.example.org
.
Call the /register
API endpoint to register a test domain:
$ curl -X POST https://auth.example.org/register
{"username":"eabcdb41-d89f-4580-826f-3e62e9755ef2","password":"pbAXVjlIOE01xbut7YnAbkhMQIkcwoHO0ek2j4Q0","fulldomain":"d420c923-bbd7-4056-ab64-c3ca54c9b3cf.auth.example.org","subdomain":"d420c923-bbd7-4056-ab64-c3ca54c9b3cf","allowfrom":[]}
/update
API endpoint to set a test TXT record. Pass the username
, password
and subdomain
received from the register
call performed above:$ curl -X POST \
-H "X-Api-User: eabcdb41-d89f-4580-826f-3e62e9755ef2" \
-H "X-Api-Key: pbAXVjlIOE01xbut7YnAbkhMQIkcwoHO0ek2j4Q0" \
-d '{"subdomain": "d420c923-bbd7-4056-ab64-c3ca54c9b3cf", "txt": "___validation_token_received_from_the_ca___"}' \
https://auth.example.org/update
Note: The txt
field must be exactly 43 characters long, otherwise acme-dns will reject it
$ dig -t txt @auth.example.org d420c923-bbd7-4056-ab64-c3ca54c9b3cf.auth.example.org
[general]
# DNS interface. Note that systemd-resolved may reserve port 53 on 127.0.0.53
# In this case acme-dns will error out and you will need to define the listening interface
# for example: listen = "127.0.0.1:53"
listen = "127.0.0.1:53"
# protocol, "both", "both4", "both6", "udp", "udp4", "udp6" or "tcp", "tcp4", "tcp6"
protocol = "both"
# domain name to serve the requests off of
domain = "auth.example.org"
# zone name server
nsname = "auth.example.org"
# admin email address, where @ is substituted with .
nsadmin = "admin.example.org"
# predefined records served in addition to the TXT
records = [
# domain pointing to the public IP of your acme-dns server
"auth.example.org. A 198.51.100.1",
# specify that auth.example.org will resolve any *.auth.example.org records
"auth.example.org. NS auth.example.org.",
]
# debug messages from CORS etc
debug = false
[database]
# Database engine to use, sqlite3 or postgres
engine = "sqlite3"
# Connection string, filename for sqlite3 and postgres://$username:$password@$host/$db_name for postgres
# Please note that the default Docker image uses path /var/lib/acme-dns/acme-dns.db for sqlite3
connection = "/var/lib/acme-dns/acme-dns.db"
# connection = "postgres://user:password@localhost/acmedns_db"
[api]
# listen ip eg. 127.0.0.1
ip = "0.0.0.0"
# disable registration endpoint
disable_registration = false
# listen port, eg. 443 for default HTTPS
port = "443"
# possible values: "letsencrypt", "letsencryptstaging", "cert", "none"
tls = "letsencryptstaging"
# only used if tls = "cert"
tls_cert_privkey = "/etc/tls/example.org/privkey.pem"
tls_cert_fullchain = "/etc/tls/example.org/fullchain.pem"
# only used if tls = "letsencrypt"
acme_cache_dir = "api-certs"
# optional e-mail address to which Let's Encrypt will send expiration notices for the API's cert
notification_email = ""
# CORS AllowOrigins, wildcards can be used
corsorigins = [
"*"
]
# use HTTP header to get the client ip
use_header = false
# header name to pull the ip address / list of ip addresses from
header_name = "X-Forwarded-For"
[logconfig]
# logging level: "error", "warning", "info" or "debug"
loglevel = "debug"
# possible values: stdout, TODO file & integrations
logtype = "stdout"
# file path for logfile TODO
# logfile = "./acme-dns.log"
# format, either "json" or "text"
logformat = "text"
The RESTful acme-dns API can be exposed over HTTPS in two ways:
tls = "letsencrypt"
and letting acme-dns issue its own certificate
automatically with Let's Encrypt.tls = "cert"
and providing your own HTTPS certificate chain and
private key with tls_cert_fullchain
and tls_cert_privkey
.Where possible the first option is recommended. This is the easiest and safest way to have acme-dns expose its API over HTTPS.
Warning: If you choose to use tls = "cert"
you must take care that the
certificate does not expire! If it does and the ACME client you use to issue the
certificate depends on the ACME DNS API to update TXT records you will be stuck
in a position where the API certificate has expired but it can't be renewed
because the ACME client will refuse to connect to the ACME DNS API it needs to
use for the renewal.
-c
to specify location of config file.acme-dns is open for contributions. If you have an idea for improvement, please open an new issue or feel free to write a PR!
acme-dns is released under the MIT License.