1

Usecase: Scan a uploaded file on s3 using AWS Lambda.

Issue: While downloading the file for scanning using ClamAV in the lambda function, I run into "No space left on device" when the file is > 500MB.

I tried the below two ways

  1. Mount a file system like S3 or EFS on lambda so clamav can directly scan. - Feature yet not available.
  2. ClamAV scans the memory after the file is read from S3. - Doesn't look its supported.

Is there any other recommended way to get around it?

pg2286
  • 1,011
  • 12
  • 21

1 Answers1

3

If scanning files bigger than 512 MB is a primary requirement, then AWS Lambda is not a good option for you.

AWS Lambda is limited to 512 MB of disk space.

See AWS Lambda limits: https://docs.aws.amazon.com/lambda/latest/dg/limits.html

Noel Llevares
  • 15,018
  • 3
  • 57
  • 81
  • I am aware of the /tmp limit and thats why I am curious if some other approach exist using lambda – pg2286 Mar 14 '18 at 17:04
  • @pg2286 I have a server running clamd and a Lambda function which streams files from S3 to clamd on a socket. It's currently not 100% reliable though - https://stackoverflow.com/questions/52072840/intermittent-issues-with-clamav-clamd-instream-on-socket – Nicholas Albion Sep 10 '18 at 07:00