Skip to content

Commit

Permalink
Merge pull request #2 from apprentx/dev_config
Browse files Browse the repository at this point in the history
Increase max file size to 1gb
  • Loading branch information
AntoineGrandchamp authored Oct 10, 2023
2 parents 1c75252 + bdae245 commit 0b42ddf
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ node_modules
.idea
cvds
pyenv
config.json
6 changes: 3 additions & 3 deletions cloudrun-malware-scanner/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ function updateClamConfigFile {
# https://manpages.debian.org/bullseye/clamav-daemon/clamd.conf.5.en.html
updateClamConfigFile /etc/clamav/clamd.conf << EOF
# This option allows you to specify the upper limit for data size that will be transfered to remote daemon when scanning a single file.
StreamMaxLength 521M
StreamMaxLength 1024M
# Sets the maximum amount of data to be scanned for each input file.
# Archives and other containers are recursively extracted and scanned up to this value.
MaxScanSize 512M
MaxScanSize 1024M
# Files larger than this limit won't be scanned.
# Affects the input file itself as well as files contained inside it (when the input file is an archive, a document or some other kind of container).
MaxFileSize 512M
MaxFileSize 1024M
# Nested archives are scanned recursively, e.g. if a Zip archive contains a RAR file, all files within it will also be scanned.
# This options specifies how deeply the process should be continued.
Expand Down
15 changes: 15 additions & 0 deletions cloudrun-malware-scanner/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"buckets": [
{
"unscanned": "b12-private",
"clean": "b12-private",
"quarantined": "quarantined-b12"
},
{
"unscanned": "b12-public",
"clean": "b12-public",
"quarantined": "quarantined-b12"
}
],
"ClamCvdMirrorBucket": "cvd-mirror-b12"
}
3 changes: 2 additions & 1 deletion cloudrun-malware-scanner/config/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"clean": "dev-b12-public",
"quarantined": "quarantined-b12-dev"
}
]
],
"ClamCvdMirrorBucket": "cvd-mirror-b12-dev"
}
3 changes: 2 additions & 1 deletion cloudrun-malware-scanner/config/production.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"clean": "b12-public",
"quarantined": "quarantined-b12"
}
]
],
"ClamCvdMirrorBucket": "cvd-mirror-b12"
}
6 changes: 3 additions & 3 deletions cloudrun-malware-scanner/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const PORT = process.env.PORT || 8080;
const CLAMD_HOST = "127.0.0.1";
const CLAMD_PORT = 3310;

// 10 min timeout for scanning.
const CLAMD_TIMEOUT = 600000;
// 20 min timeout for scanning.
const CLAMD_TIMEOUT = 1200000;

// Note: MAX_FILE_SIZE limits the size of files which are sent to th
// ClamAV Daemon.
Expand All @@ -42,7 +42,7 @@ const CLAMD_TIMEOUT = 600000;
//
// Note scanning a 500MiB file can take 5 minutes, so ensure timeout is
// large enough.
const MAX_FILE_SIZE = 500000000; // 500MiB
const MAX_FILE_SIZE = 1000000000; // 1000MiB

const CONFIG_FILE = "./config.json";

Expand Down

0 comments on commit 0b42ddf

Please sign in to comment.