I have an idea that will make all Linux servers running PHP more secure.
I want to configure php.ini
File Uploads to scan any new file upload with ClamAV's clamscan
.
Is it possible? How should I configure it?
I have an idea that will make all Linux servers running PHP more secure.
I want to configure php.ini
File Uploads to scan any new file upload with ClamAV's clamscan
.
Is it possible? How should I configure it?
Copyright © 2021 Jogjafile Inc.
While there are libraries for interacting with ClamAV within PHP scripts, there is no way to automatically scan all uploaded files automatically.
Mainly, due to flexibility. For example, if you run a security website to track various viruses and store a copy of each, ClamAV would get to them during the upload, rendering your website useless. The better approach would be to do this in the client code, and use one of the libraries in the link above to perform scanning.
Having said that, I don't believe this is something that's impossible to achieve. You can write a PHP extension that hooks into fileuploads to automatically run ClamAV on uploaded files.