bcgov / CONN-ClamAV-scan

ClamAV AWS Lambda Layer built with Docker
Apache License 2.0
0 stars 0 forks source link
citz

Lifecycle:Experimental

AWS ClamAV Lambda Layer

based on https://github.com/sutt0n/serverless-clamav-lambda-layer

How to build locally

git clone https://github.com/bcgov/CONN-ClamAV-scan
./build.sh

After successfult build.sh execution, archive clamav_lambda_layer.zip would be generated in the ./layer folder.

Archive does not contain virus definitions and thus it can be included in the terraform lambda deployment script.

How to use it

Using AWS console (or Terraform, serverless, CloudFormation or SAM) create two lambdas that use same lambda layer generated by the current project. Both lambdas can use same hanlder.js, just call handler.virusScan and handler.updateDb functions. First lambda can be triggered by S3 PutObject event, second lambda can be triggered by CloudWatch event to run at specified interval to keep virus definitions up-to-date.

handler.js is provided as an example only. Code invokes clamscan and freshclam executables in the /bin folder.

Known issues