Changes

From SME Server
Jump to navigationJump to search
6,209 bytes added ,  23:23, 10 December 2018
Correct path error /dguardianurlipc to /tmp/.dguardianurlipc
Line 1: Line 1:  +
{{Languages}}
 
== Dansguardian web content filtering ==
 
== Dansguardian web content filtering ==
 +
{{Level|Medium}}
 +
 +
=== Version ===
 +
{{ #smeversion: dansguardian}}
 +
{{ #smeversion: smeserver-dansguardian}}
    
=== Description ===
 
=== Description ===
Line 27: Line 33:  
===Installation instructions===
 
===Installation instructions===
   −
{{Warning box|Do not upgrade dansguardian v2.9 over previous v2.8 (or earlier) installations as there are substantial changes. (The recommendation from Dansguardian is to edit the new configuration files/lists rather than try to edit your old ones)}}
+
Install dansguardian and it's dependencies from the smecontribs repository
 +
yum --enablerepo=smecontribs install smeserver-dansguardian
   −
{{Note box|Please check the dungog.net web site for later versions http://sme.dungog.net/packages/smeserver/7.0/i386/html/index_dungog.html}}
+
Optional, download and install a set of blacklists from http://urlblacklist.com/
 +
alternatively you can choose ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz from http://dsi.ut-capitole.fr/blacklists/
   −
Download the required rpms into an empty folder on your sme server using the Linux wget command
+
{{Note box|It is not sufficient to simply install the package, the appropriate manual configuration is an integral part of getting Dansguardian working on your system. A minimal installation requires all the configuration steps listed below to be carried out, ie from the "Modifying Firewall and Proxy" section up to "Filter Groups and Auth login". Filter Group configuration is only required if you wish to control access on a per user basis.}}
 +
 +
{{Tip box|If you would like to have a graphical and web based overview of what dansguardian has analyzed then take a look at http://wiki.contribs.org/Dansguardian-stats}}
   −
wget <nowiki>http://mirror.contribs.org/smeserver/contribs/rmitchell/smeserver/contribs/dansguardian/rpms/2.9.8-2/dansguardian-2.9.8-2.noarch.rpm</nowiki>
+
====Upgrading====
wget <nowiki>http://mirror.contribs.org/smeserver/contribs/rmitchell/smeserver/contribs/dansguardian/rpms/2.9.8-2/smeserver-dansguardian-2.9-3.el4.sme.noarch.rpm</nowiki>
+
There are substantial changes between dansguardian v2.9 over previous v2.8 (or earlier) installations. The recommendation from dansguardian.org is to edit the new configuration files/lists rather than try to edit your old ones.
wget <nowiki>http://mirror.contribs.org/smeserver/contribs/rmitchell/smeserver/contribs/dansguardian/rpms/2.8.0.6/dungog-blacklists-1.0-20061002.noarch.rpm</nowiki>
  −
wget <nowiki>http://mirror.contribs.org/smeserver/contribs/rmitchell/smeserver/contribs/dansguardian/rpms/2.9.8-2/pcre-6.7-1.i386.rpm</nowiki>
     −
Install the rpms
+
Upgrading from 2.9 versions creates .rpmnew config files under /etc/dansguardian. This preserves your existing config files, but there is a chance that dansguardian won't start if parameters in the config file have changed.
yum localinstall *.rpm
     −
Alternatively you can add the dungog repository
+
Clamav libraries can cause problems when updating. If while updating you see something like
{{Repository|Dungog}}
+
Error: Missing Dependency: libclamav.so.3 is needed by package dansguardian
 +
Update with
 +
yum update --enablerepo=smecontribs dansguardian clamav
 +
then
 +
yum update
   −
Install dansguardian and it's dependencies
+
===Modifying Firewall and Proxy===
yum --enablerepo=dungog install smeserver-dansguardian dungog-blacklists
     −
To view available updates
+
====Configuring your system to force Dansguardian usage & prevent bypassing====
yum --enablerepo=dungog list updates
     −
===Modifying Firewall and Proxy===
+
These instructions assume that the sme server is running in server gateway mode and acting as the gateway for your network, and the squid proxy is running on the same machine that Dansguardian is running on.
   −
====Configuring your system to force Dansguardian usage & prevent bypassing====
+
If your server is configured in server only mode, then you will need to point your browser at that machine to find the squid proxy rather than the default gateway.
    
Dansguardian uses port 8080 for web proxy requests. If your browser does not use port 8080 then Dansguardian filtering will be bypassed. To force this usage & prevent users bypassing filtering you should do ALL the following steps:
 
Dansguardian uses port 8080 for web proxy requests. If your browser does not use port 8080 then Dansguardian filtering will be bypassed. To force this usage & prevent users bypassing filtering you should do ALL the following steps:
   −
'''1) Configure your sme server to use Transparent Proxy port 8080 and to block direct access to the squid proxy port 3128 & redirect port 80 to port 8080'''
+
'''1) Configure your SME Server to use Transparent Proxy port 8080 and to block direct access to the squid proxy port 3128 & redirect port 80 to port 8080'''
   −
Note the functionality to create the required custom firewall rules using iptables is built in to the smeserver-dansguardian and is configured with the following commands
+
Note the functionality to create the required custom firewall rules using iptables is built in to the smeserver-dansguardian and is configured with the following commands. The Transparent proxy must also be enabled (which is the sme default) to prevent users bypassing Dansguardian filtering.
    
  config setprop squid TransparentPort 8080
 
  config setprop squid TransparentPort 8080
 +
config setprop squid Transparent yes
 
  config setprop dansguardian portblocking yes
 
  config setprop dansguardian portblocking yes
 
  signal-event post-upgrade; signal-event reboot
 
  signal-event post-upgrade; signal-event reboot
   −
To return Transparent Proxy port to default value and to disable portblocking
+
To return Transparent Proxy port to default value and to disable portblocking and to enable the Transparent proxy (which is the sme default)
   −
  config delprop squid TransparentPort 3128
+
  config setprop squid TransparentPort 3128
 +
config setprop squid Transparent yes
 
  config delprop dansguardian portblocking
 
  config delprop dansguardian portblocking
 
  signal-event post-upgrade; signal-event reboot  
 
  signal-event post-upgrade; signal-event reboot  
 +
 +
{{Note box|If you disable the Transparent Proxy feature of SME Server, Dansguardian can be bypassed at will by your users. You should keep the Transparent Proxy enabled (configured as above) for filtering to work.}}
 
   
 
   
 
'''2) Configure your workstation web browser to auto detect proxy port'''
 
'''2) Configure your workstation web browser to auto detect proxy port'''
Line 79: Line 92:     
Or alternatively use the server IP 192.168.1.1 (or whatever yours is) and use a port of 8080
 
Or alternatively use the server IP 192.168.1.1 (or whatever yours is) and use a port of 8080
 +
 +
====Bypass Proxy====
 +
Allow individual PC's or selected sites to bypass the proxy (and dansguardian) entirely see [[Firewall#Bypass_Proxy]].
 +
 +
====Workstation IP allocation====
 +
Control of workstation access to the web (when using dansguardian), is implemented by nominating the workstation IP in the various dansguardian configuration files (ie the local LAN IP address). To apply consistent filtering rules or allow proxy bypass (see section above), the workstation IP must remain the same throughout restarts & DHCP IP refreshes or allocations. Configuring your workstations to have a consistent IP is a fundamental & important step when configuring your whole computer system.
 +
 +
This can be achieved by manually specifying a fixed IP address when each workstation is configured, but requires every workstation to be setup individually. Alternatively the workstation can be configured for auto allocation of an IP, and the Hostnames and Addresses panel in server manager can then be used to force the allocation of a specified IP by the SME DHCP server, based on the workstation NIC mac address. See the SME Manual for further details at http://wiki.contribs.org/SME_Server:Documentation:Administration_Manual:Chapter13#Reserving_IP_Addresses_Through_DHCP
 +
The basic steps are to determine the mac address of your workstation NIC and then create a hostname eg station5 and enter the mac address and the required "forced or fixed" IP eg 192.168.1.5
 +
 +
Any reference to the filtering of station5 then uses the IP 192.168.1.5, which will always stay the same, unless the NIC is changed. Remember to re-enter the mac address details into server manager, in the event the workstation NIC or motherboard is changed.
    
====Configuring Proxy to use Auth login====
 
====Configuring Proxy to use Auth login====
Line 128: Line 152:  
* '''TCP'''
 
* '''TCP'''
   −
===Modifying Dansguardian configuration===
+
===Modifying Dansguardian Configuration Files===
 +
 
 +
====Modifying Dansguardian dansguardian.conf & dansguardianf1.conf files====
    
You need to manually modify various configuration files.
 
You need to manually modify various configuration files.
Line 161: Line 187:  
  Ctrl x
 
  Ctrl x
    +
Additional Options can be found here, http://wiki.contribs.org/Dansguardian/ConfigFiles under the topic dansguardian.conf & dansguardianf1.conf
    
If you have additional filter groups, then additional configuration files will need to be created and modified. See section on "Filter Groups and Auth login" below.
 
If you have additional filter groups, then additional configuration files will need to be created and modified. See section on "Filter Groups and Auth login" below.
      
====Modifying other Dansguardian configuration files====
 
====Modifying other Dansguardian configuration files====
Line 173: Line 199:  
These are located in  
 
These are located in  
 
  /etc/dansguardian/lists...   
 
  /etc/dansguardian/lists...   
  /etc/dansguardian/lists/f1/...   
+
  /etc/dansguardian/lists/f2/...   
 
& so on and subfolders  
 
& so on and subfolders  
    
eg
 
eg
  pico -w /etc/dansguardian/lists/f1/bannedextensionlist
+
  pico -w /etc/dansguardian/lists/f2/bannedextensionlist
 
make the required changes
 
make the required changes
 
  Ctrl o
 
  Ctrl o
Line 190: Line 216:  
You should review ALL the dansguardian config files in /etc/dansguardian/lists and subfolders  as part of your initial Dansguardian setup.  
 
You should review ALL the dansguardian config files in /etc/dansguardian/lists and subfolders  as part of your initial Dansguardian setup.  
   −
Some of the default settings in these files will prevent access to certain web sites and file types, which may conflict with your site requirements. See more details on the [[:Dansguardian/ConfigFiles]]  page of this Howto or at http://dansguardian.org
+
Some of the default settings in these files will prevent access to certain web sites and file types, which may conflict with your site requirements.  
    +
For many more details and descriptions on the configuration files see [[:Dansguardian/ConfigFiles]]  page of this Howto or at http://dansguardian.org
    
====Modifying the default html error message page====
 
====Modifying the default html error message page====
Line 197: Line 224:  
You may also want to tailor the html template for the error message displayed when Dansguardian blocks a site, see
 
You may also want to tailor the html template for the error message displayed when Dansguardian blocks a site, see
 
  /etc/dansguardian/languages/(languagename)/template.html
 
  /etc/dansguardian/languages/(languagename)/template.html
eg
+
or in some newer versions
 +
/usr/share/dansguardian/languages/(languagename)/template.html
 +
 
 +
e.g.
 
  pico -w /etc/dansguardian/languages/ukenglish/template.html
 
  pico -w /etc/dansguardian/languages/ukenglish/template.html
 
+
After you make any changes to the template.html you will need to run the command,
 +
/etc/init.d/dansguardian restart
 +
for the changes to take effect.
    
====Filter Groups and Auth login====
 
====Filter Groups and Auth login====
Line 234: Line 266:     
When using Filter Groups, a typical situation may have:
 
When using Filter Groups, a typical situation may have:
  Filter Group 1 - standard users (standard access rights)
+
  Filter Group 1 - blocked users (no access) - See [http://contentfilter.futuragts.com/wiki/index.php?title=Group_Configuration#Typically_Set_Default_Group_.28f1.29_To_No_Web_Access_At_All]
  Filter Group 2 - blocked users (no access)
+
  Filter Group 2 - standard users (standard access rights)
 
  Filter Group 3 - guest users (limited access rights)
 
  Filter Group 3 - guest users (limited access rights)
 
  Filter Group 4 - power users (more generous access & file download rights)
 
  Filter Group 4 - power users (more generous access & file download rights)
Line 247: Line 279:  
  cp /etc/dansguardian/dansguardianf1.conf /etc/dansguardian/dansguardianf5.conf
 
  cp /etc/dansguardian/dansguardianf1.conf /etc/dansguardian/dansguardianf5.conf
   −
  cp -R /etc/dansguardian/lists/f1 /etc/dansguardian/lists/f2
+
Because the Filter Group 1 (default) uses the configuration files located at the root of "/lists" directory, it is only necessary to create the rest of the directories f2, f3, f4 and f5 to host the configuration files for each Filter Group.
  cp -R /etc/dansguardian/lists/f1 /etc/dansguardian/lists/f3
+
 
  cp -R /etc/dansguardian/lists/f1 /etc/dansguardian/lists/f4  
+
Each filter directory (f2, f3, etc.) will house all the configuration files located at the root of "/lists" directory unless filtergroupslist, bannediplist and exceptioniplist, because they are not used for filtering because only they are called (logically) from the general configuration file dansguardian.conf.
  cp -R /etc/dansguardian/lists/f1 /etc/dansguardian/lists/f5
+
 
 +
Because the configuration files are modified, is a smart idea to create a "virgin" copy of the files and then use it to create new filters directory. This directory will named "virgin" or something similar.
 +
 
 +
mkdir -p /etc/dansguardian/lists/virgin
 +
cp /etc/dansguardian/lists/* /etc/dansguardian/lists/virgin
 +
rm -f /etc/dansguardian/lists/virgin/filtergroupslist
 +
rm -f /etc/dansguardian/lists/virgin/bannediplist
 +
rm -f /etc/dansguardian/lists/virgin/exceptioniplist
 +
  cp -R /etc/dansguardian/lists/virgin /etc/dansguardian/lists/f2
 +
  cp -R /etc/dansguardian/lists/virgin /etc/dansguardian/lists/f3
 +
  cp -R /etc/dansguardian/lists/virgin /etc/dansguardian/lists/f4
 +
  cp -R /etc/dansguardian/lists/virgin /etc/dansguardian/lists/f5
 
(which will include all subfolders and files)
 
(which will include all subfolders and files)
    
Then edit & save the various main configuration files
 
Then edit & save the various main configuration files
 
  pico -w /etc/dansguardian/dansguardianf2.conf
 
  pico -w /etc/dansguardian/dansguardianf2.conf
and change all instances of f1 to f2 in filename locations
+
and change all instances of /lists/ to /lists/f2/ in filename locations
       
  pico -w /etc/dansguardian/dansguardianf3.conf
 
  pico -w /etc/dansguardian/dansguardianf3.conf
and change all instances of f1 to f3 in filename locations
+
and change all instances of /lists/ to /lists/f3/ in filename locations
       
  pico -w /etc/dansguardian/dansguardianf4.conf
 
  pico -w /etc/dansguardian/dansguardianf4.conf
and change all instances of f1 to f4 in filename locations
+
and change all instances of /lists/ to /lists/f4/ in filename locations
       
  pico -w /etc/dansguardian/dansguardianf5.conf
 
  pico -w /etc/dansguardian/dansguardianf5.conf
and change all instances of f1 to f5 in filename locations
+
and change all instances of /lists/ to /lists/f5/ in filename locations
      Line 288: Line 331:  
Configure the following settings as shown
 
Configure the following settings as shown
 
  #Filter group mode
 
  #Filter group mode
  groupmode = 1
+
  groupmode = 0
    
  #Filter group name
 
  #Filter group name
  groupname = 'Standard Users'
+
  groupname = 'Blocked Users'
      Line 299: Line 342:  
Configure the following settings as shown   
 
Configure the following settings as shown   
 
  #Filter group mode
 
  #Filter group mode
  groupmode = 0
+
  groupmode = 1
    
  #Filter group name
 
  #Filter group name
  groupname = 'Blocked Users'
+
  groupname = 'Standard Users'
 
  −
 
  −
Content filtering files location
  −
 
  −
change all these to show f2 in the location path
  −
 
  −
change all other occurrences of f1 to f2 in file paths
  −
 
        Line 322: Line 357:  
  #Filter group name
 
  #Filter group name
 
  groupname = 'Guest Users'
 
  groupname = 'Guest Users'
  −
  −
Content filtering files location
  −
  −
change all these to show f3 in the location path
  −
  −
change all other occurrences of f1 to f3 in file paths
        Line 340: Line 368:  
  #Filter group name
 
  #Filter group name
 
  groupname = 'Power Users'
 
  groupname = 'Power Users'
  −
  −
Content filtering files location
  −
  −
change all these to show f4 in the location path
  −
  −
change all other occurrences of f1 to f4 in file paths
        Line 358: Line 379:  
  #Filter group name
 
  #Filter group name
 
  groupname = 'Admin Users'
 
  groupname = 'Admin Users'
  −
  −
Content filtering files location
  −
  −
change all these to show f5 in the location path
  −
  −
change all other occurrences of f1 to f5 in file paths
        Line 408: Line 422:     
also edit /etc/dansguardian/contentscanners/clamdscan.conf and uncomment
 
also edit /etc/dansguardian/contentscanners/clamdscan.conf and uncomment
  clamdudsfile = '/var/clamav/clamd.socket'
+
  + clamdudsfile = '/var/clamav/clamd.socket'
 
+
- #clamdudsfile = '/var/run/clamav/clamd.socket'
    
If you also want to be warned each time a bad page is blocked, edit /etc/dansguardian/dansguardianf1.conf and modify default settings:
 
If you also want to be warned each time a bad page is blocked, edit /etc/dansguardian/dansguardianf1.conf and modify default settings:
Line 422: Line 436:     
DansGuardian should block the download!
 
DansGuardian should block the download!
 +
 +
=====ClamAV & Dansguardian on SME 9+=====
 +
The path to clamd.socket changed with SME 9, and [https://forums.contribs.org/index.php/topic,52519.msg269937.html#msg269937 users report] file access rights issues between dansguardian and clamav.
 +
 +
After installing DansGuardian and completing the clamav setup instructions above, there are 3 extra steps to take on SME9:
 +
 +
1. The path to clamd.socket must match the path given in /etc/clamd.conf
 +
* edit <span style="color:blue;">/etc/dansguardian/contentscanners/clamdscan.conf</span> and set clamdudsfile to:
 +
  clamdudsfile = '/var/clamav/clamd.socket'
 +
 +
2. Dansguardian and Clamav must run as the same user for clamav scanning to work.  Set Dansguardian to run as 'clamav' as follows:
 +
* edit <span style="color:blue;">/etc/dansguardian/dansguardian.conf</span>
 +
** uncomment 'daemonuser' and 'daemongroup'
 +
** set 'daemonuser' to 'clamav':
 +
  daemonuser = 'clamav'
 +
  daemongroup = 'dansguardian
 +
 +
3. Correct the ownership on existing files and folders that belong to the original dansguardian user account.
 +
* Execute the commands below
 +
  chown clamav /var/log/dansguardian/access.log
 +
  'rm' -rf /tmp/.dguardianipc
 +
  'rm' -rf /tmp/.dguardianurlipc
 +
 +
 +
Restart dansguardian and test
 +
  /etc/init.d/dansguardian restart
    
====Other Dansguardian Config Files====
 
====Other Dansguardian Config Files====
Line 427: Line 467:  
There are many other config files, including but not limited to the ones in this appendix
 
There are many other config files, including but not limited to the ones in this appendix
   −
 
+
See [[:Dansguardian/ConfigFiles]]
[[:Dansguardian/ConfigFiles]]
      
===Starting Dansguardian===
 
===Starting Dansguardian===
Line 473: Line 512:     
http://forums.contribs.org/index.php?topic=38284.0
 
http://forums.contribs.org/index.php?topic=38284.0
 +
 +
Some users report that this method does not seem to work for them.
 +
 +
An alternative approach (which is known to work OK), is to use gpedit.msc to remove the IE menu option for changing connection settings. Do this using the following brief steps.
 +
 +
Run gpedit.msc
 +
 +
Select Local Computer Policy
 +
 +
Select User Configuration
 +
 +
Select Administrative Templates
 +
 +
Select Windows Components
 +
 +
Select Internet Explorer
 +
 +
Select Disable changing connection settings
 +
 +
Select Enabled then click OK
 +
 +
This will disable the Internet Explorer menu Tools/Internet Options/Connections, so ensure you have made the correct desired settings first.
 +
    
Note that if TransparentPort = 8080 and portblocking = yes and you are not using Group Filtering, workstations can be set to "Auto detect proxy port" and will be forced to use Dansguardian.
 
Note that if TransparentPort = 8080 and portblocking = yes and you are not using Group Filtering, workstations can be set to "Auto detect proxy port" and will be forced to use Dansguardian.
    
Note that if Transparent = no and you are using Group Filtering with user login authentication, then your browsers proxy port will need to be set to port 8080 (for all users). If you are using Windows & Internet Explorer, then using gpedit.msc can simplify configuration for all users of workstations.
 
Note that if Transparent = no and you are using Group Filtering with user login authentication, then your browsers proxy port will need to be set to port 8080 (for all users). If you are using Windows & Internet Explorer, then using gpedit.msc can simplify configuration for all users of workstations.
      
=== Bugs ===
 
=== Bugs ===
 
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}and select the smeserver-dansguardian component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-dansguardian|title=this link}}.
 
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}and select the smeserver-dansguardian component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-dansguardian|title=this link}}.
   −
=== Tested software versions ===
+
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=smeserver-dansguardian|noresultsmessage="No open bugs found."}}
* Host: SMEserver v7.1.3, v7.2
+
 
* Installed: smeserver-dansguardian 0.9-3.el4.sme
+
 
* Dependency Installed: dansguardian 2.9-2
+
===Changelog===
* Dependency Updated: pcre-6.7-1
+
Only versions released in smecontrib are listed here.
* Optionnal: dungog-blacklists-1.0-20061002
+
 
 +
{{ #smechangelog: smeserver-dansguardian}}
 +
 
 +
 
    
----
 
----
 
[[Category:Contrib]]
 
[[Category:Contrib]]
 
[[Category:Dungog]]
 
[[Category:Dungog]]
[[Category: Administration]]
+
[[Category:Administration:Content Spam Virus Blocking]]
 +
[[Category:Security]]
 +
[[Category:Contrib:webfiltering]]

Navigation menu