Hello,
I'd like to start a discussion regarding setting HOME_MODE by default in
the /etc/login.defs file (owned by sys-apps/shadow package).
Upstream keeps HOME_MODE commented: https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set, they will use the specified permission when creating a user home directory, otherwise the default UMASK will be used.
Since the default umask is 022, keeping HOME_MODE unset will result in home readable home directories created by useradd, which goes against security best practices.
The proposal is to set HOME_MODE to 0700, or at least 0750: RedHat and RH based distros, OpenSuse, ArchLinux all set it to 0700, Ubuntu has it at
0750. Debian and Gentoo are two exceptions, keeping the upstream value of HOME_MODE (although login.defs is changed in other ways).
I previously made a PR on github where you can find more details ( https://github.com/gentoo/gentoo/pull/35231), but as pointed in the
comments this probably warrants some discussion beforehand.
I can understand the argument against the change, which is keeping in sync with upstream and don't risk changing the historic default behaviour of
tools some users might rely upon.
I do believe though there's merit in providing safer and secure defaults,
so I would like HOME_MODE to have a safe default value for Gentoo and
Gentoo based distros.
Have a nice day,
Daniel
On Sat, Feb 10, 2024 at 05:57:08PM +0100, Daniel Simionato wrote:
Hello,
I'd like to start a discussion regarding setting HOME_MODE by default in the /etc/login.defs file (owned by sys-apps/shadow package).
Upstream keeps HOME_MODE commented: https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set, they will use the specified permission when creating a user home directory, otherwise the default UMASK will be used.
Since the default umask is 022, keeping HOME_MODE unset will result in home readable home directories created by useradd, which goes against security best practices.
The proposal is to set HOME_MODE to 0700, or at least 0750: RedHat and RH based distros, OpenSuse, ArchLinux all set it to 0700, Ubuntu has it at 0750. Debian and Gentoo are two exceptions, keeping the upstream value of HOME_MODE (although login.defs is changed in other ways).
I previously made a PR on github where you can find more details ( https://github.com/gentoo/gentoo/pull/35231), but as pointed in the comments this probably warrants some discussion beforehand.
I can understand the argument against the change, which is keeping in sync with upstream and don't risk changing the historic default behaviour of tools some users might rely upon.
I do believe though there's merit in providing safer and secure defaults, so I would like HOME_MODE to have a safe default value for Gentoo and Gentoo based distros.
Setting it to 0700 makes good sense to me, unless someone has some
good example of this breaking anything. Deviating from upstream
defaults in following other distributions isn't exactly treading new
ground for us. And it's easy for the administrator to change to suit
their liking anyway (hopefully covering the "keep the status quo"
class of objections).
Have a nice day,
Daniel
- someone who added another account to their user group probably did so
with the expectation that they'd be sharing files with that other
account, and 700 mode in particular feels like going against that
On Sat, 10 Feb 2024, Daniel Simionato wrote:
I'd like to start a discussion regarding setting HOME_MODE by default in
the /etc/login.defs file (owned by sys-apps/shadow package).
Upstream keeps HOME_MODE commented: https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set, they will use the specified permission when creating a user home directory, otherwise the default UMASK will be used.
Since the default umask is 022, keeping HOME_MODE unset will result in home readable home directories created by useradd, which goes against security best practices.
The proposal is to set HOME_MODE to 0700, or at least 0750: RedHat and RH based distros, OpenSuse, ArchLinux all set it to 0700, Ubuntu has it at
0750. Debian and Gentoo are two exceptions, keeping the upstream value of HOME_MODE (although login.defs is changed in other ways).
I previously made a PR on github where you can find more details ( https://github.com/gentoo/gentoo/pull/35231), but as pointed in the
comments this probably warrants some discussion beforehand.
I can understand the argument against the change, which is keeping in sync with upstream and don't risk changing the historic default behaviour of
tools some users might rely upon.
I do believe though there's merit in providing safer and secure defaults,
so I would like HOME_MODE to have a safe default value for Gentoo and
Gentoo based distros.
Hello,
I'd like to start a discussion regarding setting HOME_MODE by default in the /etc/login.defs file (owned by
sys-apps/shadow package).
Upstream keeps HOME_MODE commented: https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set, they will use the specified permission when
creating a user home directory, otherwise the default UMASK will be used. Since the default umask is 022, keeping HOME_MODE unset will result in home readable home directories created by useradd,
which goes against security best practices.
The proposal is to set HOME_MODE to 0700, or at least 0750: RedHat and RH based distros, OpenSuse, ArchLinux all set it
to 0700, Ubuntu has it at 0750. Debian and Gentoo are two exceptions, keeping the upstream value of HOME_MODE (although
login.defs is changed in other ways).
I previously made a PR on github where you can find more details (https://github.com/gentoo/gentoo/pull/35231), but as
pointed in the comments this probably warrants some discussion beforehand.
I can understand the argument against the change, which is keeping in sync with upstream and don't risk changing the
historic default behaviour of tools some users might rely upon.
I do believe though there's merit in providing safer and secure defaults, so I would like HOME_MODE to have a safe
default value for Gentoo and Gentoo based distros.
Have a nice day,
Daniel
On Sat, 2024-02-10 at 17:57 +0100, Daniel Simionato wrote:
Hello,
I'd like to start a discussion regarding setting HOME_MODE by default in
the /etc/login.defs file (owned by sys-apps/shadow package).
Upstream keeps HOME_MODE commented:
https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set,
they will use the specified permission when creating a user home directory, >> otherwise the default UMASK will be used.
Since the default umask is 022, keeping HOME_MODE unset will result in home >> readable home direct
umask 022 is also egregious, changing it to 027 would kill two birds.
But in lieu of that, yes.
I'm in favour, although I'd be curious as to why upstream shadow don't
just set it. It would be interesting to see if the discussion already happened there at some point (surely it has?) and find out their
reasoning. (But that's not a blocker for proceeding.)
I want to hear more opinions first though. Thanks for raising this,
it's been in the back of my head.
Michael Orlitzky <[email protected]> writes:
On Sat, 2024-02-10 at 17:57 +0100, Daniel Simionato wrote:
Hello,
I'd like to start a discussion regarding setting HOME_MODE by default in the /etc/login.defs file (owned by sys-apps/shadow package).
Upstream keeps HOME_MODE commented: https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set, they will use the specified permission when creating a user home directory,
otherwise the default UMASK will be used.
Since the default umask is 022, keeping HOME_MODE unset will result in home
readable home direct
umask 022 is also egregious, changing it to 027 would kill two birds.
But in lieu of that, yes.
mgorny wrote in favour of this 13 years ago too: https://blogs.gentoo.org/mgorny/2011/10/18/027-umask-a-compromise-between-security-and-simplicity/.
It would be a bigger change and require us to do a lot of daily-driver testing first though.
Hello,
I'd like to start a discussion regarding setting HOME_MODE by default in
the /etc/login.defs file (owned by sys-apps/shadow package).
Upstream keeps HOME_MODE commented: https://github.com/shadow-maint/shadow/blob/3e59e9613ec40c51c19c7bb5c28468e33a4529d5/etc/login.defs#L207
HOME_MODE affects only useradd and newuser commands: if HOME_MODE is set, they will use the specified permission when creating a user home directory, otherwise the default UMASK will be used.
Since the default umask is 022, keeping HOME_MODE unset will result in home readable home directories created by useradd, which goes against security best practices.
The proposal is to set HOME_MODE to 0700, or at least 0750: RedHat and RH based distros, OpenSuse, ArchLinux all set it to 0700, Ubuntu has it at
0750. Debian and Gentoo are two exceptions, keeping the upstream value of HOME_MODE (although login.defs is changed in other ways).
I previously made a PR on github where you can find more details ( https://github.com/gentoo/gentoo/pull/35231), but as pointed in the
comments this probably warrants some discussion beforehand.
I can understand the argument against the change, which is keeping in sync with upstream and don't risk changing the historic default behaviour of
tools some users might rely upon.
I do believe though there's merit in providing safer and secure defaults,
so I would like HOME_MODE to have a safe default value for Gentoo and
Gentoo based distros.
Have a nice day,
Daniel
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 04:34:34 |
| Calls: | 12,099 |
| Calls today: | 7 |
| Files: | 15,003 |
| Messages: | 6,517,894 |