?
Solved

Using Squid and Squid-Guard

Posted on 2004-08-09
4
Medium Priority
?
1,400 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
  • 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

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Question has a verified solution.

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

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…
Fine Tune your automatic Updates for Ubuntu / Debian
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

862 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