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

πŸ›‘οΈ 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

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?