OPNsense Forum

English Forums => Development and Code Review => Topic started by: juliocbc on September 11, 2020, 02:27:29 AM

Title: SquidGuard - new plugin
Post by: juliocbc on September 11, 2020, 02:27:29 AM
SquidGuard based plugin.

Features:
User based rules;
Block websites based on categories;
Custom block pages;
RegEx based rules;
Install and usage:
Logged as root run: #curl https://community.cloudfence.com.br/webfilter/setup.sh -o /tmp/setup.sh ; sh /tmp/setup.sh

Alternative download link:

curl https://raw.githubusercontent.com/cloudfence/dev-packages/master/squidGuard-plugin-install.sh -o /tmp/setup.sh ; sh /tmp/setup.sh

After installed, you will need to download a squidGuard compatible blacklist:

Ex.: https://docs.opnsense.org/manual/how-tos/proxywebfilter.html (Step 2 / UT1 category based list)

1-On the WebUI go to: Services: Web Filter: General

2-Set it in the Blacklist Categories URL

3-Click in the Download Button: The download and build database process can take several minutes (depending on the hardware)

4-Enable Web Filter & click Apply

5-Managing rules: https://wiki.cloudfence.com.br/english/managing-rules

TODO
-Port the log viewer to the new OPNsense MVC standard

-Reset blacklist (remove and install it again)

-Multiple blacklists (maybe performance issues with - a lot testing needed!)

-Add groups support in rules; (port from Cloudfence plugin)

-Better frontend integration with Squid native (a.k.a WebProxy)

-Add custom rules to squid (bandwith controls, mime-types based rules, etc)

-Improve Frontend features and capabilities; (with community help!)

-Improve Documentation

-Beautify the code ;-) (I'm not a frontend guy, so please, be kind!)

PR: https://github.com/opnsense/plugins/pull/2026
Title: Re: SquidGuard - new plugin
Post by: Raxid on September 29, 2020, 11:25:36 AM
Hi Julio,

As discussed on email please find required logs.
Currently i had squid configured transparent.
I want to use squid Guard with squid to configure policy based rules i.e Block all websites except google.com and facebook and also allow all websites and block specific websites based on IP's.
Title: Re: SquidGuard - new plugin
Post by: juliocbc on September 29, 2020, 02:23:21 PM
Hi Raxid!

Seems that your blacklist database is not loading. 

Try the following (CLI):

configctl webfilter updatewfdb

This will fetch and build the blacklist WebUI. (set it on WebUI).

how to: https://forum.opnsense.org/index.php?topic=19084.0 (https://forum.opnsense.org/index.php?topic=19084.0)

Title: Re: SquidGuard - new plugin
Post by: Raxid on September 29, 2020, 03:44:59 PM
Hi Julio,

I had run the command in shell as root but still the error "No blacklist categories database found" not resolved.
Screenshot attached.

Title: Re: SquidGuard - new plugin
Post by: juliocbc on September 29, 2020, 05:10:56 PM
How is this configured?

2-Set it in the Blacklist Categories URL
Title: Re: SquidGuard - new plugin
Post by: Raxid on September 29, 2020, 07:00:42 PM
Hi Julio,

Still after setting in the Blacklist Categories URL error still exist ,Further i am using Shallist .
Is this ok with the Blacklist?
Title: Re: SquidGuard - new plugin
Post by: juliocbc on September 29, 2020, 10:15:37 PM
Please try with this: ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz (http://ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz)
Title: Re: SquidGuard - new plugin
Post by: Raxid on October 02, 2020, 12:36:44 PM
Hi,

I had tried the provided blacklist but still the attached error occurs and squid guard not works.
Title: Re: SquidGuard - new plugin
Post by: juliocbc on October 02, 2020, 06:55:07 PM
Raxid,

If you try to download this link in your desktop, is it working?
Title: Re: SquidGuard - new plugin
Post by: Raxid on October 05, 2020, 10:00:03 AM
Hi Julio,

The link not works even on desktop.
Title: Re: SquidGuard - new plugin
Post by: juliocbc on October 05, 2020, 02:00:32 PM
Hi Raxid,

Maybe you will need a proxy to bypass some geoip blocks.
Title: Re: SquidGuard - new plugin
Post by: Raxid on October 05, 2020, 06:43:31 PM
Hi Julio,

Can you please guide me hw to add proxy in Opnsense to bypass geoip blocks?