Bug 693381

Summary: dhcpd running as root
Product: Red Hat Enterprise Linux 6 Reporter: Marko Myllynen <myllynen>
Component: dhcpAssignee: Jiri Popelka <jpopelka>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dwalsh, mganisin, mgrepl, myllynen, ovasik, sgrubb
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dhcp-4.1.1-25.P1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 12:00:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 699713, 737571    
Bug Blocks: 743047, 748554    

Description Marko Myllynen 2011-04-04 13:52:02 UTC
Description of problem:
On RHEL/Fedora dhcpd seems to be running as root although on some other widely used distributions it is running as a non-root user which is very favourable from the security point of view.

Please consider running dhcpd as non-root.

Version-Release number of selected component (if applicable):
RHEL 6.0 / RHEL 6.1 Beta

Comment 2 RHEL Program Management 2011-04-04 13:54:53 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Jiri Popelka 2011-04-05 14:43:41 UTC
AFAICT dhcpd needs to be run as superuser because of using of SOCK_RAW sockets.

When you try to run dhcpd as non-root you get:
'unable to create icmp socket: Operation not permitted'

Can you be more specific in what distributions do you have in mind ?
I have tried debian stable with exactly the same results as on RHEL/Fedora,
i.e. you need to be root to start the dhcp server service (called isc-dhcp-server) or directly dhcpd there.

Comment 4 Marko Myllynen 2011-04-05 15:37:29 UTC
> Can you be more specific in what distributions do you have in mind ?

On Ubuntu dhcpd is running as user dhcpd. Interestingly, on Debian dhcpd indeed runs as root.

This is definitely in the nice-to-have category but Ubuntu has a patch to use capabilities in order to be able to drop root privileges, see:

http://packages.ubuntu.com/natty/isc-dhcp-server
http://archive.ubuntu.com/ubuntu/pool/main/i/isc-dhcp/isc-dhcp_4.1.1-P1-15ubuntu6.diff.gz

I'm CC'ing sgrubb how can possibly comment whether it would make sense for us too to use capabilities to drop root privileges with dhcpd?

Thanks.

Comment 6 Jiri Popelka 2011-04-26 12:52:11 UTC
This seems to be a significant change which should be implemented upstream (in Fedora) first.
Cloned for Fedora as bug #699713
and closing this as UPSTREAM.

Thank you for the report.

Comment 7 Marko Myllynen 2011-09-12 09:53:18 UTC
Reopening for discussion about backporting this since upstream/Fedora has rootless dhcpd feature now available (bug 699713).

Although there are no known customer requests for this yet backporting this might well make sense given that RHEL 6 still has almost 6.5+3 years left as supported platform.

Comment 20 errata-xmlrpc 2011-12-06 12:00:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1597.html