LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-18-2006, 02:33 AM   #1
nesargha
Member
 
Registered: May 2006
Distribution: rhel 4, red hat 9, fedora core 2
Posts: 51

Rep: Reputation: 15
Smile blocking the user from download between working hours using squid


hi guys,
can any one tell how can i block downloading from internet at working hours, i am using squid with fedora core.
from
nesargha
 
Old 05-18-2006, 09:42 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
I believe you can include "time" in your Squid acls, like:

acl rule1 time MTWHF 8:00-17:00
..
http_access deny rule1

See the squid documentation of the "time" acl for more info

Alternatively you can use the iptables time match to block outgoing http requests during certain time periods to prevent packet from even reaching the squid proxy. IMHO I'd going with the builtin Squid acls.
 
Old 05-19-2006, 12:15 AM   #3
nesargha
Member
 
Registered: May 2006
Distribution: rhel 4, red hat 9, fedora core 2
Posts: 51

Original Poster
Rep: Reputation: 15
Question

Thank u capt. caveman, i have made the following changes to my squid.conf file

-------------
acl allowlist1 url_regex -i 192.168

#We want to limit downloads of these type of files
#Put this all in one line
acl denylist2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt
.ram .rm .iso .raw .wav .mov


#limit bandwidth during the day
acl day time 09:00-23:59

delay_pools 2

#First delay class (1) of second type (2).
delay_class 1 2

delay_parameters 1 -1/-1 -1/-1

delay_access 1 allow allowlist1

#Second delay class (2) of second type (2).
delay_class 2 2

delay_parameters 2 1000/5000 750/4000

delay_access 2 allow day
delay_access 2 deny !day
delay_access 2 allow denylist2

#EOF
-------------------
but this is affecting my local internet traffic, can you just tell me what might be the problem. i have feeling that the delay_parameters 2 1000/5000 750/4000 might worng i just dont know.
 
Old 05-19-2006, 10:41 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
What are you trying to do with the following items that I've highlighted in red?

Quote:
Originally Posted by nesargha
Thank u capt. caveman, i have made the following changes to my squid.conf file

-------------
acl allowlist1 url_regex -i 192.168

#We want to limit downloads of these type of files
#Put this all in one line
acl denylist2 url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt
.ram .rm .iso .raw .wav .mov


#limit bandwidth during the day
acl day time 09:00-23:59

delay_pools 2

#First delay class (1) of second type (2).
delay_class 1 2

delay_parameters 1 -1/-1 -1/-1

delay_access 1 allow allowlist1

#Second delay class (2) of second type (2).
delay_class 2 2

delay_parameters 2 1000/5000 750/4000

delay_access 2 allow day
delay_access 2 deny !day
delay_access 2 allow denylist2

#EOF
-------------------
but this is affecting my local internet traffic, can you just tell me what might be the problem. i have feeling that the delay_parameters 2 1000/5000 750/4000 might worng i just dont know.
I'm not at all a squid expert, but I believe what you are doing is throttling all daytime traffic to a horrendously slow rate and blocking all traffic after midnight. The only exception is that urls that contain 192.168. are allowed unlimited (so this would only apply to a local webserver on your lan (e.g http://192.168.0.1/foo). Could you explain what you are trying to do in more detail and maybe we can figure out a proper config.
 
Old 05-20-2006, 03:02 AM   #5
nesargha
Member
 
Registered: May 2006
Distribution: rhel 4, red hat 9, fedora core 2
Posts: 51

Original Poster
Rep: Reputation: 15
Smile

yeah,
basicaly the problem the people who are useing the internet in our network are slowing down the net by downloading the mp3 songs , movie files etc so , i wanted to made changes to squid config so that i can prevent these download and only allow the normal internet ie email , browse etc.

acl allowlist1 url_regex -i 192.168.100

here i am not allowing the the people to change the ip and at the same time allowing only those that come under the set and try to access ie. i have restricted the connections other than those comming in the list.

delay_parameters 1 -1/-1 -1/-1

delay_access 1 allow allowlist1


the above tell the squid donot give any slower bandwidth to this alowlist1
the following line

delay_class 2 2
delay_parameters 2 1000/5000 750/4000


the above tells the squid to give slower bandwidth to the file download not actually blocking but reduse the speed when the try to download these file

but the problem i dont know if my config is corret or any other way is there to do so
 
Old 05-20-2006, 08:10 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
acl allowlist1 url_regex -i 192.168.100

What this does is match any traffic going to a url that contains the string 192.168.100 (like http://192.168.100.5/foo or http://192.168.100.10/foo/bar/baz). It does *not* match traffic that comes from IP addresses 192.168.100 going to some other IP. The url_regex command simply pulls out regular expressions from the url request string. If you want to give unrestricted access to IPs in 192.168.100.X then just use the src match:

acl allowlist1 src 192.168.100.0/24
 
  


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
SQUID for blocking yahoo and msn [inc squid.conf] chrisfirestar Linux - Security 10 03-03-2008 08:33 AM
New user: Cannot find a working link to download redhat 9 anywhere! ariatablue Red Hat 7 03-08-2006 09:54 AM
LXer: Phishing for Open Proxies: Baby Squid Hooked In Under 18 Hours LXer Syndicated Linux News 0 01-26-2006 12:46 PM
Squid -- how can i deny download during working hours -- please help b:z Linux - Networking 1 05-05-2005 10:31 PM
Restricting Download based on total download using Squid,SARG& Webmin jomy Linux - Networking 0 04-27-2005 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:19 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration