From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <oguz@gaia.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id BC49C716D7
 for <pmg-devel@lists.proxmox.com>; Wed, 19 May 2021 14:33:44 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id B1C4A1A6EE
 for <pmg-devel@lists.proxmox.com>; Wed, 19 May 2021 14:33:14 +0200 (CEST)
Received: from gaia.proxmox.com (unknown [94.136.29.99])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id BAAEC1A6D9
 for <pmg-devel@lists.proxmox.com>; Wed, 19 May 2021 14:33:12 +0200 (CEST)
Received: from gaia.proxmox.com (localhost.localdomain [127.0.0.1])
 by gaia.proxmox.com (8.15.2/8.15.2/Debian-14~deb10u1) with ESMTP id
 14JCX6se404381; Wed, 19 May 2021 14:33:06 +0200
Received: (from oguz@localhost)
 by gaia.proxmox.com (8.15.2/8.15.2/Submit) id 14JCX6kc404380;
 Wed, 19 May 2021 14:33:06 +0200
From: Oguz Bektas <o.bektas@proxmox.com>
To: pmg-devel@lists.proxmox.com
Date: Wed, 19 May 2021 14:32:43 +0200
Message-Id: <20210519123244.403566-2-o.bektas@proxmox.com>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20210519123244.403566-1-o.bektas@proxmox.com>
References: <20210519123244.403566-1-o.bektas@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  2
 AWL -0.149 Adjusted score from AWL reputation of From: address
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery
 methods
 NO_DNS_FOR_FROM         0.379 Envelope sender has no MX or A DNS records
 RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_NONE                0.001 SPF: sender does not publish an SPF Record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [utils.pm, conf.in, clamav.net, config.pm, freshclam.pid,
 archive.org, proxy.host]
Subject: [pmg-devel] [PATCH v2 pmg-api 1/2] clamav: remove deprecated
 SafeBrowsing
X-BeenThere: pmg-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Mail Gateway development discussion
 <pmg-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pmg-devel/>
List-Post: <mailto:pmg-devel@lists.proxmox.com>
List-Help: <mailto:pmg-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 19 May 2021 12:33:44 -0000

this database was discontinued in 2019 due to legal reasons.

see:
https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html

archive in case it goes 404:
https://web.archive.org/web/20210408140341/https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html

* remove from freshclam.conf.in template
* remove from description
* default to 0 just to be sure
* if 'safebrowsing' set in pmg.conf, this is now ignored

note about removing the option in PMG 7.0

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
---
v1->v2:
* no changes in code - only the commit message


 src/PMG/Config.pm               | 9 +++++----
 src/PMG/Utils.pm                | 3 ---
 src/templates/freshclam.conf.in | 3 +--
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index 155990b..719b451 100755
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -186,7 +186,7 @@ sub properties {
 	    type => 'string',
 	},
 	clamav_heuristic_score => {
-	    description => "Score for ClamAV heuristics (Encrypted Archives/Documents, Google Safe Browsing database, PhishingScanURLs, ...).",
+	    description => "Score for ClamAV heuristics (Encrypted Archives/Documents, PhishingScanURLs, ...).",
 	    type => 'integer',
 	    minimum => 0,
 	    maximum => 1000,
@@ -388,10 +388,11 @@ sub properties {
 	    minimum => 0,
 	    default => 0,
 	},
+	# FIXME: remove for PMG 7.0 - https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html
 	safebrowsing => {
-	    description => "Enables support for Google Safe Browsing.",
+	    description => "Enables support for Google Safe Browsing. (deprecated option, will be ignored)",
 	    type => 'boolean',
-	    default => 1
+	    default => 0
 	},
 	scriptedupdates => {
 	    description => "Enables ScriptedUpdates (incremental download of signatures)",
@@ -410,7 +411,7 @@ sub options {
 	maxscansize  => { optional => 1 },
 	dbmirror => { optional => 1 },
 	maxcccount => { optional => 1 },
-	safebrowsing => { optional => 1 },
+	safebrowsing => { optional => 1 }, # FIXME: remove for PMG 7.0
 	scriptedupdates => { optional => 1},
     };
 }
diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
index 51d6c70..43a866d 100644
--- a/src/PMG/Utils.pm
+++ b/src/PMG/Utils.pm
@@ -861,9 +861,6 @@ sub clamav_dbstat {
     $filename = "/var/lib/clamav/bytecode.cvd";
     $read_cvd_info->('bytecode', $filename) if -f $filename;
 
-    $filename = "/var/lib/clamav/safebrowsing.cvd";
-    $read_cvd_info->('safebrowsing', $filename) if -f $filename;
-
     my $ss_dbs_fn = "/var/lib/clamav-unofficial-sigs/configs/ss-include-dbs.txt";
     my $ss_dbs_files = {};
     if (my $ssfh = IO::File->new("<${ss_dbs_fn}")) {
diff --git a/src/templates/freshclam.conf.in b/src/templates/freshclam.conf.in
index b915511..03a19d4 100644
--- a/src/templates/freshclam.conf.in
+++ b/src/templates/freshclam.conf.in
@@ -6,7 +6,7 @@ LogFileMaxSize 0
 Foreground false
 Debug false
 MaxAttempts 5
-Checks [% IF pmg.clamav.safebrowsing %]48[% ELSE %]24[% END %]
+Checks 24
 DatabaseDirectory /var/lib/clamav/
 PidFile /var/run/clamav/freshclam.pid
 DatabaseMirror [% pmg.clamav.dbmirror %]
@@ -15,7 +15,6 @@ ScriptedUpdates [% IF pmg.clamav.scriptedupdates %]true[% ELSE %]false[% END %]
 CompressLocalDatabase no
 NotifyClamd /etc/clamav/clamd.conf
 Bytecode true
-SafeBrowsing [% IF pmg.clamav.safebrowsing %]true[% ELSE %]false[% END %]
 DNSDatabaseInfo current.cvd.clamav.net
 [% IF proxy.host %]
 HTTPProxyServer [% proxy.host %]
-- 
2.20.1