<p dir="ltr"><br>
On Jul 20, 2015 4:20 AM, &quot;Florian Weimer&quot; &lt;<a href="mailto:fweimer@redhat.com">fweimer@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On 07/18/2015 03:53 PM, Andrew Lutomirski wrote:<br>
&gt;<br>
&gt; &gt; Nothing.  Inheritable capabilities are nearly useless.<br>
&gt;<br>
&gt; Wow.<br>
&gt;<br>
&gt; The program that sparked this thread is a Go program.  So basically, we<br>
&gt; have these options if we do not want to run with full capabilities:<br>
&gt;<br>
&gt; (a) Run with UID=0 with restricted capabilities, like many systemd<br>
&gt; services already do.  Do not use fscaps (which are not needed because of<br>
&gt; the UID=0 special case).  This is rather pointless because UID=0 does<br>
&gt; not need capabilities to compromise the system.<br>
&gt;<br>
&gt; (b) Make a copy of the file, put it in a directory which only the<br>
&gt; service user can read (or ship it with 750 permissions and the service<br>
&gt; group controlling it), and set fscaps.  The downside is the large binary<br>
&gt; size (it has to be a copy, a link won&#39;t work).  And the service user<br>
&gt; could still run the service with command line options that allow<br>
&gt; privilege escalation.<br>
&gt;</p>
<p dir="ltr">If you set inheritable fscaps but not permitted, this should be reasonably safe.</p>
<p dir="ltr">Alas, you will have to remove fscaps entirely to be compatible with ambient caps.</p>
<p dir="ltr">--Andy<br></p>
<p dir="ltr">--Andy</p>