<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Selinux on Think before you push the button</title>
        <link>https://stingr.net/tags/selinux/</link>
        <description>Recent content in Selinux on Think before you push the button</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Sun, 09 Mar 2025 22:25:55 +0100</lastBuildDate><atom:link href="https://stingr.net/tags/selinux/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Small and Meaningless things for small people</title>
        <link>https://stingr.net/p/small-and-meaningless-things-for-small-people/</link>
        <pubDate>Sun, 09 Mar 2025 22:25:55 +0100</pubDate>
        
        <guid>https://stingr.net/p/small-and-meaningless-things-for-small-people/</guid>
        <description>&lt;p&gt;For a while now I&amp;rsquo;m working (slowly) on a monumental series of articles about function calls, RPC protocols and arrangements, APIs - all in line to present best and worst practices of modern software engineering. I would like to do it faster, but:&lt;/p&gt;
&lt;blockquote class=&#34;bluesky-embed&#34; data-bluesky-uri=&#34;at://did:plc:t6ubj2wlhc34awzcymh3qpur/app.bsky.feed.post/3ljxk7izke223&#34; data-bluesky-cid=&#34;bafyreiewof6cbmfdj6t5hawofzf2gcb7yx2dfi224b2bnzlbaz4fc5fbpu&#34;&gt;&lt;p lang=&#34;en&#34;&gt;Any country, corp, org, or individual that uses Starlink is subject to the whims, wishes, demands and insults of The Owner. Do so at your peril.&lt;br&gt;&lt;br&gt;&lt;a href=&#34;https://bsky.app/profile/did:plc:t6ubj2wlhc34awzcymh3qpur/post/3ljxk7izke223?ref_src=embed&#34;&gt;[image or embed]&lt;/a&gt;&lt;/p&gt;&amp;mdash; Ron Filipkowski (&lt;a href=&#34;https://bsky.app/profile/did:plc:t6ubj2wlhc34awzcymh3qpur?ref_src=embed&#34;&gt;@ronfilipkowski.bsky.social&lt;/a&gt;) &lt;a href=&#34;https://bsky.app/profile/did:plc:t6ubj2wlhc34awzcymh3qpur/post/3ljxk7izke223?ref_src=embed&#34;&gt;March 9, 2025 at 5:18 PM&lt;/a&gt;&lt;/blockquote&gt;&lt;script async src=&#34;https://embed.bsky.app/static/embed.js&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;
&lt;p&gt;That&amp;rsquo;s the new reality, folks. Apparently we are all small men, exist at the whim of the new &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/Louis_XIV&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;sun king&lt;/a&gt;. &lt;a class=&#34;link&#34; href=&#34;https://sarahkendzior.substack.com/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Who fucking knew&lt;/a&gt; we will end up here.&lt;/p&gt;
&lt;p&gt;Well, nothing matters anymore, so let&amp;rsquo;s try doing some completely meaningless things instead! For example, systemd service hardening!&lt;/p&gt;
&lt;h2 id=&#34;systemd-analyze-security&#34;&gt;systemd-analyze security
&lt;/h2&gt;&lt;p&gt;Here&amp;rsquo;s a starting point for y&amp;rsquo;all. Run &lt;code&gt;systemd-analyze security sshd&lt;/code&gt;. Looks funny, isn&amp;rsquo;t it. All right, to bleach the console run &lt;code&gt;systemd-analyze security irqbalance&lt;/code&gt; (all commands assume fedora 41). But for one &lt;code&gt;irqbalance&lt;/code&gt; we&amp;rsquo;ve got a hundred services which say &amp;ldquo;AAAA UNSAFE&amp;rdquo;. What&amp;rsquo;s going on?&lt;/p&gt;
&lt;p&gt;Same thing as always - it is hard to add security as an afterthought. Historically, all the services were barely protected - before systemd and selinux, best in class was &amp;ldquo;run as a different user&amp;rdquo;. With selinux, it became possible to control all aspects of what the service does - except that almost nobody is capable of doing it, because you need to understand in the greatest detail what the service does and how, and the prevailing culture in our industry is such as the author of the service will rarely bother with that.&lt;/p&gt;
&lt;p&gt;Systemd services brought massive quality of life increase in terms of service configuration, but also provided a few options to improve service security, which are less heavy than selinux. Except even this easy mode is too hard for everyone.&lt;/p&gt;
&lt;p&gt;Anyway, supposedly I care. With selinux, technically I can run things in permissive and use &lt;code&gt;audit2allow&lt;/code&gt; to produce or fine-tune a policy. It&amp;rsquo;d be nice if similar things existed for systemd? Well, it does, it has an unsurprising name &lt;a class=&#34;link&#34; href=&#34;https://www.synacktiv.com/publications/systemd-hardening-made-easy-with-shh&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Systemd Hardening Helper&lt;/a&gt; and it works! To an extent. There are a bunch of todos and not all hardening options are implemented.&lt;/p&gt;
&lt;p&gt;The basic idea is the same as audit2allow - run the service under strace and parse it. That&amp;rsquo;s it, the UX is reasonably good, and while - as mentioned - not all options are covered, it provides a good starting point for further improvements.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s written in Rust, so here&amp;rsquo;s a chance to learn more of it and improve the security of everyday services. And with all the shitshow going on, we need all the security we can get.&lt;/p&gt;
&lt;p&gt;Until the next time, folks. Please try shielding yourselves from &lt;a class=&#34;link&#34; href=&#34;https://www.space.com/space-exploration/launches-spacecraft/spacex-falcon-9-rocket-debris-creates-dramatic-fireball-over-europe-crashes-in-poland&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;orbital bombardment&lt;/a&gt; in the meantime.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
