<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2018-01-31 21:47 GMT+01:00 Petr Menšík <span dir="ltr"><<a href="mailto:pemensik@redhat.com" target="_blank">pemensik@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ludovic,<br></blockquote><div><br></div><div>Hi Petr,</div><div><br></div><div>I didn't expect to discuss directly with the Fedora maintainer :-)</div><div>Just in case you are at DNS devroom of FOSDEM this Sunday: <a href="https://fosdem.org/2018/schedule/track/dns/" target="_blank">https://fosdem.org/<wbr>2018/schedule/track/dns/</a></div><div>I'm interested in to meet you.</div><div><br></div><div>Anyway, about SELinux discussion, I'm convinced that SELinux proposes better security features than systemd before it exists.<br></div><div>However, in Debian universe, no MAC is enabled by default: Some extra default config in systemd will be easier to integrate in the mainstream distribution than a MAC enabled by default :-)</div><div>Moreover, from my small experience of CentOS, I already seen several times in setup documentation of several proprietary software for CentOS that the first step is to disable SELinux first before the installation.</div><div><br></div><div>It's up to you to decide what you want to integrate in systemd config file by default.</div><div>For me, it might be complementary: In fact, it might be interesting to know the pourcentage of CentOS on production without SELinux.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Fedora, CAP_DAC_OVERRIDE is not granted to bind, because it might be<br>
dangerous feature. CAP_DAC_READ_SEARCH is a little bit safer, but still<br>
might be unnecessary. It should be possible to run even without it with<br>
careful permission configuration of keys and config files.<br>
<br>
I think CAP_SYS_RESOURCE is required to automatically adjust maximum<br>
number of file descriptors/sockets from configuration. But I am not 100%<br>
about that.<br></blockquote><div><br></div><div>For this part, you can define values in systemd config file: LimitNOFILE</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I recently rejected request to change from Type=forking. Has anyone got<br>
a patch for bind to support Type=notice systemd service? I would like to<br>
get rid of pid file handling, but Type=simple will not work for me.<br></blockquote><div><br></div><div>Type=notify you mean ? Yes, it would be interesting.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I am not sure if PrivateDevices=yes can be used by default on Fedora. We<br>
package also named-pkcs11 version, which should be able to access<br>
hardware tokens and accelerators. I doubt it would work with that. I<br>
want them to still work if they worked until now. Normal variant might<br>
use that, chroot already has its own empty /dev.<br>
<br>
There is some nice page about this on Fedora wiki:<br>
<a href="https://fedoraproject.org/wiki/Packaging:Systemd#Fields_to_avoid" rel="noreferrer" target="_blank">https://fedoraproject.org/wiki<wbr>/Packaging:Systemd#Fields_to_<wbr>avoid</a><br>
<br></blockquote><div><br></div><div>Thanks for the link, it's interesting.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Dne 15.1.2018 v 18:58 Ludovic Gasc napsal(a):<br>
<div class="gmail-m_-6631153165725632700gmail-HOEnZb"><div class="gmail-m_-6631153165725632700gmail-h5">> Hi,<br>
><br>
> (Not sure it's the right mailing-list to discuss about this, tell me if<br>
> it's another one)<br>
><br>
> For your information, systemd offers several options to increase the<br>
> security of each daemon based on cgroups, like Docker or rkt.<br>
> For<br>
> example: <a href="https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Capabilities" rel="noreferrer" target="_blank">https://www.freedeskt<wbr>op.org/software/systemd/man/<wbr>systemd.exec.html#Capabilities</a><br>
><br>
> This approach permits to keep the classical Linux distribution daemons<br>
> with simple maintenance actions via apt or yum + the same container<br>
> security as a Docker image.<br>
><br>
> A discussion has already started on Debian tracker:<br>
> <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863841" rel="noreferrer" target="_blank">https://bugs.debian.org/cgi-bi<wbr>n/bugreport.cgi?bug=863841</a><br>
><br>
> Based on this proposal, I made a new service override with extra<br>
> security (see below).<br>
><br>
> But now, I need your help for two parameters of systemd:<br>
> 1. The list of minimal capabilities needed for bind to run<br>
> correctly: <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html" rel="noreferrer" target="_blank">http://man7.org/lin<wbr>ux/man-pages/man7/capabilities<wbr>.7.html</a><br>
> 2. The list of minimal<br>
> SystemCallFilter: <a href="https://www.freedesktop.org/software/systemd/man/systemd.exec.html#SystemCallFilter=" rel="noreferrer" target="_blank">https://www.<wbr>freedesktop.org/software/syste<wbr>md/man/systemd.exec.html#Syste<wbr>mCallFilter=</a><br>
><br>
> Where I could find the lists ?<br>
><br>
> If you have other ideas to increase the security, I'm interested in:<br>
> My objective is to propose this service file to be integrated in Debian<br>
> and Fedora.<br>
><br>
> Thanks for your feedback.<br>
><br>
> The service override:<br>
><br>
> [Service]<br>
> CapabilityBoundingSet=CAP_DAC_<wbr>OVERRIDE CAP_NET_BIND_SERVICE CAP_SETGID<br>
> CAP_SETUID<br>
> SystemCallFilter=~@mount @debug<br>
> NoNewPrivileges=true<br>
> PrivateDevices=true<br>
> PrivateTmp=true<br>
> ProtectHome=true<br>
> ProtectSystem=strict<br>
> ProtectKernelModules=true<br>
> ProtectKernelTunables=true<br>
> ProtectControlGroups=true<br>
> InaccessiblePaths=/home<br>
> InaccessiblePaths=/opt<br>
> InaccessiblePaths=/root<br>
> ReadWritePaths=/run/named<br>
> ReadWritePaths=/var/cache/bind<br>
> ReadWritePaths=/var/lib/bind<br>
><br>
> --<br>
> Ludovic Gasc (GMLudo)<br>
><br>
><br>
</div></div><div class="gmail-m_-6631153165725632700gmail-HOEnZb"><div class="gmail-m_-6631153165725632700gmail-h5">> ______________________________<wbr>_________________<br>
> Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/bind-users</a> to unsubscribe from this list<br>
><br>
> bind-users mailing list<br>
> <a href="mailto:bind-users@lists.isc.org" target="_blank">bind-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/bind-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/bind-users</a><br>
><br>
<br>
--<br>
Petr Menšík<br>
Software Engineer<br>
Red Hat, <a href="http://www.redhat.com/" rel="noreferrer" target="_blank">http://www.redhat.com/</a><br>
email: <a href="mailto:pemensik@redhat.com" target="_blank">pemensik@redhat.com</a>  PGP: 65C6C973<br>
______________________________<wbr>_________________<br>
Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/bind-users</a> to unsubscribe from this list<br>
<br>
bind-users mailing list<br>
<a href="mailto:bind-users@lists.isc.org" target="_blank">bind-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/bind-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/bind-users</a></div></div></blockquote></div><br></div></div>