The /root directory is currently world readable,
which is quit insecure, because people tend to store sensitive data within in
/root directory.
Details
- Reviewers
emaste lwhsu • ian cem - Group Reviewers
Contributor Reviews (src) - Commits
- rS361791: Restrict default /root permissions
make buildworld, but the only check would be a fresh installation within
a VM from a image that has these changes applied.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I feel it would be better to discuss this on the mailing list. Maybe freebsd-hackers@.
My personal feeling is I'm neutral for the /root permission change. The /etc/sysctl.conf doesn't make too much sense to me because a user can still use sysctl(1) to get the value.
I believe 0750 is an ideal mode for the /root dir; it adds some security, and it seems unlikely that existing scripts or other automation people have in use will fail due to the change.
I don't object to /root mode 750. This seems to line up with, e.g., Fedora Linux defaults.
(The sysctl.conf change was wrong, but has been dropped.)
I just spun up a few other operating systems to check their /root/ directory permissions, and found the following:
BSD:
- DragonFlyBSD 5.6.2 = 700
- HardenedBSD build 104 = 755
- NetBSD 9.0 RC1 = 755
- OpenBSD 6.6 = 700
Linux:
- ArchLinux 2020.02.01 = 750
- CentOS 8 = 550
- Debian 10 = 700
- Fedora 31 = 550
- Slackware 14.2 = 710
- Ubuntu 19.10 = 700
Any update on this topic?
As pointed out on freebsd-hackers@ and the comments for the previous version of this patch, it is generally a good idea to have a sane default in place that was already adopted by many operating systems.
This is a sensible change. There was however some mailing list discussion about this change; let me check on (and encourage a resolution on) that and come back to this.
There was a thread about in January 2020 on hackers@. The following link points to the monthly archive, https://lists.freebsd.org/pipermail/freebsd-hackers/2020-January/thread.html
This is a very small and quiet ping!
Could this change be integrated since most of all other major deployed unix-like operating system has accomplished it with much stricter permissions?
Please see the above mentioned thread for details.