Skip to content

Commit e5b6ee5

Browse files
committed
Fix ClamAV freshclam config: ensure signatures are downloaded
freshclam requires DatabaseMirror set in config. Without it, ClamAV scans with empty signatures (catches nothing). Now properly configures freshclam.conf on both Linux (apt) and macOS (Homebrew) before updating.
1 parent f886214 commit e5b6ee5

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

.github/workflows/dry-run.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ jobs:
306306
if: matrix.variant == 'standard' && startsWith(matrix.os, 'ubuntu')
307307
run: |
308308
sudo apt-get update -qq && sudo apt-get install -y -qq clamav > /dev/null 2>&1
309-
sudo freshclam --quiet 2>/dev/null || true
309+
sudo sed -i 's/^Example/#Example/' /etc/clamav/freshclam.conf 2>/dev/null || true
310+
grep -q "DatabaseMirror" /etc/clamav/freshclam.conf 2>/dev/null || \
311+
echo "DatabaseMirror database.clamav.net" | sudo tee -a /etc/clamav/freshclam.conf > /dev/null
312+
sudo freshclam --quiet
310313
echo "=== ClamAV scan ==="
311314
clamscan --no-summary ./codebase-memory-mcp
312315
echo "=== ClamAV: clean ==="
@@ -315,7 +318,13 @@ jobs:
315318
if: matrix.variant == 'standard' && startsWith(matrix.os, 'macos')
316319
run: |
317320
brew install clamav > /dev/null 2>&1
318-
freshclam --quiet 2>/dev/null || true
321+
CLAMAV_ETC=$(brew --prefix)/etc/clamav
322+
if [ ! -f "$CLAMAV_ETC/freshclam.conf" ]; then
323+
cp "$CLAMAV_ETC/freshclam.conf.sample" "$CLAMAV_ETC/freshclam.conf" 2>/dev/null || true
324+
sed -i '' 's/^Example/#Example/' "$CLAMAV_ETC/freshclam.conf" 2>/dev/null || true
325+
echo "DatabaseMirror database.clamav.net" >> "$CLAMAV_ETC/freshclam.conf"
326+
fi
327+
freshclam --quiet
319328
echo "=== ClamAV scan (macOS) ==="
320329
clamscan --no-summary ./codebase-memory-mcp
321330
echo "=== ClamAV: clean ==="

.github/workflows/release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ jobs:
302302
if: matrix.variant == 'standard' && startsWith(matrix.os, 'ubuntu')
303303
run: |
304304
sudo apt-get update -qq && sudo apt-get install -y -qq clamav > /dev/null 2>&1
305-
sudo freshclam --quiet 2>/dev/null || true
305+
# Ensure freshclam config has DatabaseMirror set
306+
sudo sed -i 's/^Example/#Example/' /etc/clamav/freshclam.conf 2>/dev/null || true
307+
grep -q "DatabaseMirror" /etc/clamav/freshclam.conf 2>/dev/null || \
308+
echo "DatabaseMirror database.clamav.net" | sudo tee -a /etc/clamav/freshclam.conf > /dev/null
309+
sudo freshclam --quiet
306310
echo "=== ClamAV scan ==="
307311
clamscan --no-summary ./codebase-memory-mcp
308312
echo "=== ClamAV: clean ==="
@@ -311,7 +315,14 @@ jobs:
311315
if: matrix.variant == 'standard' && startsWith(matrix.os, 'macos')
312316
run: |
313317
brew install clamav > /dev/null 2>&1
314-
freshclam --quiet 2>/dev/null || true
318+
# Create freshclam config if missing
319+
CLAMAV_ETC=$(brew --prefix)/etc/clamav
320+
if [ ! -f "$CLAMAV_ETC/freshclam.conf" ]; then
321+
cp "$CLAMAV_ETC/freshclam.conf.sample" "$CLAMAV_ETC/freshclam.conf" 2>/dev/null || true
322+
sed -i '' 's/^Example/#Example/' "$CLAMAV_ETC/freshclam.conf" 2>/dev/null || true
323+
echo "DatabaseMirror database.clamav.net" >> "$CLAMAV_ETC/freshclam.conf"
324+
fi
325+
freshclam --quiet
315326
echo "=== ClamAV scan (macOS) ==="
316327
clamscan --no-summary ./codebase-memory-mcp
317328
echo "=== ClamAV: clean ==="

0 commit comments

Comments
 (0)