Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587586 - net-dns/dnsmasq: improve systemd unit (including security hardening)
Summary: net-dns/dnsmasq: improve systemd unit (including security hardening)
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-06-30 14:17 UTC by Craig Andrews
Modified: 2016-08-08 21:12 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
diff based on c1 PR link (1798.patch,1.33 KB, patch)
2016-06-30 14:40 UTC, Ben Kohler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2016-06-30 14:17:20 UTC
The dnsmasq.service systemd unit can be improved by having dnsmasq never run as root, restricting capabilities as much as possible, and limiting file system access.

This has been discussed on the forums at https://forums.gentoo.org/viewtopic-p-7907924.html?sid=03b7d4158d14b19351a6c772b87a2fbd
Comment 1 Craig Andrews gentoo-dev 2016-06-30 14:18:00 UTC
https://github.com/gentoo/gentoo/pull/1798
Comment 2 Ben Kohler gentoo-dev 2016-06-30 14:40:10 UTC
Created attachment 439234 [details, diff]
diff based on c1 PR link
Comment 3 Craig Andrews gentoo-dev 2016-06-30 15:01:03 UTC
I've posted to the upstream mailing list requesting that upstream distribute a systemd unit and that it have these features: http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q2/010656.html
Comment 4 Matthias Maier gentoo-dev 2016-08-08 21:12:12 UTC
The configuration option

  AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN

is only with systemd-229, or newer.

While I agree that some system hardening is a nice feature to introduce I would suggest that we let dnsmasq still handle the suid and sguid bits on its own. This has the advantage that the daemon can actually drop privileges/capabilities once it is done with setup.

See #587588