The software in this article is
Windows
tossed at the request of netizens;
What is ClamAV?
ClamAV
is an open source (GPLv2
) antivirus toolkit designed for email scanning on mail gateways. It provides many utilities, including a flexible and extensible multi-threaded daemon, a command-line scanner, and advanced tools for automatic database updates. The core of the package is an antivirus engine provided as a shared library.
ClamAV
Support multi-platform installation, including Windows
, macOS
, Linux
, Docker
etc.
But it should be noted that
ClamAV
Not a traditional antivirus or endpoint security suite;- Whether you're using an official
ClamAV docker
mirror orClamAV
a third-party mirror running , you need to make sure you have enoughRAM
.
ClamAV
Recommendations RAM
(as of 2020/09/20
):
- lowest:
3 G
- Preferred:
4 G
Install
Install it in Docker mode on Synology.
At the time of writing this article,
latest
the corresponding version isstable
, that is, the stable version, and the corresponding version number is1.1.0
;
If you are familiar with the command line, it may be docker cli
faster to use .
Use SSH
the client to log in to the Synology host, and then execute the following command on the command line. In docker
the folder, create a new folder clamav
and create a subfolder in it data
, where data
the subdirectory is used to save and persist the virus database
# 新建文件夹 clamav 和 子目录
mkdir -p /volume2/docker/clamav/data
# 进入 clamav 目录
cd /volume2/docker/clamav
# 下载镜像
docker pull clamav/clamav:latest
run
Download virus database
The first time you run it, you need to download and update the virus database
ClamAV
Containers actually run freshclam
and clamd
daemonize both by default. To control the behavior of a service started inside a container, you need to control it through environment variables.
Official instructions: https://docs.clamav.net/manual/Installing/Docker.html#controlling-the-container
# 更新病毒数据库
docker run -it \
--rm \
--name clamav \
-v $(pwd)/data:/var/lib/clamav \
-e CLAMAV_NO_FRESHCLAMD=false \
clamav/clamav:latest
Download time depends on network conditions
When you see SelfCheck: Database status OK.
, you can use Ctrl+C
to exit the running of the container, --rm
the parameter ensures that the container will be cleaned up after exiting
Back FileStation
, data
you can see the downloaded virus database file in
Run a Clam(D) scan
Docker
Unable to access any hosts files. Therefore, to Docker
scan for these files in , they need to be mounted using a bind mount so that they can be accessed.
For example: /path/to/scan
mount the host directory in the container as /scandir
, and then call clamcan
on /scandir
to complete the scan
# 扫描主机 /path/to/scan 目录
docker run -it \
--rm \
--name clamav \
-v /path/to/scan:/scandir \
-v $(pwd)/data:/var/lib/clamav \
clamav/clamav:latest \
clamscan /scandir
docker
The following example is to scan after mounting the directory of Synology
Before the hard disk crashed, Lao Su's
docker
directory wasvolume2
on ;
# 示例:扫描 docker 目录
docker run -it \
--rm \
--name clamav \
-v /volume2/docker:/scandir \
-v $(pwd)/data:/var/lib/clamav \
clamav/clamav:latest \
clamscan /scandir
Can directly see the details of the scan
reference documents
Cisco-Talos/clamav: ClamAV - Documentation is here: https://docs.clamav.net
地址:https://github.com/Cisco-Talos/clamav
clamav/README.Docker.md at main · Cisco-Talos/clamav · GitHub
地址:https://github.com/Cisco-Talos/clamav/blob/main/README.Docker.md
ClamAVNet
address: https://www.clamav.net/
Introduction - ClamAV Documentation
地址:https://docs.clamav.net/
ClamAV® blog
address: https://blog.clamav.net/