]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
backup.pl: Remove any 3coresec ipblocklists from old backups being restored
authorAdolf Belka <adolf.belka@ipfire.org>
Thu, 24 Apr 2025 14:20:39 +0000 (16:20 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 24 Apr 2025 14:53:01 +0000 (14:53 +0000)
- This patch ensures that any restore from an old backup cointaining the 3coresec lists
   will not restore the ipblocklist associated files for those lists.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/backup/backup.pl

index 0cfbd4fc3838c6b1cd499565d8252779780581b9..b36296ee862c0e1a1864b7e6731c6dc4f66fa7be 100644 (file)
@@ -252,11 +252,14 @@ restore_backup() {
                        -out /etc/httpd/server.crt &>/dev/null
        fi
 
-       # Remove any entry for ALIENVAULT, SPAMHAUS_EDROP or ABUSECH_BOTNETC2 from the ipblocklist modified file
+       # Remove any entry for ALIENVAULT, SPAMHAUS_EDROP, ABUSECH_BOTNETC2 or 3CORESEC from the ipblocklist modified file
        # and the associated ipblocklist files from the /var/lib/ipblocklist directory
        sed -i '/ALIENVAULT=/d' /var/ipfire/ipblocklist/modified
        sed -i '/SPAMHAUS_EDROP=/d' /var/ipfire/ipblocklist/modified
        sed -i '/ABUSECH_BOTNETC2=/d' /var/ipfire/ipblocklist/modified
+       sed -i '/3CORESEC_SSH=/d' /var/ipfire/ipblocklist/modified
+       sed -i '/3CORESEC_SCAN=/d' /var/ipfire/ipblocklist/modified
+       sed -i '/3CORESEC_WEB=/d' /var/ipfire/ipblocklist/modified
        if [ -e /var/lib/ipblocklist/ALIENVAULT.conf ]; then
                rm /var/lib/ipblocklist/ALIENVAULT.conf
        fi
@@ -266,6 +269,15 @@ restore_backup() {
        if [ -e /var/lib/ipblocklist/ABUSECH_BOTNETC2.conf ]; then
                rm /var/lib/ipblocklist/ABUSECH_BOTNETC2.conf
        fi
+       if [ -e /var/lib/ipblocklist/3CORESEC_SSH.conf ]; then
+               rm /var/lib/ipblocklist/3CORESEC_SSH.conf
+       fi
+       if [ -e /var/lib/ipblocklist/3CORESEC_SCAN.conf ]; then
+               rm /var/lib/ipblocklist/3CORESEC_SCAN.conf
+       fi
+       if [ -e /var/lib/ipblocklist/3CORESEC_WEB.conf ]; then
+               rm /var/lib/ipblocklist/3CORESEC_WEB.conf
+       fi
 
        # The collectd directory structure was changed but not all changes
        # are done by the official migration script generator