LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 12-20-2006, 03:37 AM   #1
soumalya
Member
 
Registered: Nov 2006
Posts: 254

Rep: Reputation: 31
block *.* file download using squid


hi

I want to block downloading files like .doc, .dat, .mp3, .wav, .avi .rar, .exe using squid.

can I configure squid to block these files.

help me plz . urgent


thanks
 
Old 12-20-2006, 03:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
please don't use words like urgent. it's not urgent for us...

either way. just use a urlpath_regex acl to match the end of the file type IS you wish to block by a crude method like you are asking abou. better to block by mime type really i'd think.

acl banned_extensions urlpath_regex -i \.exe$ \.mp3$ \.etc$

http_access deny banned_extensions
 
Old 12-20-2006, 06:29 AM   #3
bbjmmj
LQ Newbie
 
Registered: Dec 2006
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by soumalya
hi

I want to block downloading files like .doc, .dat, .mp3, .wav, .avi .rar, .exe using squid.

can I configure squid to block these files.

help me plz . urgent


thanks
like this :
acl game url_regex -i .rm .rmvb .wmv game .dll .msi .doc qq.com tencent.com chat

"game" is the name of acl . if URL contains words above , it can be allowed or denyed .

Last edited by bbjmmj; 12-20-2006 at 06:31 AM.
 
Old 12-20-2006, 06:56 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
i've already given that example 3 hours previously...
 
Old 12-20-2006, 09:35 PM   #5
soumalya
Member
 
Registered: Nov 2006
Posts: 254

Original Poster
Rep: Reputation: 31
thanks for this reply

as ur messege i inserted

acl banned_extensions urlpath_regex -i \.exe$ \.mp3$ \.etc$

http_access deny banned_extensions

in my squid.conf

but when i access ajhits.com or others mp3 downloading site, i can download mp3s

but i want to block downloading this files


thanks
 
Old 12-21-2006, 12:18 AM   #6
bbjmmj
LQ Newbie
 
Registered: Dec 2006
Posts: 8

Rep: Reputation: 0
But we are different ,you use urlpath_regex , I use url_regex .
Quote:
Originally Posted by acid_kewpie
i've already given that example 3 hours previously...
 
Old 12-21-2006, 02:51 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
Quote:
Originally Posted by soumalya
thanks for this reply

as ur messege i inserted

acl banned_extensions urlpath_regex -i \.exe$ \.mp3$ \.etc$

http_access deny banned_extensions

in my squid.conf

but when i access ajhits.com or others mp3 downloading site, i can download mp3s

but i want to block downloading this files


thanks
if it's having no effect either you've not restarted squid or the entries are in the wrong place. you need to appreciate that with acl's in squid it will start at the top one and work down until a definite answer is received. you need to insert the http_access entry relative to your existing ones, probably fairly near the top of them. just make sure there are no rules above it to make it obselete, and it is not so high as to impact other rules below it. for example there is a default rule to allow the local machine to download anything. this is normally a very good thing. if this rule moves above it, that specific rule to permit 127.0.0.1 to do anything at all will no longer function.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i want to block a URL from squid Atifkhan Linux - Enterprise 3 02-23-2010 01:47 PM
Squid block sites linuxnirmal Linux - Security 5 11-15-2006 10:59 AM
How to block a Website in Squid winxlinx Linux - Networking 1 02-21-2006 04:40 PM
Restricting Download based on total download using Squid,SARG& Webmin jomy Linux - Networking 0 04-27-2005 06:04 AM
How can i block msn through squid linuxeagle Linux - Networking 5 04-08-2004 09:08 AM


All times are GMT -5. The time now is 11:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration