# Malware scanning

> How scanning works per bucket, what pending and infected mean, and what you see.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://files.docs.sypnia.com/security/malware-scanning/

For agents: Files malware scanning per bucket (scan: on): pending → 423 scan_pending (SDK can wait), clean → allowed by policy, infected → 423 infected, quarantined 30 days then deleted; Cloud uses GuardDuty Malware Protection for S3; engine ClamAV or GuardDuty; file.infected webhook and console notice with uploader; detects known malware only.

With `scan: on`, every new file in the bucket is scanned before it can be downloaded.

| `scan_status` | Download                                                                                 |
| ------------- | ---------------------------------------------------------------------------------------- |
| `pending`     | refused with `423 scan_pending`; the SDK can wait for it                                 |
| `clean`       | allowed by your policies                                                                 |
| `infected`    | refused with `423 infected`; the file is moved to quarantine, kept 30 days, then deleted |

In Sypnia Cloud the scanner is Amazon GuardDuty Malware Protection for S3. Self-hosted, the engine supports ClamAV or GuardDuty. A webhook (`file.infected`) and the console tell you when a file is quarantined, with who uploaded it.

Scanning detects known malware; it does not make a file safe to open. Keep serving user files from the separate content domain.
