Skip to content

Commit

Permalink
Fix typo in config.json.tmpl
Browse files Browse the repository at this point in the history
Add more logging in bootstrap to catch errors like this.
  • Loading branch information
nielm committed Nov 22, 2023
1 parent 7cbc202 commit 989251b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cloudrun-malware-scanner/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ service clamav-freshclam stop &

# Check and perform shell-varable substitution on config file, copying it to /etc
#
Log INFO main "Perfoming env var substitution on config file"
CONFIG_FILE=./config.json
if [[ ! -e "${CONFIG_FILE}" ]] ; then
Log ERROR main "${CONFIG_FILE} does not exist"
Expand All @@ -76,6 +77,7 @@ CONFIG_FILE=/etc/malware-scanner-config.json

# Get name of CVD Mirror bucket from config file
#
Log INFO main "Checking ClamCvdMirrorBucket from config file"
CVD_MIRROR_BUCKET=$(/usr/bin/jq -r '.ClamCvdMirrorBucket' "${CONFIG_FILE}")
if [[ -z "${CVD_MIRROR_BUCKET}" || "${CVD_MIRROR_BUCKET}" = "null" ]] ; then
Log ERROR main "ClamCvdMirrorBucket is not defined in ${CONFIG_FILE}"
Expand Down Expand Up @@ -112,6 +114,8 @@ function updateClamConfigFile {
Log INFO updateClamConfigFile "Updated ${CLAM_CONFIG_FILE} with parameters: ${MODIFIED_PARAMS}"
}

Log INFO main "Updating ClamAV config files"

# Set Clam config file values
# see clamd.conf documentation:
# https://manpages.debian.org/bullseye/clamav-daemon/clamd.conf.5.en.html
Expand Down
2 changes: 1 addition & 1 deletion cloudrun-malware-scanner/config.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Each object must have the 3 properties 'unscanned', 'clean' and 'quarantined', specifying the bucket names to use.",
"",
"'ClamCvdMirrorBucket' is a GCS bucket used to mirror the clamav database definition files to prevent overloading the Clam servers",
"and being rate limited/blacklisted. Its contents are maintained by the updateCvdMirror.sh script"
"and being rate limited/blacklisted. Its contents are maintained by the updateCvdMirror.sh script",
"",
"Shell environmental variable substitution is supported in this file.",
"At runtime, it will be copied to /etc"
Expand Down

0 comments on commit 989251b

Please sign in to comment.