Message ID | 025e3315-6a62-30cd-9a00-cc0827820433@ipfire.org |
---|---|
State | Superseded |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4LdStD2BPZz40TL for <patchwork@web04.haj.ipfire.org>; Wed, 6 Jul 2022 18:36:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4LdStC25yRz15d; Wed, 6 Jul 2022 18:36:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4LdStC0fzgz2yPd; Wed, 6 Jul 2022 18:36:19 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4LdSt92rplz2xLW for <development@lists.ipfire.org>; Wed, 6 Jul 2022 18:36:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4LdSt76kpJzh4 for <development@lists.ipfire.org>; Wed, 6 Jul 2022 18:36:15 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1657132577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4u53QPBldwHRr5LRjBukWG+D03+u3GTwV6/ZUmVMNIo=; b=RQT10PiUgNPRWNVcNbKZwIsw68gGwSS6UXgySttj8ftsYNPesIBQKL78PS1qnltFmcUH+4 6GHImy6aKHpYkhBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1657132577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4u53QPBldwHRr5LRjBukWG+D03+u3GTwV6/ZUmVMNIo=; b=hv5IC9tVySyPZJ2zRuwoeSmpDKLGURp52RQcHWMhG0i8Q+9W5U3Y/RKuVYr6VAcjvA/FgY YfIHUT0VgQyDI3uqJl2CluiO5rhWFPv3PAr+J2N4P8HbQ3JzgijbCMlwWAJdlsiYtMjeuP R/t9d4jFlN5SR9aWgghTfxTPP2GGmmz0vDZRKmyJjJCfxrioCcZuEkKmGmMJTbt69hdbhO KnXlUueT2Xe4sjclEqQs2D1Zp8I098d8zPJ3SB54MLh/Yx+9ZChEkK9214zfzs970U20Hj 2J5JLen1tvo2jar1fxPfpM9za+QQvKkiVVhlehIft4HnNjPQeKClDbRFU8w8vw== Message-ID: <025e3315-6a62-30cd-9a00-cc0827820433@ipfire.org> Date: Wed, 6 Jul 2022 18:36:09 +0000 MIME-Version: 1.0 Content-Language: en-US To: "IPFire: Development" <development@lists.ipfire.org> From: =?utf-8?q?Peter_M=C3=BCller?= <peter.mueller@ipfire.org> Subject: [PATCH] Core Update 170: Harden mount options of /boot on existing installations Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
Core Update 170: Harden mount options of /boot on existing installations
|
|
Commit Message
Peter Müller
July 6, 2022, 6:36 p.m. UTC
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
config/rootfiles/core/170/update.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Hello, > On 6 Jul 2022, at 20:36, Peter Müller <peter.mueller@ipfire.org> wrote: > > Signed-off-by: Peter Müller <peter.mueller@ipfire.org> > --- > config/rootfiles/core/170/update.sh | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/config/rootfiles/core/170/update.sh b/config/rootfiles/core/170/update.sh > index 8edb5ff2e..c9744f5f5 100644 > --- a/config/rootfiles/core/170/update.sh > +++ b/config/rootfiles/core/170/update.sh > @@ -49,8 +49,11 @@ ldconfig > > # Start services > > +# Harden mount options of /boot > +sed -e -i "s/[[:space:]]*\/boot[[:space:]]*auto[[:space:]]*defaults[[:space:]]*/ \/boot auto defaults,nodev,noexec,nosuid /g" /etc/fstab This is probably longer than it needs to. To keep regular expressions more readable, I would suggest the following: * Use \s instead of [[:space:]]. The latter is probably easier if you are not familiar with \s, but very hard to read. * If you know that you are going to have slashes, use a different delimiter character. So instead of s/A\/B/C\/D/ you could also write s@A/B@C/D@ which is a lot easier to read. * I am not convinced editing /etc/fstab like this is a good idea, but we don’t seem to have any other option. > + > # This update needs a reboot... > -#touch /var/run/need_reboot > +touch /var/run/need_reboot Why do we need to reboot? Can we not remount? > > # Finish > /etc/init.d/fireinfo start > -- > 2.35.3
Hello Michael, thanks for your reply. > Hello, > >> On 6 Jul 2022, at 20:36, Peter Müller <peter.mueller@ipfire.org> wrote: >> >> Signed-off-by: Peter Müller <peter.mueller@ipfire.org> >> --- >> config/rootfiles/core/170/update.sh | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/config/rootfiles/core/170/update.sh b/config/rootfiles/core/170/update.sh >> index 8edb5ff2e..c9744f5f5 100644 >> --- a/config/rootfiles/core/170/update.sh >> +++ b/config/rootfiles/core/170/update.sh >> @@ -49,8 +49,11 @@ ldconfig >> >> # Start services >> >> +# Harden mount options of /boot >> +sed -e -i "s/[[:space:]]*\/boot[[:space:]]*auto[[:space:]]*defaults[[:space:]]*/ \/boot auto defaults,nodev,noexec,nosuid /g" /etc/fstab > > This is probably longer than it needs to. To keep regular expressions more readable, I would suggest the following: > > * Use \s instead of [[:space:]]. The latter is probably easier if you are not familiar with \s, but very hard to read. I would prefer that too, but sed does not understand PCRE (tested on C168, did not work). > * If you know that you are going to have slashes, use a different delimiter character. So instead of s/A\/B/C\/D/ you could also write s@A/B@C/D@ which is a lot easier to read. ACK, good point. > * I am not convinced editing /etc/fstab like this is a good idea, but we don’t seem to have any other option. > >> + >> # This update needs a reboot... >> -#touch /var/run/need_reboot >> +touch /var/run/need_reboot > > Why do we need to reboot? Can we not remount? Indeed. At this point, all the other stuff in C170 does not require a reboot yet. Thanks, and best regards, Peter Müller > >> >> # Finish >> /etc/init.d/fireinfo start >> -- >> 2.35.3 >
diff --git a/config/rootfiles/core/170/update.sh b/config/rootfiles/core/170/update.sh index 8edb5ff2e..c9744f5f5 100644 --- a/config/rootfiles/core/170/update.sh +++ b/config/rootfiles/core/170/update.sh @@ -49,8 +49,11 @@ ldconfig # Start services +# Harden mount options of /boot +sed -e -i "s/[[:space:]]*\/boot[[:space:]]*auto[[:space:]]*defaults[[:space:]]*/ \/boot auto defaults,nodev,noexec,nosuid /g" /etc/fstab + # This update needs a reboot... -#touch /var/run/need_reboot +touch /var/run/need_reboot # Finish /etc/init.d/fireinfo start