Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

squid

Posted on 2011-03-08
10
Medium Priority
?
781 Views
Last Modified: 2012-05-11
i have squid running on a fedora box. i want to make an entry in the squid.conf to allow everything and then have a block list - so kind of the opposite of what i currently have - for example one of my entries looks like this.

# walkup kiosk
acl blockedsites src 172.16.26.100
acl oksites dstdomain "/etc/squid/allowedsites.acl"
http_access allow blockedsites oksites

I'm just not sure what the syntax would be. any ideas?
0
Comment
Question by:JeffBeall
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 22

Expert Comment

by:robocat
ID: 35071833

http_access deny blockedsites
http_access allow all

(the order of these is important, first block specific things, then allow the rest)

0
 
LVL 79

Accepted Solution

by:
arnold earned 668 total points
ID: 35071881
Could you clarify what you are doing?
Is this a reverse proxy configuration?
I.e. you have the squid proxy listening on port 80 as though it is a web server and then passes the requests to the real web server? And what you want to do is control based on the source of the request what sites they can and can not access?

If you allow first, the deny is never seen/checked within squid.
The rule flow is top down,
check match (allow/deny) fallthrough if no match, enforce the action
check match (allow/deny) fallthrough
acl oksites url_regex -i "/etc/squid/allowedsites" #where the allowedsites are a domain per line
allowdomain1.com
allowdomain2.com


the format of the rule would be
http_access allow oksites source_of_request
http_access deny oksites
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 35072937
this sounds like what i want, but in the following

http_access deny blockedsites
http_access allow all

after deny - would i have to tell squid where blockedsites is? I mean isn't blockedsites a list? do i need to begin these line with acl?
also, how could i use the above command on a block of ip's?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 79

Expert Comment

by:arnold
ID: 35073063
The problem is that you have defined blockedsites as a network IP.
acl blockedsites src 172.116.26.100
you can deny it access while allowing all else
http_access deny blockedsites
http_access allow  all


Double check what it is you want to block and to where.

0
 
LVL 1

Author Comment

by:JeffBeall
ID: 35073270
" The problem is that you have defined blockedsites as a network IP."

i am new to squid - and the vast majority of my entries in squid.conf is the result of google. so if that entry isn't correct i have no problem removing it.
mostly i want to allow access to everything but a list of blocked sites - i would like a list so that as needed i could just add to the list and restart the squid service.
0
 
LVL 22

Expert Comment

by:robocat
ID: 35073471

Suppose you want to block access to facebook and youtube:

acl blockedsites dstdomain .facebook.com .youtube.com

or

acl blockedsites dstdomain "/etc/squid/blockedsites.txt"

and put the forbidden sites in that text file.

0
 
LVL 1

Author Comment

by:JeffBeall
ID: 35073645
so it would be

acl blockedsites dstdomain "/etc/squid/blockedsites.txt"
http_access allow all

?
0
 
LVL 22

Assisted Solution

by:robocat
robocat earned 668 total points
ID: 35074359

acl blockedsites dstdomain "/etc/squid/blockedsites.txt"
http_access deny blockedsites
http_access allow all
0
 
LVL 12

Assisted Solution

by:mccracky
mccracky earned 664 total points
ID: 35084117
Just remember that you would need to have squid reread the configuration if you wanted to add sites to the "/etc/squid/blockedsites.txt" file (squid -k reconfigure).  It wouldn't be automatically reread.  
0
 
LVL 1

Author Closing Comment

by:JeffBeall
ID: 35084482
thank you! this worked perfectly.
0

Featured Post

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
What we learned in Webroot's webinar on multi-vector protection.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question