how to perform antivirus scan on aws s3

Viewed 19216

I am having a web application where user will upload file and web server will save it to S3 and then later on process it without copying it to local server.
Now my question is how can i perform virus scan on files stored in S3 before processing them.
Requirement is to use well established antivirus applications.

Update:10/April/2018
Till date there is no professional antivirus system that can do scan on s3 bucket directly. We ended up installing antivirus on our windows/linux box and creating a flow where we copy files first to a temporary folder and then copying back to S3 once scan is done.

4 Answers

There are quite a few ways to do this but they would all involve copying the content out of S3 temporarily so it can be analyzed - ideally this would happen in-region to save you some transfer costs.

Here's an example of doing exactly that using a couple lambda functions (packaged for 1 click deployment): https://github.com/uvasoftware/scanii-lambda

It uses our service (https://scanii.com) for analysis but you can trivially replace that part with whatever service you would like including commercial av ones you already have a relationship with. This code is Apache v2 open source so you can modify it as needed.

Hope this helps

It depends on what model do you need. After some research there are a few models with some options:

  • SaaS product:
    • A SaaS setting inside or outside your AWS account
    • Example: CrowdStrike Falcon or AWS Marketplace products like https://bucketav.com/
  • AV product:
    • A commercial or OSS product you buy/subscribe to. It requires extra build/maintenance than a SaaS one. Usually running in ECS/EC2 instances (with auto-scaling group if required) and build your pipeline around it to be triggered if your add files to your S3 bucket
    • Example: http://www.binaryalert.io/
Related