Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-20-2006, 03:37 AM
|
#1
|
Member
Registered: Nov 2006
Posts: 260
Rep:
|
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
|
|
|
12-20-2006, 03:51 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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
|
|
|
12-20-2006, 06:29 AM
|
#3
|
LQ Newbie
Registered: Dec 2006
Posts: 8
Rep:
|
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.
|
|
|
12-20-2006, 06:56 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
i've already given that example 3 hours previously... 
|
|
|
12-20-2006, 09:35 PM
|
#5
|
Member
Registered: Nov 2006
Posts: 260
Original Poster
Rep:
|
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
|
|
|
12-21-2006, 12:18 AM
|
#6
|
LQ Newbie
Registered: Dec 2006
Posts: 8
Rep:
|
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... 
|
|
|
|
12-21-2006, 02:51 AM
|
#7
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
All times are GMT -5. The time now is 09:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|