From owner-freebsd-hackers@freebsd.org Mon Feb 3 19:14:24 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6243022B69E for ; Mon, 3 Feb 2020 19:14:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BHZ732fcz3ww0 for ; Mon, 3 Feb 2020 19:14:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ua1-x941.google.com with SMTP id c7so5761679uaf.5 for ; Mon, 03 Feb 2020 11:14:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fb1lBVU+3oDj0zBU1iU3aTiUkAu5gbxdLqBa1eNQOlk=; b=oTiuOCaHLkXeMy1c96OWXmfcsdEqEmfk8dExns8bB5mKKpmIrDfwHHGAdoctGQk+Lj HCRSidG0s7mf/XUWlmWmx/S+FfIuc6JPKRlIUVEDiifk6G9uEcZUxK7IcxLi5XVH370Q lPGdG8iU+ErI/Q89kcG16aFHRKNxe7Yz/pHlKTB9z/74suL3IA/nCc6PVH7ilpIngYHV DEaTCicmGb8SpdrAKNdjpNUISaU0HAoTEPCTjzsnUkHQr13Pgwt5OZOjRERcxCyURapi SW1XRcAeTy/BGQWKAyXxrFa/R4v4mipA0VyMh47/Xo6ZqAIBpnRQIF2f4k/AD04POCs/ FBDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fb1lBVU+3oDj0zBU1iU3aTiUkAu5gbxdLqBa1eNQOlk=; b=cBh8u3mB6Ls5e30ClJy7LtWO+MyZpWlNR6D1ghaD1yz6ZVGfTTbbPJXv8LnY2H9rYp puOTgNAHK1kVnVUpzA3+w66+pnn7w0symuXAg9WQ8vz+morQEU4sv1vjrXFGf/RqrOMl 775Y35cmawHOiMmniZBh2T9fAqEwM14iDi2AoCESJUyxVSa97hcN3x1Rh2f8SFIHUtHB QC7bvyPDUS+9ODYyBBIwmgFuJlj1J+nwHEWTczy2i8dYUUf9cQuiiyjdDNBoYf9SaoME VnLqGp8D3p7mQOLUU6YumMnwwmXnJSWhBvDq8oU9LRtq94Aw1vm8DrF5DZe6bI31nGWu 00aA== X-Gm-Message-State: APjAAAXym9TdS97NUSKSZkoV8Ef/bxbMFNOIhZ4MokUObhVxF0BXYUyE U6xZqdutJPIQoMkfnO/Ws2o1oTUrIAup3AySqvc= X-Google-Smtp-Source: APXvYqzKYayA1RPmjo/TcpTgXcheP/a6B27lFyePKohEjyjT0ffPbm2Dq1QemS/GdCQV37tIFwW8wOLLCgtWJmRhoJA= X-Received: by 2002:ab0:2a0c:: with SMTP id o12mr14489231uar.72.1580757262312; Mon, 03 Feb 2020 11:14:22 -0800 (PST) MIME-Version: 1.0 References: <202002021808.012I8CNm083835@gndrsh.dnsmgr.net> <31EF8F5F-75D5-4EFB-A6DA-10C0807BF29B@cschubert.com> In-Reply-To: <31EF8F5F-75D5-4EFB-A6DA-10C0807BF29B@cschubert.com> From: Enji Cooper Date: Mon, 3 Feb 2020 11:14:10 -0800 Message-ID: Subject: Re: More secure permissions for /root and /etc/sysctl.conf To: Cy Schubert Cc: "freebsd-hackers@freebsd.org" , "Rodney W. Grimes" , Miroslav Lachman <000.fbsd@quip.cz>, Gordon Bergling , Ben Woods , Ryan Stone , Wojciech Puchar Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48BHZ732fcz3ww0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=oTiuOCaH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::941 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[1.4.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (2.63), ipnet: 2607:f8b0::/32(-1.99), asn: 15169(-1.75), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 19:14:24 -0000 On Mon, Feb 3, 2020 at 9:11 AM Cy Schubert wrote: > > On February 2, 2020 10:08:12 AM PST, "Rodney W. Grimes" wrote: > >[ Charset UTF-8 unsupported, converting... ] > >> Ben Woods wrote on 2020/02/02 02:46: > >> > >> [...] > >> > DragonFlyBSD 5.6.2 = 700 > >> > HardenedBSD build 104 = 755 > >> > NetBSD 9.0 RC1 = 755 > >> > OpenBSD 6.6 = 700 > >> > > >> > For what it's worth, I am broadly supportive of this because I see > >no > >> > reason for /root to be world readable. > >> > >> +1 > >> > >> I see no reason for world readable /root too. > >> We always set user's homes to 0700 (subdirs of /usr/home). > > > >Who is "We" in this context? > > > >FreeBSD's default for home directories is 755. > > > >And as I have stated before anyone who is taking group rx off > >of /root is fooling themselves as that just creates pain for > >members of group wheel who now needlessly need to su to > >see /root's files. > > > >If you have issues with group wheel being able to read /root > >you have far far bigger problems that need addressed than > >a simple chmod g-rw /root is going to fix. > > Agreed. YMMV, but Fedora Linux 31 (at least) has a more restrictive umask/ownership set on /root by default: $ ls -ld /root dr-xr-x---. 6 root root 4096 Feb 3 10:06 /root $ cat /etc/redhat-release Fedora release 31 (Thirty One) I'm unsure what the default setting is with OSX (/root is a symlink to a directory under /var ). I think this suggestion makes sense from a default security perspective, but honestly I wouldn't fiddle with /etc/sysctl.conf at all. The RoI is much lower and the likelihood of breaking applications is considerably higher; having to elevate privileges just to read /etc/sysctl.conf wouldn't be strictly required, but someone might have implemented naive logic somewhere where it passes along "-f /etc/sysctl.conf" by default. Cheers, -Enji