LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-04-2010, 07:16 AM   #1
makadam
LQ Newbie
 
Registered: May 2010
Posts: 6

Rep: Reputation: 0
Squid configuration file


Hi

Please someone help me with this squid conf file.
I'am trying to block websites and specific extensions for all user except for one ip.This is my confuiguration.
everything works fine but vip client with allowed ip is also blocked.


http_port 80
cache_mgr Administrator@proxy
visible_hostname proxy
cache_dir ufs c:/squid/var/cache 512 16 256
acl Query urlpath_regex cgi-bin \?
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl PURGE method PURGE
acl to_localhost dst 127.0.0.1/8
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443
acl CONNECT method CONNECT
acl localnetwork0 src 127.0.0.0/8
acl localnetwork1 src 192.168.5.0/24



acl VIP src 192.168.121.80

acl forbiden_pages dstdomain "C:/squid/etc/blocked-sites.txt"

acl forbiden_extensions url_regex -i "C:/squid/etc/blocked-files.txt"


hierarchy_stoplist cgi-bin ?
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
coredump_dir c:/squid/var/cache

cache_mem 64 MB
dns_testnames localhost

http_access allow VIP forbiden_pages
http_access allow VIP forbiden_extensions
http_access deny forbiden_pages all
http_access deny forbiden_extensions all

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow PURGE localhost
http_access deny PURGE
http_access allow localnetwork0
http_access allow localnetwork1
no_cache deny QUERY
http_access deny all
http_reply_access allow all
icp_access deny all

Thanks
 
Old 05-04-2010, 09:01 AM   #2
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Rep: Reputation: 18
I cant test this now but try
Quote:
http_access allow forbiden_pages VIP
http_access allow forbiden_extensions VIP
instead
Quote:
http_access allow VIP forbiden_pages
http_access allow VIP forbiden_extensions
or just
Quote:
http_access allow VIP

Last edited by markotitel; 05-04-2010 at 09:04 AM.
 
Old 05-06-2010, 04:03 AM   #3
makadam
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markotitel View Post
I cant test this now but try


instead


or just
Thanks for fast reply but I try your new conf but it doesn't work.I really don't know what is the problem!

Please help me with this configuaration!
Thanks
 
Old 05-06-2010, 05:26 AM   #4
Lexus45
Member
 
Registered: Jan 2010
Distribution: Debian, Centos, Ubuntu, Slackware
Posts: 361
Blog Entries: 3

Rep: Reputation: 48
maybe it's a silly question, but have you restarted squid before using a new config file ?

You may also use
Code:
squid -k reconfigure
instead of killing the process.
 
Old 05-06-2010, 06:38 AM   #5
makadam
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Yes I always restart squiid after every change is made.
Quote:
Computer with IP 192.168.121.80 still have no access to forbiden pages.Machine that runs squid has IP 192.168.5.10 with gateway 192.168.5.1
With this configuration every computer doesn't have access to forbiden pages and forbiden extensions.
 
Old 05-10-2010, 05:37 AM   #6
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Rep: Reputation: 18
can you post your forbidden pages acls
 
Old 05-10-2010, 06:16 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
I usually put allow lists at the top for complete access.

http_access allow VIP

at the top of the area.
 
Old 05-11-2010, 04:02 PM   #8
makadam
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Forbiden-pages txt file:
Quote:
.youtube.com
.pornhub.com
.facebook.com
But it works for all other user exept for my pc.I still have no access to forbidden pages!!
 
Old 05-11-2010, 04:09 PM   #9
makadam
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by linuxlover.chaitanya View Post
I usually put allow lists at the top for complete access.

http_access allow VIP

at the top of the area.
I try that with no success



http_port 80
cache_mgr Administrator@proxy
visible_hostname proxy
cache_dir ufs c:/squid/var/cache 512 16 256
acl Query urlpath_regex cgi-bin \?
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl PURGE method PURGE
acl to_localhost dst 127.0.0.1/8
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443
acl CONNECT method CONNECT
acl localnetwork0 src 127.0.0.0/8
acl localnetwork1 src 192.168.5.0/24



acl VIP src 192.168.121.80

acl forbiden_pages dstdomain "C:/squid/etc/blocked-sites.txt"

acl forbiden_extensions url_regex -i "C:/squid/etc/blocked-files.txt"


hierarchy_stoplist cgi-bin ?
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
coredump_dir c:/squid/var/cache

cache_mem 64 MB
dns_testnames localhost

Quote:
http_access allow VIP
http_access deny forbiden_pages all
http_access deny forbiden_extensions all

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow PURGE localhost
http_access deny PURGE
http_access allow localnetwork0
http_access allow localnetwork1
no_cache deny QUERY
http_access deny all
http_reply_access allow all
icp_access deny all

Thanks
 
Old 05-11-2010, 07:35 PM   #10
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Rep: Reputation: 18
Maybe it is because ACL ALL src 0.0.0.0.0/0.0.0.0. I cant figure out neither what can be the problem. Maybe ICP ACCESS try to remove it. i dont know.

Hm, Is your comp behind NAT? I see you have IP from different range. post your IP configuration.

Last edited by markotitel; 05-11-2010 at 07:38 PM.
 
Old 05-12-2010, 05:14 AM   #11
mkp
Member
 
Registered: Jul 2008
Posts: 57

Rep: Reputation: 15
Quote:
Originally Posted by makadam View Post
I try that with no success



http_port 80
cache_mgr Administrator@proxy
visible_hostname proxy
cache_dir ufs c:/squid/var/cache 512 16 256
acl Query urlpath_regex cgi-bin \?
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl PURGE method PURGE
acl to_localhost dst 127.0.0.1/8
acl SSL_ports port 443 563
acl Safe_ports port 80 21 443
acl CONNECT method CONNECT
acl localnetwork0 src 127.0.0.0/8
acl localnetwork1 src 192.168.0.0/16



acl VIP src 192.168.121.80

acl forbiden_pages dstdomain "C:/squid/etc/blocked-sites.txt"

acl forbiden_extensions url_regex -i "C:/squid/etc/blocked-files.txt"


hierarchy_stoplist cgi-bin ?
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
coredump_dir c:/squid/var/cache

cache_mem 64 MB
dns_testnames localhost


http_access allow VIP
http_access deny forbiden_pages
http_access deny forbiden_extensions
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow PURGE localhost
http_access deny PURGE
http_access allow localnetwork0
http_access allow localnetwork1
no_cache deny QUERY
http_access deny all
http_reply_access allow all
icp_access deny all

Thanks
Try this.
 
Old 05-14-2010, 06:47 AM   #12
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 181

Rep: Reputation: 18
Oh /24 i think this is it, but interesting thing, makadam sad eveything worked. HM deny all and his IP could browe everything but forbidden acl. Maybe it is NAT after all. So his ip is form 192.168.5.0/24 range.

Last edited by markotitel; 05-14-2010 at 06:57 AM.
 
  


Reply



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
Help with Squid Configuration greenepenguin Linux - Networking 3 09-11-2009 10:58 PM
Problem with configuration of Squid server behind a squid ajitup Linux - Server 13 08-12-2009 10:55 PM
squid configuration spsinghs Linux - Networking 1 03-02-2006 03:07 AM
Squid: special configuration for remote Squid server hamish Linux - Software 0 12-06-2005 03:58 PM
configuration of squid.conf file for fedore core 3 raju_dhakar2002 Linux - Networking 3 04-20-2005 10:25 PM

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

All times are GMT -5. The time now is 07:27 AM.

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