Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => Linux Proxy Server Support => Topic started by: Avin on March 30, 2009, 01:23:36 PM

Title: Upload Filtering from squid
Post by: Avin on March 30, 2009, 01:23:36 PM
Hi All,

     Is there any way to filter upload content using Squid ?  I mean how to block only zip attachment sent via any mail account(gmail, yahoo) through squid. I don't want to block .doc and other text file. If it is not possible in squid then tell me software name which will do my work in linux. I hope I explain my problem well..  Plz help


Thanks,
Avin Tokade
Title: Re: Upload Filtering from squid
Post by: Ricky on April 05, 2009, 07:12:05 AM
You can block zip and exe files using squid but not sure if can do same in attachments too.
Add following in squid config file :
Code: [Select]
acl badfiles url_regex -i  \.exe$    .\zip$
http_access deny badfiles
[/cod]

Title: Re: Upload Filtering from squid
Post by: Avin on April 06, 2009, 03:44:57 AM
Thanks for reply... :)
But It will filter download. I want to block upload/attachment.  I have already placed download restriction rules in squid. which is only apply on download side.


Avin
 
Title: Re: Upload Filtering from squid
Post by: Ricky on April 06, 2009, 09:50:58 PM
Never done that but blocking mime type can do a little as I saw on other place
Code: [Select]
acl fileupload req_mime_type -i ^multipart/form-data$
http_access deny fileupload

Only way to block certain type of form data, otherwise blocking update is not really possible as it is part of http  request and blocking http is not really good idea as may result in non-functioning web forms.
Title: Re: Upload Filtering from squid
Post by: Avin on April 07, 2009, 04:20:33 AM
Thanks dude... :)

I will try to implement in my office..


Avin..
Title: Re: Upload Filtering from squid
Post by: Ricky on April 09, 2009, 04:20:40 PM
Let me know if that works or if you find any other solution, do share here :)
Title: Re: Upload Filtering from squid
Post by: Avin on April 17, 2009, 04:19:33 AM
Hi Ricky

    Sorry for  late reply. Actually I was busy in other work. I have tried this ACL. but It totally block some type of file.  then
    I try this squid directives and finally block any attachment greater than 512 KB.  This is very helpful for me to block mail attachment but still I am waiting for individually file blocking because this directive block all file attachment including .doc and text file.

request_body_max_size 512 KB

Avin....

Title: Re: Upload Filtering from squid
Post by: Ricky on April 18, 2009, 08:29:00 PM
If I find something useful, I will share here.

Hope to see you around sharing your knowledge with  others here !