Skip to content

Commit e9b146e

Browse files
committed
CBD-4424: Update clamav jobs to use local CVD database mirror
Linux agent updated to expect to run on updated clamav-agent Docker config, including updating and using the locally-managed clamav mirror. Windows agent updated to use clamav-agent as a database mirror, and to handle the new structure of Windows clamav downloads. Change-Id: I87ec5bf5d0bb03e4be89160834c71c64be816f68 Reviewed-on: http://review.couchbase.org/c/build-tools/+/164035 Tested-by: Chris Hillery <[email protected]> Reviewed-by: Ming Ho <[email protected]>
1 parent 4e96752 commit e9b146e

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

clamav/linux/run-clam.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#!/bin/bash -ex
22

3-
#upgrade clamav in case it is outdated
4-
sudo apt-get update
5-
sudo apt-get install -y clamav-base clamav-daemon clamav-freshclam clamdscan
6-
7-
# Update clamav database
8-
sudo freshclam
3+
# Update clamav database - we run cvdupdate locally
4+
sudo /usr/local/bin/cvd update
95

106
# Download build
117
echo "Downloading ${VERSION}-${BLD_NUM} ${PLATFORM} binary ..."
@@ -16,14 +12,14 @@ curl --fail ${LATESTBUILDS} -o ${WORKSPACE}/${PKG_NAME} || exit 1
1612
echo "Extract ${VERSION}-${BLD_NUM} ${PLATFORM} binary ..."
1713
mkdir -p ${WORKSPACE}/scansrc
1814
pushd ${WORKSPACE}/scansrc
19-
/usr/bin/rpm2cpio ${WORKSPACE}/${PKG_NAME} | /bin/cpio -idm || exit 1
15+
rpm2cpio ${WORKSPACE}/${PKG_NAME} | cpio -idm || exit 1
2016
popd
2117

2218
echo .................................
2319
echo ClamAV Version
24-
/usr/bin/clamscan -V
20+
clamscan -V
2521
echo .................................
26-
/usr/bin/clamscan --follow-dir-symlinks=2 --recursive=yes --suppress-ok-results -l ${WORKSPACE}/scan.log ${WORKSPACE}/scansrc || exit 1
22+
clamscan --database /var/clamav/database --follow-dir-symlinks=2 --recursive=yes --suppress-ok-results -l ${WORKSPACE}/scan.log ${WORKSPACE}/scansrc || exit 1
2723

2824
grep 'Infected files: 0' ${WORKSPACE}/scan.log
2925
if [[ $? != 0 ]]; then

clamav/windows/freshclam.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ LogTime yes
6464
# geographic endpoint.
6565
# If the old db.XY.clamav.net domains are set, freshclam will automatically
6666
# use database.clamav.net instead.
67-
DatabaseMirror database.clamav.net
67+
DatabaseMirror http://clamav-mirror.build.couchbase.com/
6868

6969
# How many attempts to make before giving up.
7070
# Default: 3 (per mirror)

clamav/windows/run-clam.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set CLAMDIR=C:\clamav
2-
set CLAM_FILENAME=clamav-%CLAMAV_VERSION%-win-x64-portable.zip
2+
set CLAM_FILENAME=clamav-%CLAMAV_VERSION%.win.x64.zip
33
set CLAM_DL=%CLAMDIR%\downloads\%CLAM_FILENAME%
44
set CLAM_DB=%CLAMDIR%\database
55
set BUILD_TOOLS=%WORKSPACE%\build-tools\clamav\windows
@@ -10,6 +10,7 @@ if not exist %CLAM_DL% (
1010
)
1111
unzip %CLAM_DL%
1212

13+
cd clamav-%CLAMAV_VERSION%.win.x64
1314
mkdir %CLAM_DB%
1415
freshclam --config-file=%BUILD_TOOLS%\freshclam.conf || goto error
1516
echo ...........................................

0 commit comments

Comments
 (0)