<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sig-I/O (Posts about dns)</title><link>https://sig-io.nl/</link><description></description><atom:link href="https://sig-io.nl/categories/dns.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 &lt;a href="mailto:mark@sig-io.nl"&gt;Mark Janssen&lt;/a&gt; </copyright><lastBuildDate>Sun, 21 Jul 2024 16:00:28 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Automating (Wildcard) certificate renewal with Acme.sh, DeSec.io and some DNS magic</title><link>https://sig-io.nl/posts/acmesh-desec-dns-acme-challenge-cname/</link><dc:creator>Mark Janssen</dc:creator><description>&lt;p&gt;Automatically requesting TLS/SSL certificates using the ACME protocol is quite nice.
Usually to just get a regular TLS certificate, you just have to run an ACME capable tool
or webserver, which will place a textfile in /.well-known/acme-challenge on your
webserver, which is then used to validate control over the domain.&lt;/p&gt;
&lt;p&gt;Alternatively you can use DNS based validation. This is even required when requesting
wildcard certificates, for example, when requesting a certificate for '*.sig-io.nl'.&lt;/p&gt;
&lt;p&gt;When validating using DNS, you need to have your ACME client create a DNS record
'_acme-challenge' in your DNS domain. This can be done using various ACME clients, and I
myself have written modules/plugins for Dehydrated for various DNS providers over the
years.&lt;/p&gt;
&lt;p&gt;Recently I've switched from Dehydrated as my preferred ACME client to Acme.sh. This client
has a massive amount of DNS providers supported in the main codebase. So it will usually
have an interface to whatever DNS system you might use.&lt;/p&gt;
&lt;p&gt;Some of my customers however use domains hosted by (for example) TransIP.nl, which does
have an API to update DNS-records, but usually takes very long (5-10 minutes) to update
records, and also has no granulated access-control to their API. If you have API access,
you can do everything with all domains under that account. This means you can't really
leave credentials to this account in config-files somewhere.&lt;/p&gt;
&lt;p&gt;However, I've now found a solution to these problems that I'm quite satisfied with. I'm
using deSEC.io, a new non-profit, community-oriented DNS provider, with a nice API to do
DNS validations. With deSEC I can create an API key that is limited in time and
source-network. And since deSEC is free, I can create a seperate account just for
acme-validation on an otherwise unused domain.&lt;/p&gt;
&lt;p&gt;So to create a certificate for a customer-domain, I just have them create a CNAME entry in
whatever DNS system they use, which points to my acme-validation only domain-name hosted
at deSEC.io.&lt;/p&gt;
&lt;p&gt;For example, for sig-io.nl I could create a CNAME record '_acme-challenge.sig-io.nl'
pointing to '_acme-challenge.sig-io.nl.acme.example.com'. And then (given that example.com
is a domain I manage with deSEC.io) use Acme.sh to create certificates using this alias
domain using:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;export DOMAIN="sig-io.nl"
acme.sh --issue -d "*.${DOMAIN}" --challenge-alias "${DOMAIN}.acme.example.com" --server letsencrypt --dns dns_desec&lt;/p&gt;
&lt;/blockquote&gt;</description><category>acme-challenge</category><category>acme.sh</category><category>certificates</category><category>cname</category><category>desec.io</category><category>dns</category><category>wildcard</category><guid>https://sig-io.nl/posts/acmesh-desec-dns-acme-challenge-cname/</guid><pubDate>Tue, 11 Jul 2023 16:15:26 GMT</pubDate></item><item><title>LUA-DNS migration</title><link>https://sig-io.nl/posts/migrating-to-luadns/</link><dc:creator>Mark Janssen</dc:creator><description>&lt;p&gt;At Sig-I/O we have (mostly) been using OpenProvider for DNS registrations and hosting over
the last few years. This has mostly been fine, but OpenProvider has been having some
issues every now and then, and is changing things, but not allways for the better.&lt;/p&gt;
&lt;p&gt;After a period of stagnation, they now seem to be developing new features again, but none
of those appeal much, while important bugs and wishlist items remain unfixed.&lt;/p&gt;
&lt;p&gt;We've been looking at alternatives for at least the DNS hosting parts for a while, and
even started looking into setting up our own anycast network of DNS servers, but concluded
that his was too much effort (and money) for what we needed, so the search for a good
matching DNS provider was continued.&lt;/p&gt;
&lt;p&gt;After looking at various options, and trying out some of them with test-domains, we were
most charmed with LuaDNS.net, which is a small Romenian company with a nice working
anycast DNS system and an interesting method for pushing DNS updates.&lt;/p&gt;
&lt;p&gt;LuaDNS has a webinterface for inspecting the zones and records that are served by their
servers, but this interface doesn't allow updates. For updating DNS records there are 2
possible options:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Using a REST api&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using GIT and a notify-hook&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;section id="using-the-rest-api"&gt;
&lt;h2&gt;Using the REST api&lt;/h2&gt;
&lt;p&gt;We use the REST-api for updating temporary records, like the 'acme-challenge' records
needed for ACME validation by Lets-Encrypt, ZeroSSL or BuyPass. This is done using the
dns_lua hook in acme.sh&lt;/p&gt;
&lt;/section&gt;
&lt;section id="using-git-and-notify-hooks"&gt;
&lt;h2&gt;Using GIT and notify-hooks&lt;/h2&gt;
&lt;p&gt;The primary method to add zones and records to LuaDNS is by creating a lua-script or
bind-formatted file in a git repository. This has the added benefit of having an
archive of all previous DNS records. In our case, we host the git repository ourselved on
a Gitea instance.&lt;/p&gt;
&lt;p&gt;Every time a git commit is pushed to this Git repository, gitea sends a webhook to the
LuaDNS api server, which then clones the git repository, parses the lua-scripts and/or
bind zone files, and updates its zone files. A log of this parsing it then sent via e-mail
to the admin account.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="dnssec"&gt;
&lt;h2&gt;DNSSec&lt;/h2&gt;
&lt;p&gt;LuaDNS supports DNSSec, which we had enabled at OpenProvider as well, so for the migration
to LuaDNS we temporarily disabled this (to ease migration). Sadly, LuaDNS doesn't allow
configuring (or querying) the DNSSec keys from the API at this point, but when we asked
about this, we got a quick reply that this would be added in the coming weeks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2022/07/12&lt;/strong&gt;: I just got an e-mail from LuaDNS that this feature has been added,
so there is an API endpoint for DNSSec now.&lt;/p&gt;
&lt;p&gt;This however meant that configuring the DNSSec keys was still somewhat of a manual
excersize at this time. We manually enabled DNSSec on all LuaDNS hosted zones and
copy/pasted the public-keys to a textfile. We then used the OpenProvider API to
reconfigure all our zones to be hosted by LuaDNS and configured the DNSSec keys at the
same time.&lt;/p&gt;
&lt;p&gt;This mostly worked, though some domains gave some issues, so these were then updated by
hand.&lt;/p&gt;
&lt;p&gt;Updating the zones in Openprovider can be done with this api-call:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_41cfb1d06a9c481985fc8744565879df-1" name="rest_code_41cfb1d06a9c481985fc8744565879df-1" href="https://sig-io.nl/posts/migrating-to-luadns/#rest_code_41cfb1d06a9c481985fc8744565879df-1"&gt;&lt;/a&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-X&lt;span class="w"&gt; &lt;/span&gt;PUT&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;a id="rest_code_41cfb1d06a9c481985fc8744565879df-2" name="rest_code_41cfb1d06a9c481985fc8744565879df-2" href="https://sig-io.nl/posts/migrating-to-luadns/#rest_code_41cfb1d06a9c481985fc8744565879df-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;  &lt;/span&gt;https://api.openprovider.eu/v1beta/domains/&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ID&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;a id="rest_code_41cfb1d06a9c481985fc8744565879df-3" name="rest_code_41cfb1d06a9c481985fc8744565879df-3" href="https://sig-io.nl/posts/migrating-to-luadns/#rest_code_41cfb1d06a9c481985fc8744565879df-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;  &lt;/span&gt;-H&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Accept: */*"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;a id="rest_code_41cfb1d06a9c481985fc8744565879df-4" name="rest_code_41cfb1d06a9c481985fc8744565879df-4" href="https://sig-io.nl/posts/migrating-to-luadns/#rest_code_41cfb1d06a9c481985fc8744565879df-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;  &lt;/span&gt;-H&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;OPENPROVIDER_API_BEARER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;a id="rest_code_41cfb1d06a9c481985fc8744565879df-5" name="rest_code_41cfb1d06a9c481985fc8744565879df-5" href="https://sig-io.nl/posts/migrating-to-luadns/#rest_code_41cfb1d06a9c481985fc8744565879df-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;  &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{ \"ns_group\": \"luadns\", \"dnssec_keys\": [ { \"alg\": 13, \"flags\": 257, \"protocol\": 3, \"pub_key\": \"&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DNSSEC&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\", \"readonly\": 1 } ] }"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Where {ID} is the ID of the zone at OpenProvider (which we gathered in a previous script),
and {DNSSEC} is the DNSSec key from LuaDNS, which we manually gathered.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="post-migration-checks"&gt;
&lt;h2&gt;Post Migration Checks&lt;/h2&gt;
&lt;p&gt;After migration we received an e-mail from dnssec-tools, complaining about missing records
we had earlier, so we re-created some tlsa-records and did some more checks while we were
at it.&lt;/p&gt;
&lt;p&gt;Some handy tools to check your various settings and configurations:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference external" href="https://stats.dnssec-tools.org/explore/"&gt;https://stats.dnssec-tools.org/explore/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference external" href="https://dane.sys4.de/smtp/"&gt;https://dane.sys4.de/smtp/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference external" href="https://www.dmarcanalyzer.com/dkim/dkim-checker/"&gt;https://www.dmarcanalyzer.com/dkim/dkim-checker/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference external" href="https://mxtoolbox.com/dmarc.aspx"&gt;https://mxtoolbox.com/dmarc.aspx&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;</description><category>dns</category><category>luadns</category><category>migration</category><category>services</category><category>tooling</category><category>tools</category><guid>https://sig-io.nl/posts/migrating-to-luadns/</guid><pubDate>Sun, 10 Jul 2022 15:50:17 GMT</pubDate></item></channel></rss>