Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using Squid and Squid-Guard

Posted on 2004-08-09
4
Medium Priority
?
1,396 Views
Last Modified: 2007-12-19
I am preparing to upgrade our Linux firewall/cache.

I have decided to continue to use the most excellent Squid for caching.
I have also decided to try and use squidGuard as the standard redirector,
since it seems well supported.

Now for the problem.  I have the need to modify the rules in squidGuard to act
differently when the requests are coming in from a different source
port.

For example, if requests are coming from 3128 I want to
filter porn, adult, ads, and limit to approved sites only.
If requests are coming from 3129 I want to filter porn,
adult, ads, and allow everything else.

After hours of looking at config files, FAQ's, and docs, I give up.  I
don't think it is possible.  Ideally, I would want to run one squid
and two squidguards.  The squid would call the appropriate squidauard
depending on the source request port.

Does anyone know if that is possible?
0
Comment
Question by:jballread
[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
  • 2
4 Comments
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 1000 total points
ID: 11757817
Unfortunately, I agree that the way that you want it to work with 1 squid and 2 squidguards is not trivial. I can't envisage how to get that concept to work at all! However, 2 squids and 2 squidguards is. You merely need to recompile your second squid to use a different config file, and rename it to be squid2....The /etc/init.d/squid would also need to be duplicated for the second squid.

HTH:)
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 11757825
Just a thought, I think that you will probably be unable to use the same cache for the 2 squids, as there could be some intermittent problems if both try to access the same cache at the same time. This would impact slightly on performance.
0
 
LVL 1

Accepted Solution

by:
bluelip earned 1000 total points
ID: 11772852
squidguard is only able to designate rules based on ip address not what port the request comes into squid on.

The first condition looks like you want to function like a whitelist whereas the second would be a blacjlist.

This can be accomplished by segregating the network in subnets nets and by doing the whitelist processing with ACL's in squid.conf while doing the blacklists with squidguard.conf

Whitelisting is gone over in the squid docs.

To do the blacklisting, look at example 3 in the squidguard config examples.



Example 3 - Blocking the access for unknown or unprivileged clients:

     logdir /usr/local/squidGuard/log
     dbhome /usr/local/squidGuard/db

     src privileged {
       ip      10.0.0.1 10.0.0.73 10.0.0.233      # ONE OF single clients
       ip      10.0.0.10-10.0.0.20            # OR WITHIN range 10.0.0.10 - 10.0.0.20
       ip      10.0.1.32/27                  # OR WITHIN range 10.0.1.32 - 10.0.1.63
       ip      10.0.2.0/255.255.255.0            # OR WITHIN range 10.0.2.0  - 10.0.2.255
                                    # AND
       domain foo.bar                        # MATCH foo.bar. OR *.foo.bar.
     }

     acl {
       privileged {
           pass all
       }

       default {
           pass none
           redirect http://info.foo.bar/cgi/blocked?clientaddr=%a&clientname=%n&clientuser=%i&clientgroup=%s&url=%u
       }
     }
   




If you provide more details, these instructions can be customized to your situation.


bluelip
0
 

Author Comment

by:jballread
ID: 11898534
Thank you for your help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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