DEV Community

Cover image for 🛡️ Zero Trust for File Uploads in S3: Protecting Amazon S3 with Trend Micro FSS
sourav chakraborty for AWS Community Builders

Posted on • Edited on

3 1 2

🛡️ Zero Trust for File Uploads in S3: Protecting Amazon S3 with Trend Micro FSS

📥 Introduction

In today’s cloud-native world, Amazon S3 is a cornerstone for storing application uploads—images, documents, archives, and more. But with flexibility comes risk. Users might unknowingly (or intentionally) upload malicious files that can:

  • ❌ Compromise your backend systems
  • 📤 Spread malware through shared downloads
  • 📦 Bypass downstream processors

⚠️ S3 doesn't scan uploaded files for malware.

Trend Micro File Storage Security (FSS) — a real-time, serverless scanning solution to protect your S3 buckets from file-based threats.


🧨 The Problem: Vulnerable File Uploads

Let’s say you’re running a file-sharing or content review app. Malicious users could upload:

  • 📎 Ransomware-infected ZIPs
  • 📄 Trojan-embedded Word docs
  • 🧾 JavaScript exploits hidden in PDFs

Without inspection, these files could:

  • 🖥️ Be processed by backend Lambda or EC2 services
  • 🔗 Be shared with other users
  • 📉 Lead to data breaches or cloud compromise

🛠️ The Solution: Trend Micro File Storage Security (FSS)

Trend Micro FSS Trend Micro FSS is a serverless, event-driven scanning solution built for AWS. It integrates directly with Amazon S3 and uses Trend Micro's advanced malware detection engine to scan files in real-time. The solution classifies scan outcomes and takes defined actions:

🧪 Scan Result ✅ Action Taken
✔️ Clean Move to ✅ Clean Bucket
🛑 Malicious Move to 🚫 Quarantine Bucket
❓ Scan Failed Move to ⚠️ Failure Bucket

Key Features at a Glance

⬇️ Decrease Threat Vectors with Malware Scanning: Block known harmful files using Trend Micro anti-malware signatures for viruses, Trojans, spyware, and more.

🤝 File Reputation: Cross-check files against threat intelligence to determine if they are known to be malicious.

✨ Variant Protection: Detect polymorphic or obfuscated malware using advanced pattern-matching and fragment analysis.

💪 Extensive Flexibility: Scan all file types, including .BIN, .EXE, .JPEG, .MP4, .PDF, .TXT, .ZIP, and more — with no size or type restriction.


📊 Architecture Overview

⚙️ Setup Guide (Step-by-Step)
✅ Step 1: Deploy FSS
Subscribe via AWS Marketplace

Deploy using the CloudFormation template

📂 Step 2: Prepare S3 Buckets
uploads-bucket — Original file uploads

clean-bucket — For scanned, safe files

quarantine-bucket — For detected malware

failure-bucket — For scan failures

🔁 Step 3: Create S3 Event Trigger
json
Copy
Edit
{
"Event": "s3:ObjectCreated:*",
"LambdaFunctionArn": "arn:aws:lambda:your-function-arn"
}
🧠 Step 4: Lambda Pseudocode (Simplified)
python
Copy
Edit
def lambda_handler(event, context):
key = event['Records'][0]['s3']['object']['key']
bucket = event['Records'][0]['s3']['bucket']['name']

scan_result = scan_with_trendmicro(bucket, key)

if scan_result == "CLEAN":
    move_to("clean-bucket", key)
elif scan_result == "MALICIOUS":
    move_to("quarantine-bucket", key)
else:
    move_to("failure-bucket", key)
Enter fullscreen mode Exit fullscreen mode

🔐 Step 5: IAM Role Permissions
Ensure Lambda has access to:

s3:GetObject, PutObject, DeleteObject

Trend Micro FSS API endpoint

Destination buckets

We can also get a report of scan acviity in Trendmicro console

🔔 Bonus Features
📩 Send SNS/Slack alerts on malware detection

🏷️ Tag files with scan_result=clean|malicious|failed

🧩 Connect EventBridge → Security Hub for automatic SOAR response

🧠 Best Practices
✅ Block public access to all buckets
✅ Apply bucket encryption (SSE-S3 or KMS)
✅ Use lifecycle rules to auto-delete old files
✅ Limit file size and scan timeout thresholds

🏁 Final Thoughts
Trend Micro File Storage Security provides a plug-and-play solution to scan every file that hits your S3 bucket. It isolates threats, supports automation, and requires minimal maintenance.

🛡️ Don’t let your file uploads be a backdoor into your cloud.

📚 Resources
🔗 Trend Micro File Storage Security Docs

📝 AWS S3 Event Notifications

🔐 IAM Best Practices

Heroku

Save time with this productivity hack.

See how Heroku MCP Server connects tools like Cursor to Heroku, so you can build, deploy, and manage apps—right from your editor.

Learn More

Top comments (1)

Collapse
 
jsonpr profile image
Jason Kao

Sourav, I like the idea of adding security by scanning files proactively when they're uploaded to S3.

AWS offers Malware Protection for S3 (GuardDuty service, but can be enabled independently of GuardDuty). What are your thoughts on the comparison of using AWS's native GuardDuty service to scan files or Trend Micro's FSS solution?

Create a simple OTP system with AWS Serverless cover image

Create a simple OTP system with AWS Serverless

Implement a One Time Password (OTP) system with AWS Serverless services including Lambda, API Gateway, DynamoDB, Simple Email Service (SES), and Amplify Web Hosting using VueJS for the frontend.

Read full post

👋 Kindness is contagious

Delve into a trove of insights in this thoughtful post, celebrated by the welcoming DEV Community. Programmers of every stripe are encouraged to share their viewpoints and expand our collective expertise.

A simple “thank you” can brighten someone’s day—drop yours in the comments below!

On DEV, exchanging knowledge lightens our path and forges deeper connections. If you found this valuable, a quick note of gratitude to the author goes a long way.

Get Started