X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from apollo.thewebhostserver.com (apollomail.thewebhostserver.com [46.23.65.248]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id DAB88DC0124 for ; Mon, 18 Nov 2013 22:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=it-offshore.co.uk; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=cS//YzHpawiSldDQoidC+FLcB8pu6xizOVqLg33URDo=; b=kqjywMrz5VPLI0TU/pIwx6CfagAUnonOF34PJ+dl08Z8pVSvtOyWAcbKI1DdVHah1zdrVXuFWag0EPVrXspCZTtXE0ZGtq5eypR968oXRvXCscx9cqovFamPHfnyZN/h; Received: from [81.4.121.188] (port=38494 helo=alpine.my.domain) by apollo.thewebhostserver.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1ViXTO-001IQb-Vr; Mon, 18 Nov 2013 22:39:15 +0000 From: IT Offshore To: alpine-devel@lists.alpinelinux.org Cc: IT Offshore Subject: [alpine-devel] [PATCH] Patch for PSAD to fix sending mail & service starting. Date: Mon, 18 Nov 2013 22:40:23 +0000 Message-Id: <1384814423-2342-1-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 1.8.4.3 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Added start() to /etc/init.d/psad - it was not starting without it. Added a dependency for mailx to APKBUILD & fixed /etc/psad/psad.conf setting for mail (ssmtp on it's own was not enough - mail was incorrectly formed). Tested on a live server - scans are detected, blocked & email notifications sent. --- testing/psad/APKBUILD | 12 +++++++----- testing/psad/psad.initd | 6 ++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/testing/psad/APKBUILD b/testing/psad/APKBUILD index 85c1530..0e899eb 100644 --- a/testing/psad/APKBUILD +++ b/testing/psad/APKBUILD @@ -7,8 +7,7 @@ pkgdesc="3 lightweight system daemons that analyze iptables log messages to dete url="http://cipherdyne.org/psad/" arch="all" license="GPL" -depends="perl iptables ip6tables ssmtp psmisc perl-bit-vector perl-date-calc perl-iptables-chainmgr perl-iptables-parse perl-net-ipv4addr perl-unix-syslog net-tools" -install="" +depends="perl iptables ip6tables ssmtp mailx psmisc perl-bit-vector perl-date-calc perl-iptables-chainmgr perl-iptables-parse perl-net-ipv4addr perl-unix-syslog net-tools" subpackages="$pkgname-doc" source="http://cipherdyne.org/psad/download/$pkgname-nodeps-$pkgver.tar.gz psad.initd @@ -37,6 +36,9 @@ build() { -e "s|/usr/sbin/psad|$pkgdir&|" \ ./psad.conf -i + # set mail command to mailx + sed -e 's|/bin/mail;|/usr/bin/mail;|g' -i ./psad.conf + #Disable install of generic init script & setting numeric run level START=$(sed -n '/if ($init_dir and &is_root()) {/=' ./install.pl) END=$(expr $START + 7) @@ -96,11 +98,11 @@ package() { } md5sums="ee600d9b6b4b915b026370c9a3726b5f psad-nodeps-2.2.1.tar.gz -a1add105866af03e44c64129f2cf38ab psad.initd +e079dfcd533bc9bcf6f32525868fdd9b psad.initd bc07efebb41cc23c4be129bbbacc874b psad.confd" sha256sums="0422cdd1a37d4c8fcc1a4ce6e7c4a6974e58fdde82242f45b83eb6beb85708b5 psad-nodeps-2.2.1.tar.gz -e196bc469e711b322351c60f3ac646997b123b402a3a3c6a0135273510e9b762 psad.initd +f1570450fd5e4e6a6e044b52ecd342d8f2bc2034ec8699c244b9f1a79d38026c psad.initd 74c72225fa37c367a458321b737050cacaf262f32b0cc13babc54468ff1988b9 psad.confd" sha512sums="9e3f475376c3c7b753e71676f5c9d639e9fffd93caf864faa130f8030e37f9a6c57ba59c9519d2bd8dde945f7ff7a014ca2a710bd4b7be9721ca7f13f879b970 psad-nodeps-2.2.1.tar.gz -10ebd44adfe124242883d4904926f164b89f9037fb28dadd938198904c1a35b08dbcae9284d21db8ea50baa7621d3d365926c95b56ffc263adb1c8194ad767de psad.initd +e4daea5c93b72d9818388435dd90d24360336cc3a46c698feb01162e40b78a0f96241054368303b3093e64f1cd517db08de4b6e128a8e0ec77e6b9770e10cec9 psad.initd a80666f59356cc6157a9f5dca132991d4f1e0afda8f673d602de2557219d5521bec9ae148330e98d9483175d14d96e4cc2ccd11541d8b187b0e47f44ba4ada54 psad.confd" diff --git a/testing/psad/psad.initd b/testing/psad/psad.initd index 4b3df09..dfe4c3d 100644 --- a/testing/psad/psad.initd +++ b/testing/psad/psad.initd @@ -26,6 +26,12 @@ start_pre() { checkpath --directory ${pidfile%/*} } +start() { + ebegin "Starting PSAD (Port Scan Attack Detector)" + start-stop-daemon --start $command --pidfile $pidfile + eend $? +} + stop() { local piddir=${pidfile%/*} ebegin "Stopping psadwatchd" -- 1.8.4.3 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---