From owner-freebsd-hackers@freebsd.org Wed Jan 29 10:36:41 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 83AED1D3736 for ; Wed, 29 Jan 2020 10:36:41 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 4870K457gmz4RFs for ; Wed, 29 Jan 2020 10:36:40 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id g17so19544469wro.2 for ; Wed, 29 Jan 2020 02:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=DBo85cdZYxNuZkKtJRCL2hmP4A5czyX1VpyviLVkLnM=; b=FmLBzEe/RKrZM16mORT/n1irM5X90gj4ZcZ4L23QW17KNrREI5IKmtLcyQ1SdAUfgO HmUT/wLSDrDnhxlLwXEBnmaH6zuCsTaZZ8i0DYGQCR2e40Afi8sNRGj6FMoxOUbcR7Gu MAp5/I52YAQ3LEDV9wTOcQzpR/c1aG+nW9HKw8pWwCBcOhrCSIHiPQoGbEKz3Lfxua10 O1rCTsFQzKoHOMO/ySUNg7MaTTiReX7VWGDGcwSB88XguW/Dtn9xkwYVOa/qcTuiGhfo TFJkkuPGBTNiMWedFDWRsiB3Acg0txLHjZide8pzVNla6x3zRxLXBupA9MVJiglOG61Y Y6UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=DBo85cdZYxNuZkKtJRCL2hmP4A5czyX1VpyviLVkLnM=; b=aTYc9rcnEqAJTdhC+K8NxKp2F7yGI3ndt7Ic49hJYFt3lLBh7f597m9+Ltu9wuDyjU uUmOTN8OwisUn5CMc4Si8vh47jWX+3Vu2zGZIbmlaaqTS5HjjNdd1mvHdaXGH8SSuhB/ sHL2F5G7LoOutd+jiIqqwFnAOg9jEUbAAdk+I1gIGDyFVeHldCz50hYuasVRN0xXkIEX Utd6HmjfEdFrl1twcCtU+df6sNtMkZRjIqFG6kht/a9YomdYdKVwYQzVjHypMVeHGeVT QX25BgZc/SMgkNktXbIDknnfQpaqtXuL2xyXrL8F17oJQ9EFbPNfSaviIT9+fwixLdY1 kz2w== X-Gm-Message-State: APjAAAWn1gQJvRyVc+6oLABqBD4KGwKyUo7X+IoTjAXUDd3zCBSDeu9+ 63unFENvoxr36vkUb9k1oogJ6SAa X-Google-Smtp-Source: APXvYqypn10rzAruw2Ptzwashp9vzOV84+rAPLpAqAVNde1PqzXDmg8cvgtkLtzeVwh768CwlKTJsQ== X-Received: by 2002:adf:a51d:: with SMTP id i29mr6965339wrb.119.1580294198785; Wed, 29 Jan 2020 02:36:38 -0800 (PST) Received: from ernst.home (p5B02394F.dip0.t-ipconnect.de. [91.2.57.79]) by smtp.gmail.com with ESMTPSA id z133sm1886858wmb.7.2020.01.29.02.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2020 02:36:38 -0800 (PST) Date: Wed, 29 Jan 2020 11:36:37 +0100 From: Gary Jennejohn To: Gordon Bergling via freebsd-hackers Cc: Gordon Bergling Subject: Re: More secure permissions for /root and /etc/sysctl.conf Message-ID: <20200129113637.128890a5@ernst.home> In-Reply-To: <20200129112500.368610e8@ernst.home> References: <20200129092631.GA22505@lion.0xfce3.net> <20200129105325.600cddc1@ernst.home> <20200129112500.368610e8@ernst.home> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4870K457gmz4RFs X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=FmLBzEe/; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::444 as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[79.57.2.91.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; FREEMAIL_REPLYTO(0.00)[gmail.com]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[4.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (2.74), ipnet: 2a00:1450::/32(-2.52), asn: 15169(-1.78), country: US(-0.05)]; FREEMAIL_CC(0.00)[googlemail.com]; RCVD_TLS_ALL(0.00)[] 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: Wed, 29 Jan 2020 10:36:41 -0000 On Wed, 29 Jan 2020 11:25:00 +0100 Gary Jennejohn wrote: > On Wed, 29 Jan 2020 10:53:25 +0100 > Gary Jennejohn wrote: > > > On Wed, 29 Jan 2020 10:26:31 +0100 > > Gordon Bergling via freebsd-hackers wrote: > > > > > Hi, > > > > > > I recently stumbled upon the default world readable permissons of /root and > > > /etc/sysctl.conf. I think that it would be more secure to reduce the default > > > permission for /root to 0700 and to 0600 for /etc/sysctl.conf. > > > > > > I prepared a differtial for the proposed change: > > > https://reviews.freebsd.org/D23392 > > > > > > What do you think? > > > > > > > I think that changing the permissions on / would defeat the purpose of > > /etc/devd.conf and then adding users to certain groups in /etc/group > > to make devices usable without having to escalate to root rights. > > > > I decided to actually test this case, since I thought I should back up > my opinion with some facts. > > So, I did chmod 700 / and rebooted. > > I wasn't able to login as a normal user because an error was raised > about not being able to find the root for audit (or similar wording). > > After changing root back to 755 and remounting /home I could log in. > > Your idea may work if all filesystems are in one big partition, I > can't really say, but on my system /, /var, /usr and /home are > separate partitions/disks. > Never mind. Gordon explained what he really meant. That's what I get for not looking at the differential before responding. Sorry for wasting bandwidth here. -- Gary Jennejohn