Date: Tue, 13 Jun 2006 06:40:04 +0530 (IST) From: Rajkumar S <raj@linuxense.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/98976: New port: security/havp HAVP is an antivirus proxy http://havp.sf.net Message-ID: <200606130110.k5D1A44A007195@beastie.linuxense.com> Resent-Message-ID: <200606150910.k5F9ATVB091089@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 98976 >Category: ports >Synopsis: New port: security/havp HAVP is an antivirus proxy http://havp.sf.net >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jun 15 09:10:28 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Rajkumar S. >Release: FreeBSD 6.1-RELEASE-p1 i386 >Organization: Linuxense http://www.linuxense.com >Environment: System: FreeBSD beastie.linuxense.com 6.1-RELEASE-p1 FreeBSD 6.1-RELEASE-p1 #0: Fri Jun 2 05:34:02 IST 2006 root@beastie.linuxense.com:/usr/obj/usr/src/sys/GENERIC i386 >Description: HAVP (HTTP Antivirus Proxy) is a proxy with a ClamAV anti-virus scanner. The main aims are continuous, non-blocking downloads and smooth scanning of dynamic and password protected HTTP traffic. Havp antivirus proxy has a parent and transparent proxy mode. It can be used with squid or standalone. >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # havp # havp/pkg-plist # havp/pkg-descr # havp/Makefile # havp/distinfo # havp/pkg-install # havp/pkg-deinstall # havp/files # havp/files/havp.sh.in # havp/files/patch-etc-havp-havp.config # echo c - havp mkdir -p havp > /dev/null 2>&1 echo x - havp/pkg-plist sed 's/^X//' >havp/pkg-plist << 'END-of-havp/pkg-plist' Xsbin/havp X@unexec if cmp -s %D/etc/havp/havp.config %D/etc/havp/havp.config.default; then rm -f %D/etc/havp/havp.config; fi Xetc/havp/havp.config.default Xetc/havp/blacklist Xetc/havp/whitelist Xetc/havp/templates/it/maxsize.html Xetc/havp/templates/it/dns.html Xetc/havp/templates/it/down.html Xetc/havp/templates/it/error.html Xetc/havp/templates/it/invalid.html Xetc/havp/templates/it/request.html Xetc/havp/templates/it/scanner.html Xetc/havp/templates/it/virus.html Xetc/havp/templates/it/blacklist.html Xetc/havp/templates/css2/havp.css Xetc/havp/templates/de/maxsize.html Xetc/havp/templates/de/dns.html Xetc/havp/templates/de/down.html Xetc/havp/templates/de/error.html Xetc/havp/templates/de/invalid.html Xetc/havp/templates/de/request.html Xetc/havp/templates/de/scanner.html Xetc/havp/templates/de/virus.html Xetc/havp/templates/de/blacklist.html Xetc/havp/templates/en/maxsize.html Xetc/havp/templates/en/dns.html Xetc/havp/templates/en/down.html Xetc/havp/templates/en/error.html Xetc/havp/templates/en/invalid.html Xetc/havp/templates/en/request.html Xetc/havp/templates/en/scanner.html Xetc/havp/templates/en/virus.html Xetc/havp/templates/en/blacklist.html Xetc/havp/templates/es/maxsize.html Xetc/havp/templates/es/dns.html Xetc/havp/templates/es/down.html Xetc/havp/templates/es/error.html Xetc/havp/templates/es/invalid.html Xetc/havp/templates/es/request.html Xetc/havp/templates/es/scanner.html Xetc/havp/templates/es/virus.html Xetc/havp/templates/es/blacklist.html Xetc/havp/templates/fr/maxsize.html Xetc/havp/templates/fr/dns.html Xetc/havp/templates/fr/down.html Xetc/havp/templates/fr/error.html Xetc/havp/templates/fr/invalid.html Xetc/havp/templates/fr/request.html Xetc/havp/templates/fr/scanner.html Xetc/havp/templates/fr/virus.html Xetc/havp/templates/fr/blacklist.html Xetc/havp/templates/br/maxsize.html Xetc/havp/templates/br/dns.html Xetc/havp/templates/br/down.html Xetc/havp/templates/br/error.html Xetc/havp/templates/br/invalid.html Xetc/havp/templates/br/request.html Xetc/havp/templates/br/scanner.html Xetc/havp/templates/br/virus.html Xetc/havp/templates/br/blacklist.html Xetc/havp/templates/nl/maxsize.html Xetc/havp/templates/nl/dns.html Xetc/havp/templates/nl/down.html Xetc/havp/templates/nl/error.html Xetc/havp/templates/nl/invalid.html Xetc/havp/templates/nl/request.html Xetc/havp/templates/nl/scanner.html Xetc/havp/templates/nl/virus.html Xetc/havp/templates/nl/blacklist.html Xetc/havp/templates/pf/maxsize.html Xetc/havp/templates/pf/dns.html Xetc/havp/templates/pf/down.html Xetc/havp/templates/pf/error.html Xetc/havp/templates/pf/invalid.html Xetc/havp/templates/pf/request.html Xetc/havp/templates/pf/scanner.html Xetc/havp/templates/pf/virus.html Xetc/havp/templates/pf/blacklist.html Xetc/havp/templates/pl/maxsize.html Xetc/havp/templates/pl/dns.html Xetc/havp/templates/pl/down.html Xetc/havp/templates/pl/error.html Xetc/havp/templates/pl/invalid.html Xetc/havp/templates/pl/request.html Xetc/havp/templates/pl/scanner.html Xetc/havp/templates/pl/virus.html Xetc/havp/templates/pl/blacklist.html Xetc/havp/templates/ru/maxsize.html Xetc/havp/templates/ru/dns.html Xetc/havp/templates/ru/down.html Xetc/havp/templates/ru/error.html Xetc/havp/templates/ru/invalid.html Xetc/havp/templates/ru/request.html Xetc/havp/templates/ru/scanner.html Xetc/havp/templates/ru/virus.html Xetc/havp/templates/ru/blacklist.html Xetc/havp/templates/sv/maxsize.html Xetc/havp/templates/sv/dns.html Xetc/havp/templates/sv/down.html Xetc/havp/templates/sv/error.html Xetc/havp/templates/sv/invalid.html Xetc/havp/templates/sv/request.html Xetc/havp/templates/sv/scanner.html Xetc/havp/templates/sv/virus.html Xetc/havp/templates/sv/blacklist.html X@dirrm etc/havp/templates/sv X@dirrm etc/havp/templates/ru X@dirrm etc/havp/templates/pl X@dirrm etc/havp/templates/pf X@dirrm etc/havp/templates/nl X@dirrm etc/havp/templates/br X@dirrm etc/havp/templates/fr X@dirrm etc/havp/templates/es X@dirrm etc/havp/templates/en X@dirrm etc/havp/templates/css2 X@dirrm etc/havp/templates/de X@dirrm etc/havp/templates/it X@dirrm etc/havp/templates X@dirrmtry etc/havp X@unexec rmdir %%TMPDIR%% 2>/dev/null || true X@unexec rmdir %%LOGDIR%% 2>/dev/null || true X@unexec rmdir %%RUNDIR%% 2>/dev/null || true END-of-havp/pkg-plist echo x - havp/pkg-descr sed 's/^X//' >havp/pkg-descr << 'END-of-havp/pkg-descr' XHAVP (HTTP Antivirus Proxy) is a proxy with a ClamAV anti-virus Xscanner. The main aims are continuous, non-blocking downloads and Xsmooth scanning of dynamic and password protected HTTP traffic. Havp Xantivirus proxy has a parent and transparent proxy mode. It can be Xused with squid or standalone. END-of-havp/pkg-descr echo x - havp/Makefile sed 's/^X//' >havp/Makefile << 'END-of-havp/Makefile' X# New ports collection makefile for: havp X# Date created: Tue May 9 15:08:29 IST 2006 X# Whom: Rajkumar S <raj@linuxense.com> X# X# $FreeBSD$ X# X XPORTNAME= havp XPORTVERSION= 0.80 XPORTREVISION= 5 XCATEGORIES= security XMASTER_SITES= http://www.server-side.de/download/ X XMAINTAINER= raj@linuxense.com XCOMMENT= HTTP Antivirus Proxy X XLIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre \ X clamav.1:${PORTSDIR}/security/clamav \ X pth.20:${PORTSDIR}/devel/pth XGNU_CONFIGURE= yes XUSE_GMAKE= yes XCONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} XTMPDIR= /var/tmp/havp XLOGDIR= /var/log/havp XRUNDIR= /var/run/havp XPLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} XCONFIG_DIR?= ${PREFIX}/etc/havp XHAVPUSER?= havp XHAVPGROUP?= havp XUSE_RC_SUBR= havp.sh X.include <bsd.port.pre.mk> Xpost-install: X @PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL X @${CHOWN} -R ${HAVPUSER}:${HAVPGROUP} ${RUNDIR} ${TMPDIR} ${LOGDIR} X.for c in havp X @[ -f ${DESTDIR}${PREFIX}/etc/havp/${c}.config ] || \ X ${CP} ${DESTDIR}${PREFIX}/etc/havp/${c}.config.default ${DESTDIR}${PREFIX}/etc/havp/${c}.config X.endfor X X.include <bsd.port.post.mk> END-of-havp/Makefile echo x - havp/distinfo sed 's/^X//' >havp/distinfo << 'END-of-havp/distinfo' XMD5 (havp-0.80.tar.gz) = 89fe870dfe1ae71d089d0cc94ebdfc21 XSHA256 (havp-0.80.tar.gz) = 3d8cb4db1a9647157896a411ecaab34fe998315dc2c5787035d259ed33fc52b9 XSIZE (havp-0.80.tar.gz) = 104202 END-of-havp/distinfo echo x - havp/pkg-install sed 's/^X//' >havp/pkg-install << 'END-of-havp/pkg-install' X#! /bin/sh X Xask() { X local question default answer X X question=$1 X default=$2 X if [ -z "${PACKAGE_BUILDING}" ]; then X read -p "${question} [${default}]? " answer X fi X if [ x${answer} = x ]; then X answer=${default} X fi X echo ${answer} X} X Xyesno() { X local dflt question answer X X question=$1 X dflt=$2 X while :; do X answer=$(ask "${question}" "${dflt}") X case "${answer}" in X [Yy]*) return 0;; X [Nn]*) return 1;; X esac X echo "Please answer yes or no." X done X} X Xmake_account() { X local u g gcos homeopt home X X u=$1 X g=$2 X gcos=$3 X homeopt=${4:+"-d $4"} X X if pw group show "${g}" >/dev/null 2>&1; then X echo "You already have a group \"${g}\", so I will use it." X else X echo "You need a group \"${g}\"." X if which -s pw; then X pw groupadd ${g} || exit X echo "Done." X else X echo "Please create it, and try again." X if ! grep -q "^${u}:" /etc/passwd; then X echo "While you're at it, please create a user \"${u}\" too," X echo "with a default group of \"${g}\"." X fi X exit 1 X fi X fi X X if pw user show "${u}" >/dev/null 2>&1; then X echo "You already have a user \"${u}\", so I will use it." X else X echo "You need a user \"${u}\"." X if which -s pw; then X pw useradd ${u} -g ${g} -h - ${homeopt} \ X -s /nonexistent -c "${gcos}" || exit X echo "Done." X else X echo "Please create it, and try again." X exit 1 X fi X fi X X if [ x"$homeopt" = x ]; then X eval home=~${u} X if [ ! -d "${home}" ]; then X if yesno \ X "Would you like me to create ${u}'s home directory (${home})" y X then X mkdir -p ${home}/.cvsup || exit X touch ${home}/.cvsup/auth || exit X chown -R ${u}:${g} ${home} || exit X chmod -R go= ${home} || exit X else X echo "Please create it, and try again." X exit 1 X fi X fi X fi X} X Xcase $2 in X XPOST-INSTALL) X echo "" X make_account havp havp "HAVP" "/nonexistent" X mkdir -p -m 755 /var/log/havp/ X mkdir -p -m 755 /var/tmp/havp/ X mkdir -p -m 755 /var/run/havp/ X chown havp:havp /var/log/havp/ X chown havp:havp /var/tmp/havp/ X chown havp:havp /var/run/havp/ X X ;; Xesac END-of-havp/pkg-install echo x - havp/pkg-deinstall sed 's/^X//' >havp/pkg-deinstall << 'END-of-havp/pkg-deinstall' X#! /bin/sh X Xask() { X local question default answer X X question=$1 X default=$2 X if [ -z "${PACKAGE_BUILDING}" ]; then X read -p "${question} [${default}]? " answer X fi X if [ x${answer} = x ]; then X answer=${default} X fi X echo ${answer} X} X Xyesno() { X local dflt question answer X X question=$1 X dflt=$2 X while :; do X answer=$(ask "${question}" "${dflt}") X case "${answer}" in X [Yy]*) return 0;; X [Nn]*) return 1;; X esac X echo "Please answer yes or no." X done X} X Xdelete_account() { X local u g home X X u=$1 X g=$2 X pw groupdel -n ${g} X echo "Done." X X eval home=~${u} X pw userdel -n ${u} X echo "Done." X if [ -d "${home}" ]; then X echo "Please remember to remove the home directory \"${home}\" " X fi X} X Xcase $2 in X XPOST-DEINSTALL) X echo "" X delete_account havp havp X X ;; Xesac END-of-havp/pkg-deinstall echo c - havp/files mkdir -p havp/files > /dev/null 2>&1 echo x - havp/files/havp.sh.in sed 's/^X//' >havp/files/havp.sh.in << 'END-of-havp/files/havp.sh.in' X#!/bin/sh X# X# $FreeBSD$ X# X X# PROVIDE: havp X# REQUIRE: LOGIN X X# X# Add the following lines to /etc/rc.conf to enable havp: X# X#havp_enable="YES" X# X X. %%RC_SUBR%% X Xname=havp Xrcvar=`set_rcvar` X Xcommand=%%PREFIX%%/sbin/havp Xpidfile=/var/run/havp/havp.pid Xrequired_files=%%PREFIX%%/etc/havp/havp.config X X# read settings, set default values Xload_rc_config "$name" X: ${clamav_clamd_enable="NO"} X: ${clamav_clamd_flags=""} X Xrun_rc_command "$1" END-of-havp/files/havp.sh.in echo x - havp/files/patch-etc-havp-havp.config sed 's/^X//' >havp/files/patch-etc-havp-havp.config << 'END-of-havp/files/patch-etc-havp-havp.config' X--- etc/havp/havp.config.default Fri Apr 21 22:04:44 2006 X+++ etc/havp/havp.config Wed May 10 12:59:17 2006 X@@ -16,7 +16,7 @@ X # You must remove this line for HAVP to start. X # This makes sure you have (hopefully) reviewed the configuration. :) X # Hint: You must enable some scanner! Find them in the end.. X-REMOVETHISLINE deleteme X+# REMOVETHISLINE deleteme X X # X # For reasons of security it is recommended to run a proxy program X@@ -24,8 +24,8 @@ X # used by any other program. X # X # Default: X-# USER havp X-# GROUP havp X+USER havp X+GROUP havp X X # X # If this is true HAVP is running as daemon in background. X@@ -38,7 +38,7 @@ X # Display initial messages on console when starting HAVP. X # X # Default: X-# DISPLAYINITIALMESSAGES true X+DISPLAYINITIALMESSAGES false X X # X # Process id (PID) of the main HAVP process is written to this file. X@@ -237,7 +237,7 @@ X # not be properly scanned. X # X # Default: X-# RANGE false X+RANGE true X X # X # Max size of temporary files on disk. X@@ -332,14 +332,14 @@ X ##### ClamAV Library Scanner (libclamav) X ##### X X-ENABLECLAMLIB false X+ENABLECLAMLIB true X X # HAVP uses libclamav hardcoded pattern directory, which usually is X # /usr/local/share/clamav. You only need to set CLAMDBDIR, if you are X # using non-default DatabaseDirectory setting in clamd.conf. X # X # Default: NONE X-# CLAMDBDIR /path/to/directory X+CLAMDBDIR /var/db/clamav/ X X # Should we block encrypted archives? X # END-of-havp/files/patch-etc-havp-havp.config exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606130110.k5D1A44A007195>