Solved

Using Squid and Squid-Guard

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

​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…
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 …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now