add snortsam package - plugin for Snort
authorFlorian Fainelli <florian@openwrt.org>
Tue, 16 Oct 2012 15:55:42 +0000 (15:55 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 16 Oct 2012 15:55:42 +0000 (15:55 +0000)
I would like to introduce you Snortsam, plugin for Snort. This patch was
accidentally superseded due to lack of my explanation (snortsam needs to be
supported by snort - it is supported now). It's in the same state as was
introduced before. Support for snortsam was introduced in Snort in
http://patchwork.openwrt.org/patch/2491/. Current version of Snort (2.9.2.2)
supports Snortsam.

SnortSam is a plugin for Snort, an open-source light-weight Intrusion
Detection System (IDS).

Signed-off-by: Jiri Slachta <slachta@cesnet.cz>
SVN-Revision: 33791

net/snortsam/Makefile [new file with mode: 0644]
net/snortsam/files/snortsam.init [new file with mode: 0644]

diff --git a/net/snortsam/Makefile b/net/snortsam/Makefile
new file mode 100644 (file)
index 0000000..c3aeba6
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2012 OpenWrt
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=snortsam
+PKG_VERSION:=2.70
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://val.bmstu.ru/unix/snort/
+PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=8ffa32056152e089fbacd601090f941d
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+MAKE_PATH:=src
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/snortsam
+  SUBMENU:=Firewall
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Snortsam
+  URL:=https://www.snortsam.net/
+  DEPENDS:=+libpthread +snort
+endef
+
+define Package/snortsam/description
+ SnortSam is a plugin for Snort, an Intrusion Detection System (IDS). The plugin allows automated blocking of IP addresses.
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/src \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               $(MAKE_FLAGS) \
+               all
+       $(MAKE) -C $(PKG_BUILD_DIR)/src \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               $(MAKE_FLAGS) \
+               samtool
+endef
+
+define Package/snortsam/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_BUILD_DIR)/snortsam $(PKG_BUILD_DIR)/samtool $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) $(PKG_BUILD_DIR)/conf/* $(1)/etc/
+       $(CP) $(PKG_BUILD_DIR)/conf/snortsam.conf.sample $(1)/etc/snortsam.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/snortsam.init $(1)/etc/init.d/snortsam
+endef
+
+$(eval $(call BuildPackage,snortsam))
diff --git a/net/snortsam/files/snortsam.init b/net/snortsam/files/snortsam.init
new file mode 100644 (file)
index 0000000..c39e5af
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2012 OpenWrt.org
+START=99 
+APP=snortsam
+BIN_FILE="/usr/sbin/"$APP
+PID_FILE="/var/run/"$APP".pid"
+PARAMS="/etc/snortsam.conf"
+
+start() {
+       start-stop-daemon -S -x $BIN_FILE -p $PID_FILE -b -m -- $PARAMS
+}
+
+stop() {
+       start-stop-daemon -K -x $BIN_FILE -p $PID_FILE -q
+       rm -rf $PID_FILE
+}