# ufdbGuard.conf - default configuration file for use with ufdbguardd 1.31-13
#
# Make sure that you edit the 4 lines that are marked with
# 'EDIT THE NEXT LINE...' to adapt this file to your environment.

## EDIT THE NEXT LINE FOR LOCAL CONFIGURATION:
# administrator "<a href=%22 mailto:support@mydomain.com %22> the support desk </a>"
dbhome "/var/smoothwall/ufdbguard/blacklists"
logdir "/var/log/ufdbGuard"

# port 3977
# interface "all"	# only used for TCP sockets

# write which URLs are blocked into the logfile:
logblock off
# valid options are "off" and "on"

# write which URLs are passed into the logfile:
logpass off
# valid options are "off" and "on"

# write all URLs into the logfile:
logall off
# valid options are "off" and "on"

# The redirector interface of Squid has been changed since Squid 3.4
# and hence it is required to set the Squid version so that ufdbguardd
# communicates with Squid using the version-dependent protocol.
# valid version numbers are: 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 and 3.5
## EDIT THE NEXT LINE FOR LOCAL CONFIGURATION:
#squid-version "3.5"

# When a URL database is reloaded/updated, it is not possible to 
# perform URL lookups.  The next parameters defines what to respond
# to URL lookups during a database load (this typically takes 30 seconds);
# url-lookup-result-during-database-reload allow   - always send 
#   status "URL allowed" back to Squid (default)
# url-lookup-result-during-database-reload deny    - always send 
#   status "URL denied" back to Squid
url-lookup-result-during-database-reload allow
# and the same for when a fatal error occurs:
url-lookup-result-when-fatal-error allow

# when url-lookup-result-during-database-reload and/or 
# url-lookup-result-when-fatal-error is set to "deny", the browsers
# are redirected and display an appropriate message.
# To overrule these message, one can use the following two parameters:
# redirect-fatal-error      "http://www.example.com/fatalerror.html"
# redirect-loading-database "http://www.example.com/loadingdb.html"

# Analyse URLs for categorisation and future inclusion in the URL database:
# It is highly recommended to have this option "on". See the Reference Manual
# for details.
# analyse-uncategorised-urls on

## EDIT THE NEXT LINE FOR LOCAL CONFIGURATION:
check-proxy-tunnels queue-checks
# valid options for check-proxy-tunnels are
# off             no checks are performed
# queue-checks    checks are performed in the background
# aggressive      checks are performed immediately
# log-only        checks are performed in the background but tunnels are not blocked

# if adult sites must be blocked, then also the adult search results 
# of search engines must be blocked.
# NOTE: see the Reference Manual on how to set SafeSearch on a per-ACL basis.
safe-search on

# See the Reference Manual or YouTube help on how to request a edufilter ID.
youtube-edufilter    off
youtube-edufilter-id "ABCD1234567890abcdef"

# rotate the logfile when it reaches this size (200 MB default):
max-logfile-size  200000000

# supported platforms: Linux 2.6 
# See the Reference Manual for optimisation of the CPU caches.
############### cpus 2,3

# When "execuserlist" is used, refreshuserlist defines the interval in minutes
# for ufdbguardd to run the scripts defined by execuserlist.
# default:
# refreshuserlist 15

# When "execdomainlist" is used, refreshdomainlist defines the interval in minutes
# for ufdbguardd to run the scripts defined by execdomainlist.
# default:
# refreshdomainlist 15

# Use this if you want a local lightweight http server for the redirect messages.
### EDIT THE NEXT LINE FOR LOCAL CONFIGURATION:
# http-server { port = 8080, interface = all, images = /httpd/html/ui/img/ufdbguard }

# For monitoring purposes:
# external-status-command "/usr/bin/send-message-to-monitor-agent"
# mail-server "mail.example.com"
# admin-email "administrator@example.com"


# define the network that contain computer systems that need URL filtering
source allSystems {
   ### EDIT THE NEXT LINE FOR LOCAL CONFIGURATION:
   ip  10.0.0.0/8  
   ip 192.168.0.0/16
   ip 172.16.0.0/12
}

### EDIT THE NEXT LINES FOR LOCAL CONFIGURATION of positive exceptions :
### .../blacklists/alwaysallow/domains should contain domain names to be allowed
### uncomment the next 5 lines to use 'alwaysallow'.
# category alwaysallow {
#   domainlist        "alwaysallow/domains"
   #expressionlist  "alwaysallow/expressions"
#   redirect          http://10.2.2.1:81/URLblocked.cgi?admin=%A&color=orange&size=normal&clientaddr=%a&clientname=%n&clientuser=%i&clientgroup=%s&category=%t&url=%u
#}

### EDIT THE NEXT LINES FOR LOCAL CONFIGURATION of negative exceptions :
### .../blacklists/alwaysdeny/domains should contain domain names to be blocked
### uncomment the next 5 lines to use 'alwaysdeny'.
#category alwaysdeny {
#    domainlist        "alwaysdeny/domains"
    #expressionlist  "alwaysdeny/expressions"
#    redirect          "http://10.2.2.1:81/URLblocked.cgi?admin=%A&color=orange&size=normal&clientaddr=%a&clientname=%n&clientuser=%i&clientgroup=%s&category=%t&url=%u"
#}

# define the security category
category security {
   # domainlist      "security/domains"
   # expressionlist  "security/expressions"
   cacerts         "security/cacerts"
   option          enforce-https-with-hostname on
   option          enforce-https-official-certificate on
   option          https-prohibit-insecure-sslv2 on
   option 	   allow-aim-over-https on
   option 	   allow-gtalk-over-https on
   option 	   allow-skype-over-https on
   option 	   allow-yahoomsg-over-https on
   option 	   allow-fb-chat-over-https on
   option 	   allow-citrixonline-over-https on
   option 	   allow-unknown-protocol-over-https on
   redirect        "302:http://10.2.2.1:81/URLblocked.cgi?admin=%A&color=orange&size=normal&clientaddr=%a&clientname=%n&clientuser=%i&clientgroup=%s&category=%t&url=%u"
}
category adv {
    domainlist     adv/domains
    urllist        adv/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category aggression {
    domainlist     aggression/domains
    urllist        aggression/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category alcohol {
    domainlist     alcohol/domains
    urllist        alcohol/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category alwaysallow {
    domainlist     alwaysallow/domains
    urllist        alwaysallow/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category alwaysdeny {
    domainlist     alwaysdeny/domains
    urllist        alwaysdeny/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category anonvpn {
    domainlist     anonvpn/domains
    urllist        anonvpn/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category audio-video {
    domainlist     audio-video/domains
    urllist        audio-video/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category automobile_bikes {
    domainlist     automobile/bikes/domains
    urllist        automobile/bikes/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category automobile_boats {
    domainlist     automobile/boats/domains
    urllist        automobile/boats/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category automobile_cars {
    domainlist     automobile/cars/domains
    urllist        automobile/cars/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category automobile_planes {
    domainlist     automobile/planes/domains
    urllist        automobile/planes/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category chat {
    domainlist     chat/domains
    urllist        chat/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category costtraps {
    domainlist     costtraps/domains
    urllist        costtraps/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category dating {
    domainlist     dating/domains
    urllist        dating/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category downloads {
    domainlist     downloads/domains
    urllist        downloads/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category drugs {
    domainlist     drugs/domains
    urllist        drugs/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category dynamic {
    domainlist     dynamic/domains
    urllist        dynamic/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category education_schools {
    domainlist     education/schools/domains
    urllist        education/schools/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category entertainment {
    domainlist     entertainment/domains
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category finance_banking {
    domainlist     finance/banking/domains
    urllist        finance/banking/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category finance_insurance {
    domainlist     finance/insurance/domains
    urllist        finance/insurance/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category finance_moneylending {
    domainlist     finance/moneylending/domains
    urllist        finance/moneylending/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category finance_other {
    domainlist     finance/other/domains
    urllist        finance/other/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category finance_realestate {
    domainlist     finance/realestate/domains
    urllist        finance/realestate/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category finance_trading {
    domainlist     finance/trading/domains
    urllist        finance/trading/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category fortunetelling {
    domainlist     fortunetelling/domains
    urllist        fortunetelling/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category forum {
    domainlist     forum/domains
    urllist        forum/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category gamble {
    domainlist     gamble/domains
    urllist        gamble/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category gambling {
    domainlist     gambling/domains
    urllist        gambling/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category government {
    domainlist     government/domains
    urllist        government/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hacking {
    domainlist     hacking/domains
    urllist        hacking/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hobby_cooking {
    domainlist     hobby/cooking/domains
    urllist        hobby/cooking/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hobby_games-misc {
    domainlist     hobby/games-misc/domains
    urllist        hobby/games-misc/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hobby_games-online {
    domainlist     hobby/games-online/domains
    urllist        hobby/games-online/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hobby_gardening {
    domainlist     hobby/gardening/domains
    urllist        hobby/gardening/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hobby_pets {
    domainlist     hobby/pets/domains
    urllist        hobby/pets/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category homestyle {
    domainlist     homestyle/domains
    urllist        homestyle/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category hospitals {
    domainlist     hospitals/domains
    urllist        hospitals/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category imagehosting {
    domainlist     imagehosting/domains
    urllist        imagehosting/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category ipv6 {
    domainlist     ipv6/domains
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category isp {
    domainlist     isp/domains
    urllist        isp/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category jobsearch {
    domainlist     jobsearch/domains
    urllist        jobsearch/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category known {
    domainlist     known/domains
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category library {
    domainlist     library/domains
    urllist        library/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category mail {
    domainlist     mail/domains
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category military {
    domainlist     military/domains
    urllist        military/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category models {
    domainlist     models/domains
    urllist        models/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category movies {
    domainlist     movies/domains
    urllist        movies/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category music {
    domainlist     music/domains
    urllist        music/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category mylist {
    domainlist     mylist/domains
    urllist        mylist/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category news {
    domainlist     news/domains
    urllist        news/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category podcasts {
    domainlist     podcasts/domains
    urllist        podcasts/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category politics {
    domainlist     politics/domains
    urllist        politics/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category porn {
    domainlist     porn/domains
    urllist        porn/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category proxies {
    domainlist     proxies/domains
    urllist        proxies/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category radiotv {
    domainlist     radiotv/domains
    urllist        radiotv/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category recreation_humor {
    domainlist     recreation/humor/domains
    urllist        recreation/humor/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category recreation_martialarts {
    domainlist     recreation/martialarts/domains
    urllist        recreation/martialarts/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category recreation_restaurants {
    domainlist     recreation/restaurants/domains
    urllist        recreation/restaurants/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category recreation_sports {
    domainlist     recreation/sports/domains
    urllist        recreation/sports/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category recreation_travel {
    domainlist     recreation/travel/domains
    urllist        recreation/travel/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category recreation_wellness {
    domainlist     recreation/wellness/domains
    urllist        recreation/wellness/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category redirector {
    domainlist     redirector/domains
    urllist        redirector/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category religion {
    domainlist     religion/domains
    urllist        religion/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category remotecontrol {
    domainlist     remotecontrol/domains
    urllist        remotecontrol/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category ringtones {
    domainlist     ringtones/domains
    urllist        ringtones/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category science_astronomy {
    domainlist     science/astronomy/domains
    urllist        science/astronomy/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category science_chemistry {
    domainlist     science/chemistry/domains
    urllist        science/chemistry/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category searchengines {
    domainlist     searchengines/domains
    urllist        searchengines/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category sex_education {
    domainlist     sex/education/domains
    urllist        sex/education/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category sex_lingerie {
    domainlist     sex/lingerie/domains
    urllist        sex/lingerie/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category shopping {
    domainlist     shopping/domains
    urllist        shopping/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category socialnet {
    domainlist     socialnet/domains
    urllist        socialnet/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category spyware {
    domainlist     spyware/domains
    urllist        spyware/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category tracker {
    domainlist     tracker/domains
    urllist        tracker/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category updatesites {
    domainlist     updatesites/domains
    urllist        updatesites/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category urlshortener {
    domainlist     urlshortener/domains
    urllist        urlshortener/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category violence {
    domainlist     violence/domains
    urllist        violence/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category warez {
    domainlist     warez/domains
    urllist        warez/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category weapons {
    domainlist     weapons/domains
    urllist        weapons/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category webmail {
    domainlist     webmail/domains
    urllist        webmail/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category webphone {
    domainlist     webphone/domains
    urllist        webphone/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category webradio {
    domainlist     webradio/domains
    urllist        webradio/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category webtv {
    domainlist     webtv/domains
    urllist        webtv/urls
    redirect       http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
}

category files {
    expressionlist custom/blocked/files
}

category custom-allowed {
    domainlist     custom/allowed/domains
    urllist        custom/allowed/urls
}

category custom-blocked {
    domainlist     custom/blocked/domains
    urllist        custom/blocked/urls
}

category custom-expressions {
    expressionlist custom/blocked/expressions
}

acl {
    allSystems {
        pass !security !alcohol !alwaysdeny !drugs !finance_moneylending !gambling !hacking !porn any
}
   ### the next acl is a mandatory fallback for all other cases.
   ### do NOT remove this ACL.
   default {
      ### NOTE: depending on the other ACLs, "pass none" may be more appropriate to use
      ### EDIT THE NEXT LINE FOR LOCAL CONFIGURATION:
      pass !security 
           !alwaysdeny
           !porn 
	   !warez 
	   !gambling !violence !drugs
	   #!extappl
	   !dating !jobsearch !shopping !webmail
	   chat news
	   forum 
	   audio-video
	   adv
	   any

	   redirect http://10.2.2.1:81/redirect.cgi?category=%t&url=%u&ip=%a
    }
}
