<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dnssec on SROEMER</title>
    <link>/tags/dnssec/</link>
    <description>Recent content in Dnssec on SROEMER</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>Stefan Römer</copyright>
    <lastBuildDate>Tue, 01 Oct 2024 14:27:00 +0700</lastBuildDate><atom:link href="/tags/dnssec/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>DANE-SMTP enabled</title>
      <link>/posts/2024/10/dane-smtp/</link>
      <pubDate>Tue, 01 Oct 2024 14:27:00 +0700</pubDate>
      
      <guid>/posts/2024/10/dane-smtp/</guid>
      <description>&lt;p&gt;After setting up my mail server I already set up &lt;code&gt;SPF&lt;/code&gt;, &lt;code&gt;DKIM&lt;/code&gt;, &lt;code&gt;DMARC&lt;/code&gt; and &lt;code&gt;MTA-STS&lt;/code&gt; but was not yet sure about how to
deal with &lt;a href=&#34;https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities&#34;&gt;DANE&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;DANE&lt;/code&gt; uses a &lt;code&gt;TLSA&lt;/code&gt; entry on the &lt;code&gt;DNS&lt;/code&gt; server to publish a services certificate or key. This means that a client can
verify that it is talking to the correct server without relying on any kind of CA. All this is based on
&lt;a href=&#34;https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions&#34;&gt;DNSSEC&lt;/a&gt; which ensures the authenticity and data
integrity of the &lt;code&gt;DNS&lt;/code&gt; entries.&lt;/p&gt;</description>
      <content>&lt;p&gt;After setting up my mail server I already set up &lt;code&gt;SPF&lt;/code&gt;, &lt;code&gt;DKIM&lt;/code&gt;, &lt;code&gt;DMARC&lt;/code&gt; and &lt;code&gt;MTA-STS&lt;/code&gt; but was not yet sure about how to
deal with &lt;a href=&#34;https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities&#34;&gt;DANE&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;DANE&lt;/code&gt; uses a &lt;code&gt;TLSA&lt;/code&gt; entry on the &lt;code&gt;DNS&lt;/code&gt; server to publish a services certificate or key. This means that a client can
verify that it is talking to the correct server without relying on any kind of CA. All this is based on
&lt;a href=&#34;https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions&#34;&gt;DNSSEC&lt;/a&gt; which ensures the authenticity and data
integrity of the &lt;code&gt;DNS&lt;/code&gt; entries.&lt;/p&gt;
&lt;p&gt;While this concept in general is pretty neat, it has the requirement of &lt;code&gt;DNS&lt;/code&gt; entries to be updated when a certificate or
key changes. Additionally just simply updating an entry will no be enough, since other &lt;code&gt;DNS&lt;/code&gt; servers still might have the
old key cached. Therefore a more sophisticated rollover mechanism would be required. Due to the short life of
&lt;a href=&#34;https://letsencrypt.org/&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; certificates this is even more relevant.&lt;/p&gt;
&lt;p&gt;Luckily &lt;a href=&#34;https://certbot.eff.org/&#34;&gt;Certbot&lt;/a&gt; provides the option &lt;code&gt;--reuse-key&lt;/code&gt; to circumvent the requirement of updating
the &lt;code&gt;DNS&lt;/code&gt; entries by reusing the existing key. Therefore a &lt;code&gt;TLSA&lt;/code&gt; entry can be generated from the current public key and
will not require updating as well since the key does not change.&lt;/p&gt;
&lt;p&gt;For generation of an according &lt;code&gt;TLSA&lt;/code&gt; entry &lt;a href=&#34;https://www.huque.com/&#34;&gt;Shumon Huque&lt;/a&gt; has a very handy
&lt;a href=&#34;https://www.huque.com/bin/gen_tlsa&#34;&gt;TLSA Record Generator&lt;/a&gt; on his website.
The entry in this case must be for usage &lt;code&gt;DANE-EE&lt;/code&gt; with selector &lt;code&gt;1 - SPKI&lt;/code&gt;. I use a &lt;code&gt;SHA-256&lt;/code&gt; hash and got following
result:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;_25._tcp.vs.senvang.org. IN TLSA 3 1 1 (
                  5634d5e1ce5f1e4a8ab25cd8335c97ab76e1215e09c157568e5c9a3dc39a
                  a491
)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alternatively you can generate the hash with &lt;code&gt;openssl&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;openssl x509 -in cert.pem -pubkey -noout | openssl ec -pubin --outform der | sha256sum
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Obviously this does not resolve the need for a clean rollover when a key change happens, but it massively reduces the
frequency and therefore the risk and it gives me time to think about how to get this automated.&lt;/p&gt;
</content>
    </item>
    
  </channel>
</rss>
