public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] backup(.pl): Replace OpenVPN DH parameter with ffdhe4096
Date: Wed, 14 Dec 2022 18:03:23 +0000	[thread overview]
Message-ID: <C2BFBF6C-DE3A-4AA2-9138-DB511154128E@ipfire.org> (raw)
In-Reply-To: <DE56784A-22D6-49DC-AE84-D8D1E3A34CCC@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 1938 bytes --]

Alternatively we could just not change anything and add a smiling from the old path to the new one.

> On 14 Dec 2022, at 18:02, Michael Tremer <michael.tremer(a)ipfire.org> wrote:
> 
> Hello Peter,
> 
>> On 13 Dec 2022, at 15:47, Peter Müller <peter.mueller(a)ipfire.org> wrote:
>> 
>> This ensures restoring a backup won't silently bring back an insecure
>> Diffie-Hellman parameter (which could also not be inspected through the
>> web interface anymore).
>> 
>> Reported-by: Michael Tremer <michael.tremer(a)ipfire.org>
>> Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
>> ---
>> config/backup/backup.pl | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>> 
>> diff --git a/config/backup/backup.pl b/config/backup/backup.pl
>> index 6fd9e45bb..520d9315d 100644
>> --- a/config/backup/backup.pl
>> +++ b/config/backup/backup.pl
>> @@ -187,6 +187,15 @@ restore_backup() {
>> # Update OpenVPN CRL
>> /etc/fcron.daily/openvpn-crl-updater
>> 
>> + # Replace previously used OpenVPN Diffie-Hellman parameter by ffdhe4096
>> + if [ -f /var/ipfire/ovpn/server.conf ]; then
>> + sed -i 's|/var/ipfire/ovpn/ca/dh1024.pem|/etc/ssl/ffdhe4096.pem|' /var/ipfire/ovpn/server.conf
>> + fi
>> +
>> + if [ -f "/var/ipfire/ovpn/n2nconf/*/*.conf" ]; then
>> + sed -i 's|/var/ipfire/ovpn/ca/dh1024.pem|/etc/ssl/ffdhe4096.pem|' /var/ipfire/ovpn/n2nconf/*/*.conf
>> + fi
> 
> The second command will never be executed because "/var/ipfire/ovpn/n2nconf/*/*.conf” will never exist.
> 
> Because the string is quoted, the shell won’t conduct any path expansion.
> 
> What could work is running the sed command on all files simultaneously and if there is nothing to change, it won’t do anything. Passing server.conf and n2nconfig/*/*.conf will never fail if there is no N2N configuration. server.conf should always exist.
> 
> Best,
> -Michael
> 
>> +
>> return 0
>> }
>> 
>> -- 
>> 2.35.3



  reply	other threads:[~2022-12-14 18:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 15:47 Peter Müller
2022-12-13 15:48 ` Peter Müller
2022-12-14 18:03   ` Michael Tremer
2022-12-14 18:02 ` Michael Tremer
2022-12-14 18:03   ` Michael Tremer [this message]
2022-12-17 14:44   ` Peter Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C2BFBF6C-DE3A-4AA2-9138-DB511154128E@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox