From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 85DCF15815E for ; Sun, 11 Feb 2024 01:08:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 55032E2A36; Sun, 11 Feb 2024 01:08:48 +0000 (UTC) Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 22D50E2A32 for ; Sun, 11 Feb 2024 01:08:47 +0000 (UTC) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d09faadba5so27506181fa.1 for ; Sat, 10 Feb 2024 17:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qap.la; s=google; t=1707613726; x=1708218526; darn=lists.gentoo.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=cilOG4bOLPhVykuaBVvOKafNVq78Y6yGyA0BdQ8Zx3Y=; b=GJwuOLmKG5oFjc8AhHT9dHdDPpXgD7gHtUcKCh0DADG1VGMjeoKeTFEDpwaJhRmEWl TtzQxfOLJUop4YIq02bCzx6bPKEM3tbq63N7RY0quybwnVvHed45X6nYfURNB0LoF2yg WXbDhz5A4yWyglswyNjOf4M5BA7/KaGOeScLyZGrMVwH3RJ4EyTBIB9yC1FMfnj5YIj4 61Pp+Cv26lTv/0N6K6vKSZwi1lvFni7dXJLYUMPCLjV7vALqMyN+hwZDQ0i0lrusEQ7o sthwaKIdM+j1oZ7T4vDOyBda+FmQ15CzpbE7j0rmbfnx/CwU5ti5QEJ1XIdV15ukw8lF eL6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707613726; x=1708218526; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cilOG4bOLPhVykuaBVvOKafNVq78Y6yGyA0BdQ8Zx3Y=; b=LOd76BVfR45gs0WYcAmgJmyU97uTQbr9MKluonjyvOojd521teefXuKIVS8eOvskDx YWzjiG2Zvjyv1d0+XCjuZIwM4gRPXp92Wfktfr23XyHP0OMQ43HE0xgljRlHdi1BM1w/ n0Jo7fCBrxX5wd23cKpqYdCuEIEt4JI4SQvlQU7Q2f6to5h/8G16ODkO/gSPEyip4USf sP5EbYDAs5AEJN4lZHUjzkdGCw+Xp6NYLO/RcaSd1DM3Q3kUzF/RZ34Sz3+x5c0tziY1 a1n0+BNXZLVE6ZP34Kd+YrMicdPO8w0FpnqCNujhth/peO02ipUjQ4wphmg6f4OxiOLM zE1A== X-Gm-Message-State: AOJu0Yy13i3p+sCjd6uWf8f+x4qkZ4pbvdwlXwmVaG8B1ZYOyhYXUWAr OmR+YZsWbZLwfgQymvezriXlsGyamE3L6zA68FW1RJ6GZqiX7RGD/gVNQS/59d5aTxyd9ScVh12 N8+ttGBFO22zhSltcteTj43WM1n8dYhVD3BQV7f4hsh+/Uo5g X-Google-Smtp-Source: AGHT+IEMc+M9IkYg9Ltla9HSsoq48ilh0ZU2hS3GGPybAHPSO3z3MxnTB2m7doa11u4Hs8LMF9NwyN/m5ERmnpantDo= X-Received: by 2002:a05:651c:1024:b0:2d0:e665:3d60 with SMTP id w4-20020a05651c102400b002d0e6653d60mr2011716ljm.7.1707613726197; Sat, 10 Feb 2024 17:08:46 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: In-Reply-To: From: Alex Boag-Munroe Date: Sun, 11 Feb 2024 01:08:34 +0000 Message-ID: Subject: Re: [gentoo-dev] RFC: Setting default HOME_MODE in /etc/login.defs To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: df7b3a8e-9692-4a96-852f-0d51633ec61b X-Archives-Hash: b213e7b3e75444197309f613dea121d2 On Sat, 10 Feb 2024 at 23:52, John Helmert III wrote: > > 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 0700 should be the default as far as I'm concerned. 750 makes sense in some environments, but in those environments a sysadmin should know well enough to make the changes when it is useful. I never understood why world readable was default on Gentoo.