http://bering-uclibc.zetam.org/index.php?title=Bering-uClibc_5.x_-_User_Guide_-_Advanced_Topics_-_Setting_Up_a_HTTP_Anti_Virus_Proxy&feed=atom&action=historyBering-uClibc 5.x - User Guide - Advanced Topics - Setting Up a HTTP Anti Virus Proxy - Revision history2024-03-29T07:19:54ZRevision history for this page on the wikiMediaWiki 1.26.0http://bering-uclibc.zetam.org/index.php?title=Bering-uClibc_5.x_-_User_Guide_-_Advanced_Topics_-_Setting_Up_a_HTTP_Anti_Virus_Proxy&diff=1899&oldid=prevKapeka: adjust header and Footer2014-04-12T17:36:59Z<p>adjust header and Footer</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 17:36, 12 April 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l4" >Line 4:</td>
<td colspan="2" class="diff-lineno">Line 4:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>| width="20%" align="left"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Prev]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>| width="20%" align="left"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Prev]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>! width="60%" align="center" | [[Bering-uClibc 5.x - User Guide]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>! width="60%" align="center" | [[Bering-uClibc 5.x - User Guide]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>| width="20%" align="right"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - <del class="diffchange diffchange-inline">Modifying initrd.lrp</del>|Next]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>| width="20%" align="right"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - <ins class="diffchange diffchange-inline">Setting Up a Home Automation controller with heyu</ins>|Next]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>----</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>----</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l193" >Line 193:</td>
<td colspan="2" class="diff-lineno">Line 193:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>| width="40%" align="left"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Prev]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>| width="40%" align="left"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Prev]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>| width="20%" align="center" | [[Bering-uClibc 5.x - User Guide - Advanced Topics|Up]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>| width="20%" align="center" | [[Bering-uClibc 5.x - User Guide - Advanced Topics|Up]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>| width="40%" align="right"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - <del class="diffchange diffchange-inline">Modifying initrd.lrp</del>|Next]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>| width="40%" align="right"  | [[Bering-uClibc 5.x - User Guide - Advanced Topics - <ins class="diffchange diffchange-inline">Setting Up a Home Automation controller with heyu</ins>|Next]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Bering-uClibc 5.x]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Bering-uClibc 5.x]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Category:User Guide]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Category:User Guide]]</div></td></tr>
</table>Kapekahttp://bering-uclibc.zetam.org/index.php?title=Bering-uClibc_5.x_-_User_Guide_-_Advanced_Topics_-_Setting_Up_a_HTTP_Anti_Virus_Proxy&diff=1418&oldid=prevKapeka: modules are gzipped2012-10-27T12:26:59Z<p>modules are gzipped</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 12:26, 27 October 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l91" >Line 91:</td>
<td colspan="2" class="diff-lineno">Line 91:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>We do need later support for an ext3 filesystem, therefor install from the modules tarball <code class="filename">modules.tgz</code> on the iso image:</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>We do need later support for an ext3 filesystem, therefor install from the modules tarball <code class="filename">modules.tgz</code> on the iso image:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* kernel/fs/mbcache.ko</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* kernel/fs/mbcache.ko<ins class="diffchange diffchange-inline">.gz</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* kernel/fs/jbd/jbd.ko</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* kernel/fs/jbd/jbd.ko<ins class="diffchange diffchange-inline">.gz</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* kernel/fs/ext3/ext3.ko</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* kernel/fs/ext3/ext3.ko<ins class="diffchange diffchange-inline">.gz</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Don't forget to save the modules and add the to <code class="filename">/etc/modules.conf</code>, so they'll be loaded, if you reboot.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Don't forget to save the modules and add the to <code class="filename">/etc/modules.conf</code>, so they'll be loaded, if you reboot.</div></td></tr>
</table>Kapekahttp://bering-uclibc.zetam.org/index.php?title=Bering-uClibc_5.x_-_User_Guide_-_Advanced_Topics_-_Setting_Up_a_HTTP_Anti_Virus_Proxy&diff=1396&oldid=prevKapeka: Created page with '{| summary="Navigation header" width="100%" ! colspan="3" align="center" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up a HTTP Anti Virus Proxy|Advanced Topics…'2012-10-27T10:18:07Z<p>Created page with '{| summary="Navigation header" width="100%" ! colspan="3" align="center" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up a HTTP Anti Virus Proxy|Advanced Topics…'</p>
<p><b>New page</b></p><div>{| summary="Navigation header" width="100%"<br />
! colspan="3" align="center" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up a HTTP Anti Virus Proxy|Advanced Topics - Setting Up a HTTP Anti Virus Proxy]]<br />
|-<br />
| width="20%" align="left" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Prev]]<br />
! width="60%" align="center" | [[Bering-uClibc 5.x - User Guide]]<br />
| width="20%" align="right" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Modifying initrd.lrp|Next]]<br />
|}<br />
----<br />
<br />
=== Preface ===<br />
The purpose of this chapter is to setup a LEAF box with a http proxy that scans your web traffic for Trojans, viruses, malware and other malicious threats. As scanner [http://www.clamav.net/lang/en/ ClamAV] is used, as proxy [http://www.server-side.de HAVP].<br />
<br />
<code class="filename">havp</code> can be used with <code class="filename">squid</code> or standalone, but only the standalone version is described here. <code class="filename">havp</code> provides no content caching, therefor you'll need <code class="filename">squid.lrp</code>, it supports multiple virus scanners, but only clamav is provided as lrp Package. It has no support for ipv6 and does not scan ssl-protected page (https), but the setup will not block these pages. <br />
<br />
Running a http anti-virus proxy is beyond the typical usage of a LEAF Bering-uClibc box, which usually is used as a router and firewall. This is shown by the fact that the harwdare requirements are a lot more advanced than for a LEAF router. It requires at least 265MB RAM and a writable storage of more than 200MB, or at least 512MB RAM, if you run the proxy completly in RAM, and even than a fixed storage is recommended to reduce time-to-work, after a reboot.<br />
<br />
Most of the resources are needed for <code class="filename">clamav</code>, which requires at least 100MB RAM to start, and 100MB for the virus database plus daily updates. <code class="filename">havp</code> requires a minimum of 5MB fixed storage or RAM for a virtual disk.<br />
If you add a content-caching proxy like <code class="filename">squid</code>, even more is needed.<br />
<br />
But with a virtualized LEAF box RAM, and even more disk space, is cheap, so I used a Bering-uClibc 4.x i686-isoimage as [http://www.virtualbox.org virtualbox] guest with 768MB RAM and no harddisk as testbed. You may want to change it, to use a (virtual) harddisk as permament storage, that way you can virtualize a LEAF-based http anti-virus proxy. <br />
<br />
'''Note:''' The setup given here is mainly targeted for home usage and testing, for a more advanced usage a decent hardware and a configuration with <code class="filename">squid</code> is recommended. Also the way ssl-protected pages are tunneled is not as efficient, as you may like to have it in a professional environment.<br />
<br />
Also keep in mind, that I describe a testing environment only - therefor I'll change pathes in the configurations to get it "just working", as well as I'll change the shorewall configuration in an "unsecure manner" for the same reason. Hope you'll get the idea to move further.<br />
<br />
=== Setting up LEAF Bering-uClibc in a Virtualbox environment ===<br />
If you haven't already installed <code class="filename">virtualbox</code>, you can download it from the [https://www.virtualbox.org/wiki/Downloads Virtualbox download page], and read the [https://www.virtualbox.org/manual/UserManual.html User Manual] to become familiar with it.<br />
<br />
To run LEAF Bering-uClibc in a virtualized enviroment, you'll the need the image <code class="filename">Bering-uClibc_5.x_i686_isolinux_vga.iso</code> and a virtual floppy image.<br />
<br />
To create the second, run <br />
mkfs.vfat -C "floppy.img" 1440<br />
on the host machine and make shure, it's writable for the user who starts <code class="filename">virtualbox</code>.<br />
<br />
<code class="filename">virtualbox</code> supports creating a guest environment with a wizard, where you can set the amount of RAM for the guest system, 512MB or more are recommended for our task. <br />
Once this is done you'll need to adjust a few settings for the virtual machine:<br />
<br />
* On the ''System'' page activate ''PAE/NX'' for the CPU<br />
* On the ''Storage'' page add the Bering-uClibc isoimage to IDE-Controller, add a Floppydisk-Controller and attach the virtual floppy disk created before.<br />
* On the ''Network Settings''page choose ''Advanced'', and ''Port Forwarding''. In the new window add two new rules:<br />
<br />
<br />
{| border="6"<br />
! Name !! Protocol !! Host-IP !! Host-Port !! Guest-IP !! Guest-Port<br />
|-<br />
| Rule 1<br />
| TCP || 127.0.0.1 || 8088 || ''empty'' || 8080<br />
|-<br />
| Rule 2<br />
| TCP || 127.0.0.1 || 443 || ''empty'' || 8080<br />
|}<br />
<br />
<br />
That's all and you are ready to start you new virtual machine.<br />
<br />
==== Make the additional RAM available ====<br />
After you have bootet the VM, you still have only size of 8MB for /tmp.<br />
To change this the value for <code class="filename">tmp_size</code> in <code class="filename">leaf.cfg</code> has to be altered and <code class="filename">leaf.cfg</code> has to be saved to the virtual floppy.<br />
<br />
mount /dev/sr0 /mnt<br />
cp /mnt/leaf.cfg .<br />
umount /mnt<br />
<br />
Edit <code class="filename">leaf.cfg</code> and set <code class="filename">tmp_size</code> to 400MB. Then push it to the floppy disk.<br />
<br />
mount /dev/fd0 /mnt<br />
cp leaf.cfg /mnt<br />
umount /mnt<br />
<br />
Reboot the VM. If everything went well, the command <tt>df -h</tt> will show a size of 400MB for <code class="filename">/tmp</code>.<br />
<br />
=== Basic preparations ===<br />
For the following steps access from the VM to the internet is needed. So before you start, the nameserver settings has to be checked and the firewall should permit traffic from and to the VM.<br />
<br />
==== Nameserver ====<br />
Set ip address for <tt>nameserver</tt> in <code class="filename">/etc/resolv.conf</code> accordingly. <br />
By default it is set to 192.168.1.254; change this if your nameserver has a different one.<br />
<br />
==== Shorewall setup ====<br />
The virtualized proxy guest is, like the VM host, connected to the Internet with a LEAF router runnning a shorewall firewall. This is the reason, I just opened every connection from the net (which is in fact the host system) to the firewall and vice versa.<br />
<br />
The changes are made in <code class="filename">/etc/shorewall/policy</code> on the virtualized LEAF box:<br />
net fw ACCEPT<br />
fw net ACCEPT<br />
You may adjust your shorewall setup more seriously, if you use the box in production.<br />
You don't need to change anything on your main router/firewall.<br />
<br />
Restart shorewall.<br />
<br />
==== Installing additional modules ====<br />
We do need later support for an ext3 filesystem, therefor install from the modules tarball <code class="filename">modules.tgz</code> on the iso image:<br />
<br />
* kernel/fs/mbcache.ko<br />
* kernel/fs/jbd/jbd.ko<br />
* kernel/fs/ext3/ext3.ko<br />
<br />
Don't forget to save the modules and add the to <code class="filename">/etc/modules.conf</code>, so they'll be loaded, if you reboot.<br />
<br />
=== Setting up the virus scanner ClamAV ===<br />
<br />
==== Requirements ====<br />
To install ClamAV on a Bering-uClibc based system the following Packages are required:<br />
* <code class="filename">clamav.lrp</code><br />
* <code class="filename">libz.lrp</code><br />
<br />
==== Configuration ====<br />
Edit <code class="filename">/etc/clamav/freshclam.conf</code> and set the path for the DatabaseDirectory (use /tmp, because with an approx. size 400MB RAM size, it's big enough to hold the data).<br />
DatabaseDirectory /tmp <br />
<br />
Edit <code class="filename">/etc/clamav/clamav.conf</code> and change the DatabaseDirectory to the same value as for <code class="filename">/etc/clamav/freshclam.conf</code>:<br />
DatabaseDirectory /tmp <br />
<br />
It's also good idea to enable logging in <code class="filename">/etc/clamav/clamav.conf</code>.<br />
<br />
Logfile /tmp/clamd<br />
LogVerbose yes<br />
<br />
==== Retrieving the database ====<br />
Before <code class="filename">clamd</code> can be started, the database with virus signatures, and the latest updates for it, has to be downloaded from <code class="filename">database.clamav.net</code>. To accomplish this task, start<br />
freshclam -v<br />
If all goes well, you'll see a message like<br />
Downloading main.cvd [20%]<br />
The updates will be added afterwards automatically.<br />
Once the task is finished your ready to start clamd<br />
<br />
==== Starting clamd====<br />
Start <code class="filename">clamd</code> (this may take a few seconds):<br />
/etc/init.d/clamd start<br />
Clamd initiated<br />
You may want to check the logfile for more verbose output.<br />
<br />
=== Setting up the antivirus proxy HVAP ===<br />
==== Requirements ====<br />
To install HAVP on a Bering-uClibc based system the following Packages are required:<br />
* <code class="filename">havp.lrp</code><br />
* <code class="filename">libcxx.lrp</code><br />
* <code class="filename">hdsupp.lrp</code><br />
<br />
==== Create a diskimage for havp ====<br />
<code class="filename">havp</code> needs a seperate disk image. Create this in a new directory <code class="filename">/share</code> and format with ext3 filesystem.<br />
mkdir /share<br />
cd /share<br />
dd if=/dev/zero of=havp.img bs=10240 count=512<br />
mkfs.ext3 -F -q -m0 havp.img<br />
<br />
Mount the image to /<code class="filename">share/havp</code><br />
/sbin/losetup /dev/loop0 /share/havp.img<br />
mkdir /share/havp<br />
mount -o mand /dev/loop0 /share/havp<br />
<br />
'''Note:''' The switch <tt>-o mand</tt> is important, because havp needs the image with support for ''mandatory'' locking.<br />
<br />
==== Start havp ====<br />
/etc/init.d/havp.sh start<br />
<br />
You may want to check <code class="filename">/var/log/havp/error.log</code>, if something went wrong. In case you have success, you'll see a message, that announces a connection to <code class="filename">clamd</code> and the <code class="filename">eicar virus</code> has been passed to <code class="filename">clamd</code> and finally <br />
<br />
--- All scanners initialized<br />
<br />
The http antivirus proxy is ready for testing.<br />
<br />
=== Testing the setup ===<br />
If you worked through the chapter so far, you'll be ready to test the proxy.<br />
Change the proxy configuration for your browser and enable 127.0.0.1 as address and 8088 as port (we've added port forwarding for this above).<br />
<br />
You may also take a look at the <code class="filename">acccess.log</code> of <code class="filename">havp</code> on the LEAF VM box.<br />
<br />
tail -f /var/log/havp/access.log<br />
<br />
and/or the <code class="filename">/tmp/clamd.log</code>.<br />
<br />
A good page to test can be found at [http://eicar.org/85-0-Download.html eicar.org]. Her eyou can download the eicar test virus, which is harmless. If you try to download <code class="filename">eicar.com</code> using the standard protocol http you'll get a message from HAVP instead (''HAVP Access Denied''). If you use the ''secure, SSL enabled protocol https'', you'll be offered to save the file. This is expected, because HAVP does not scan ssl/https connections, and a good sign, because ssl/https is not blocked by the proxy.<br />
<br />
If you like the solution and want to install it permanently, you may want to use a (virtual) harddisk and mount it to <code class="filename">/share</code> to store the <code class="filename">clamav</code> database, <code class="filename">clamav</code> daily updates and the <code class="filename">havp.img</code>. (Don't forget to adjust the value for the <code class="filename">DataBaseDirectory</code> in <code class="filename">/etc/clamav/freshclam.conf</code> and <code class="filename">/etc/clamav/clamav.conf</code> .)<br />
<br />
=== Additional reading and acknowledgment ===<br />
<br />
Useful '''clamav''' links:<br />
<br />
[http://www.clamav.net/lang/en/ ClamAV main page]<br />
<br />
Useful '''havp''' links:<br />
<br />
[http://www.server-side.de/ havp main page]<br />
<br />
[http://havp.hege.li/forum/viewtopic.php?f=2&t=11 How to use havp with squid as caching proxy] (though it's based on an outdated squid version).<br />
<br />
[http://www.squid-cache.org/ squid-cache main page]<br />
<br />
The original Packages for <code class="filename">havp.lrp</code> and <code class="filename">clamav.lrp</code> have been contributed by Alejandro Dguez for LEAF [[Bering-uClibc 3.x]]. Based on his work it was easy, to adjust the buildtool setup for LEAF [[Bering-uClibc 4.x]] and later.<br />
----<br />
{| summary="Navigation footer" width="100%"<br />
| width="40%" align="left" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Setting Up Backup to Remote Server|Prev]]<br />
| width="20%" align="center" | [[Bering-uClibc 5.x - User Guide - Advanced Topics|Up]]<br />
| width="40%" align="right" | [[Bering-uClibc 5.x - User Guide - Advanced Topics - Modifying initrd.lrp|Next]]<br />
|}<br />
<br />
[[Category:Bering-uClibc 5.x]]<br />
[[Category:User Guide]]</div>Kapeka