NethServer Version: 7.6.1810
Module: clamav-0.101.1-1.el7.x86_64 | nethserver-antivirus-1.2.1-1.ns7.noarch
I have a NS instance (for clarifying purpose lets call it clamav-ns) behind a proxy/gateway, I’m receiving mails notification with this error:
ERROR: Can't download main.cvd from database.clamav.net
When I run freshclam command I get this:
ClamAV update process started at Tue Mar 5 09:27:08 2019
WARNING: can't download main.cvd from database.clamav.net
Trying again in 5 secs...
WARNING: Can't download main.cvd from database.clamav.net
Trying again in 5 secs...
ERROR: Can't download main.cvd from database.clamav.net
Giving up on database.clamav.net...
Update failed. Your network may be down or none of the mirrors listed in /etc/freshclam.conf is working. Check https://www.clamav.net/documents/official-mirror-faq for possible reasons.
Gateway/proxy is also a NS with nethserver-squid configured like this:
Since clamav-ns is on the green zone, it has its proxy configuration set it and working, I checked this with this two commands:
1. yum check-update
2. speedtest-cli
Both commands respond correctly so proxy configuration for clamav-ns, I check freshclam configuration (/etc/freshclam.conf
) and found out that it doesn’t have its proxy configuration set it.
So I created a custom template like this:
mkdir -p /etc/e-smith/templates-custom/etc/freshclam.conf/
nano /etc/e-smith/templates-custom/etc/freshclam.conf/99proxy
And added this lines:
# Proxy settings
HTTPProxyServer ip-for-clamav-ns
HTTPProxyPort 3128
HTTPProxyUsername proxy-username
HTTPProxyPassword proxy-password
I expanded the template like this:
expand-template /etc/freshclam.conf
Rerun freshclam command and …
ClamAV update process started at Tue Mar 5 09:42:21 2019
Connecting via ###.###.###.###
main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Connecting via ###.###.###.###
Downloading daily.cvd [ 56%]
Download in progress, so problem solved.
I don’t know why clamav doesn’t use the global proxy, does someone have a better solution?
Should this template be included as a normal template?