<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Tailscale on Idle Daylight</title><link>https://blog.kiserai.net/tags/tailscale/</link><description>Recent content in Tailscale on Idle Daylight</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 24 Oct 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.kiserai.net/tags/tailscale/index.xml" rel="self" type="application/rss+xml"/><item><title>Hardening Tailscale on Arch Linux With Polkit &gt;= 106</title><link>https://blog.kiserai.net/posts/hardening-tailscale-on-arch-linux-polkit-106/</link><pubDate>Tue, 24 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.kiserai.net/posts/hardening-tailscale-on-arch-linux-polkit-106/</guid><description>&lt;p&gt;&lt;a href="https://tailscale.com/"&gt;Tailscale&lt;/a&gt; is an easy and free service for creating your own mesh VPN, built on &lt;a href="https://www.wireguard.com/"&gt;Wireguard&lt;/a&gt; and easier to scale. Tailscale does provide &lt;a href="https://tailscale.com/kb/1279/security-node-hardening/"&gt;instructions&lt;/a&gt; for hardening it - reducing its privileges to the minimum necessary to run. However, the instructions don&amp;rsquo;t fully work for Linux distributions running &lt;a href="https://discourse.ubuntu.com/t/use-of-javascript-rules-in-polkit/13892"&gt;polkit &amp;gt;= 106&lt;/a&gt;, like Arch Linux.&lt;/p&gt;</description><content:encoded><![CDATA[<p><a href="https://tailscale.com/">Tailscale</a> is an easy and free service for creating your own mesh VPN, built on <a href="https://www.wireguard.com/">Wireguard</a> and easier to scale.  Tailscale does provide <a href="https://tailscale.com/kb/1279/security-node-hardening/">instructions</a> for hardening it - reducing its privileges to the minimum necessary to run.  However, the instructions don&rsquo;t fully work for Linux distributions running <a href="https://discourse.ubuntu.com/t/use-of-javascript-rules-in-polkit/13892">polkit &gt;= 106</a>, like Arch Linux.</p>
<h1 id="solution">Solution</h1>
<p>The solution I came up with is, instead of using the Tailscale-provided polkit configuration, create <code>/etc/polkit-1/rules.d/99-tailscaled-dns.rules</code> with the following content:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#a6e22e">polkit</span>.<span style="color:#a6e22e">addRule</span>(<span style="color:#66d9ef">function</span>(<span style="color:#a6e22e">action</span>, <span style="color:#a6e22e">subject</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">action</span>.<span style="color:#a6e22e">id</span>.<span style="color:#a6e22e">startsWith</span>(<span style="color:#e6db74">&#34;org.freedesktop.resolve1.&#34;</span>) <span style="color:#f92672">&amp;&amp;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">subject</span>.<span style="color:#a6e22e">user</span> <span style="color:#f92672">==</span> <span style="color:#e6db74">&#34;tailscaled&#34;</span>)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#a6e22e">polkit</span>.<span style="color:#a6e22e">Result</span>.<span style="color:#a6e22e">YES</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>});
</span></span></code></pre></div><p>Then restart it with <code>sudo systemctl restart polkit.service</code> .</p>
<p>I have filed <a href="https://github.com/tailscale/tailscale/issues/9344">#9344</a> and hope the official documentation will be updated soon, as Ubuntu 23.10 and later have finally updated polkitd.</p>]]></content:encoded></item></channel></rss>