Cisco-Talos / clamav

ClamAV - Documentation is here: https://docs.clamav.net
https://www.clamav.net/
GNU General Public License v2.0
4.34k stars 699 forks source link

ERROR 503: Service Temporarily Unavailable while downloading main.cvd #616

Closed siddharthbalaji closed 2 years ago

siddharthbalaji commented 2 years ago

Describe the bug

While building my docker image, I am getting "ERROR 503: Service Temporarily Unavailable" when trying to download the main.cvd file from http://database.clamav.net/main.cvd using "wget" command. The clamav version is 0.103.6

How to reproduce the problem

Steps to reproduce the issue:

  1. wget https://www.clamav.net/downloads/production/clamav-0.103.6.tar.gz
  2. tar xvzf clamav-0.103.6.tar.gz
  3. cd clamav-0.103.6
  4. ./configure
  5. make && make install
  6. wget --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.41" "http://database.clamav.net/main.cvd"
  7. http://database.clamav.net/main.cvd Resolving database.clamav.net (database.clamav.net)... 104.16.218.84, 104.16.219.84, 2606:4700::6810:db54, ... Connecting to database.clamav.net (database.clamav.net)|104.16.218.84|:80... connected. HTTP request sent, awaiting response... 503 Service Temporarily Unavailable ERROR 503: Service Temporarily Unavailable.

Replace this text with the output from the ClamAV command: *clamconf -n GNU C: 4.8.5 20150623 (Red Hat 4.8.5-44) (4.8.5) CPPFLAGS: CFLAGS: -g -O2 -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CXXFLAGS: -g -O2 LDFLAGS: Configure: --enable-ltdl-convenience sizeof(void) = 8 Engine flevel: 127, dconf: 127**

Attachments

If applicable, add screenshots to help explain your problem.

If the issue is reproducible only when scanning a specific file, attach it to the ticket.

siddharthbalaji commented 2 years ago

clamconf -n output: Checking configuration files in /usr/local/etc

clamd.conf not found

freshclam.conf not found

clamav-milter.conf not found

Software settings

Version: 0.103.6 Optional features supported: MEMPOOL IPv6 AUTOIT_EA06 BZIP2 PCRE ICONV RAR

Database information

Database directory: /usr/local/share/clamav WARNING: freshclam.conf and clamd.conf point to different database directories Total number of signatures: 0

Platform information

uname: Linux 3.10.0-862.9.1.el7.x86_64 #1 SMP Mon Jul 16 16:29:36 UTC 2018 x86_64 OS: linux-gnu, ARCH: x86_64, CPU: x86_64 zlib version: 1.2.7 (1.2.7), compile flags: a9 platform id: 0x0a217f7f0800000002040805

Build information

GNU C: 4.8.5 20150623 (Red Hat 4.8.5-44) (4.8.5) CPPFLAGS: CFLAGS: -g -O2 -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CXXFLAGS: -g -O2 LDFLAGS: Configure: --enable-ltdl-convenience sizeof(void*) = 8 Engine flevel: 127, dconf: 127

micahsnyder commented 2 years ago

Hi @siddharthbalaji,

I would expect you to receive an HTTP 403 response when using Wget to attempt to download the database files. Wget and similar tools are actively blocked because it uses a lot of data when large numbers of users use Wget to update instead of the preferred tool: freshclam. Please see https://github.com/Cisco-Talos/clamav/issues/562

If you're interested, you can take a look at the official Dockerfile to see how we're doing it: https://github.com/Cisco-Talos/clamav/blob/main/Dockerfile Or instead of putting the databases inside the image, consider persisting them in a volume that you mount for your image so that you don't need a new copy with each image. Our documentation describes this process a little for how you can do that with the official image: https://docs.clamav.net/manual/Installing/Docker.html#persisting-the-virus-database-volume

Regards, Micah