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
Solved

Using Squid and Squid-Guard

Posted on 2004-08-09
4
1,391 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 250 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 250 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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