Bug 782499 - Propose that you turn on PrivateTmp=true in service file for dhcpd
Summary: Propose that you turn on PrivateTmp=true in service file for dhcpd
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jiri Popelka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PrivateTmp
TreeView+ depends on / blocked
 
Reported: 2012-01-17 15:39 UTC by Daniel Walsh
Modified: 2012-01-27 16:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-17 17:23:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Walsh 2012-01-17 15:39:30 UTC
I would like to propose using PrivateTmp for dhcpd systemd unit file
This should make the use of /tmp directory more secure
and avoid users from being able to potentially effect it.

http://fedoraproject.org/wiki/Features/ServicesPrivateTmp

Comment 1 Jiri Popelka 2012-01-25 14:30:00 UTC
Actually it's only dhclient (dhclient-script) that uses /tmp.
There's a code in dhcpd that reads attributes of files in /tmp
to generate semi random data, but it doesn't seem to be used anyway.

So I'm going to revert the change I already did and close this as NOTABUG.

Comment 2 Daniel Walsh 2012-01-25 20:44:30 UTC
Well do any of the scripts to redirection within bash

command << _EOF
...
_EOF

Also can't dhclient-script execute custom scripts?

Comment 3 Jiri Popelka 2012-01-26 06:57:02 UTC
(In reply to comment #2)
> Well do any of the scripts to redirection within bash
> 
> command << _EOF
> ...
> _EOF

Not sure whether this is what you are asking (if that was a question),
but dhclient-script uses /tmp this way:
rscf="$(mktemp ${TMPDIR:-/tmp}/XXXXXX)"
echo "nameserver ${nameserver}" >> ${rscf}
change_resolv_conf ${rscf}
rm -f ${rscf}

change_resolv_conf is from
/etc/sysconfig/network-scripts/network-functions
and for example
/etc/sysconfig/network-scripts/ifup-post
use it the same way.

> Also can't dhclient-script execute custom scripts?

Yes, it runs (if they exist)
/etc/dhcp/dhclient-enter-hooks
/etc/dhcp/dhclient-up-hooks
/etc/dhcp/dhclient-down-hooks
/etc/dhcp/dhclient-exit-hooks
/etc/dhcp/dhclient.d/*.sh

Comment 4 Daniel Walsh 2012-01-26 22:34:16 UTC
So why not be secure by default and not have to worry about users hacking something in here to break dhclient or get a privledge exploit?

Comment 5 Jiri Popelka 2012-01-27 08:24:27 UTC
I'm not sure I understand.
There's no dhclient systemd unit to put PrivateTmp into.
dhclient is started either by NetworkManager (NM) or by network-scripts.
And in case of NM the dhclient-script is even not used because NM has its own "script" for dhclient.

Comment 6 Daniel Walsh 2012-01-27 16:21:07 UTC
I thought I checked that it is had a systemd unit file.  

Sorry never mind.


Note You need to log in before you can comment on or make changes to this bug.