March 29, 2024, 01:46:54 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Upload Filtering from squid  (Read 10252 times)

Offline Avin

  • Linux Learner
  • ***
  • Posts: 54
  • L!nuX
Upload Filtering from squid
« 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

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Upload Filtering from squid
« Reply #1 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]


Offline Avin

  • Linux Learner
  • ***
  • Posts: 54
  • L!nuX
Re: Upload Filtering from squid
« Reply #2 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
 
« Last Edit: April 06, 2009, 03:47:53 AM by Avin »

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Upload Filtering from squid
« Reply #3 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.

Offline Avin

  • Linux Learner
  • ***
  • Posts: 54
  • L!nuX
Re: Upload Filtering from squid
« Reply #4 on: April 07, 2009, 04:20:33 AM »
Thanks dude... :)

I will try to implement in my office..


Avin..

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Upload Filtering from squid
« Reply #5 on: April 09, 2009, 04:20:40 PM »
Let me know if that works or if you find any other solution, do share here :)

Offline Avin

  • Linux Learner
  • ***
  • Posts: 54
  • L!nuX
Re: Upload Filtering from squid
« Reply #6 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....


Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Upload Filtering from squid
« Reply #7 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 !