diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-admin/sagan | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-admin/sagan')
-rw-r--r-- | app-admin/sagan/Manifest | 10 | ||||
-rw-r--r-- | app-admin/sagan/files/mysql_check.patch | 26 | ||||
-rw-r--r-- | app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch | 55 | ||||
-rw-r--r-- | app-admin/sagan/files/sagan.confd | 9 | ||||
-rw-r--r-- | app-admin/sagan/files/sagan.init | 17 | ||||
-rw-r--r-- | app-admin/sagan/files/sagan.init-r1 | 17 | ||||
-rw-r--r-- | app-admin/sagan/metadata.xml | 15 | ||||
-rw-r--r-- | app-admin/sagan/sagan-0.2.3.ebuild | 85 | ||||
-rw-r--r-- | app-admin/sagan/sagan-1.0.0_rc3.ebuild | 89 |
9 files changed, 323 insertions, 0 deletions
diff --git a/app-admin/sagan/Manifest b/app-admin/sagan/Manifest new file mode 100644 index 000000000000..d7072151a276 --- /dev/null +++ b/app-admin/sagan/Manifest @@ -0,0 +1,10 @@ +AUX mysql_check.patch 944 BLAKE2B 81fa58f1d60d81c6ec8c9e5b2f4d0a41aa67f51792f439205fb4a9016e989fc58035ac9878c27043aff8512ee490108e79b7627e052e1a222494a43d8b7a1475 SHA512 5758990b9c85a73d38c00d03a0ff9812e3ffe18a8831daebc01329c2db9253d75467b341aeffe563adcbd4fc907c510991ccf2e9bd8d9c6e7b6b353e7d2a4412 +AUX sagan-1.0.0-liblognorm-json-c.patch 2840 BLAKE2B 569957ec95bf5fc5bb1e844ba1d5f6a1c68415bd877551dbef03c62afbe66cde528fc4a2b80c3ca5faa92a3e97d2824a0e77b54add21e4a8092f6022b3e4c273 SHA512 1aa092351d317c373416a98ca6bbab19a070e43d0d4b82fe6dd1ac5a7cbb67741247ca2655e905a682ef5527fbf139c70a469a960be1dfdaa05c643a9749a4e9 +AUX sagan.confd 239 BLAKE2B 2ca76c1bd5bdb7b29f007a4d93602f020f76b10d6e4313e138e09b49de0b0c6796bc729f32e88831881bdcd52637bfb3a8e42481d89a09648a2833a000570ace SHA512 7ee746984d3bb3361e3155860d54e307f9b94b9e3f98c09c29b4259cd37d7aefe969b5b942c04048328ec23265a2689b22403c32e3552b8062201aca2ef3ac34 +AUX sagan.init 432 BLAKE2B 561344909a8f6610504f91bf72ba6fa89ac03fdacacd3189372f466b690b3421c3f1a8ce4750b747c53613c75f9b61696ec7b3c490597eb0eca36ebece23a26e SHA512 c5ec82e48ac33785a0e63deb6b2079e97a2f9b5f96682ccbf646b4deae5782cbceb5756b17fdff7af8cafd4e561e298d842c4c4f4aa5229ccc58f5f0fc06e6f7 +AUX sagan.init-r1 424 BLAKE2B e6fdd676e772d2abfca02215026a95321edecb41fcbeec3aa45afe15abd667e323ec2f21375d41c692b9648017002c0b410d551034dcbd3f060f5bb1e2f95026 SHA512 341754a9b18fa4b4082a852cec2eaa5ea78be33eb9d8cdef5b7ec61a9d67d3b264b2c6a2aef030bd85d3644539447345c88fd23ebe99145e40f990f565706809 +DIST sagan-0.2.3.tar.gz 231774 BLAKE2B b385a4b22f2fe7567dbb0c52ec022794eacf057a0dc797daa0432ef4bdfc344473a500298825f56a32513025e9c7cee3ff70fc577d7a9454e87022510a71edb4 SHA512 2110f3d34db69cb5c453b8e37d06debeea7531ebf15a9b78954ac1657ddce34feaaff87d14695759c3deb2eed5ecc0e6fec5881fb5037af8efa6c3c9600242cc +DIST sagan-1.0.0RC3.tar.gz 285207 BLAKE2B 7322ffc73a8e86f07ef106b04feb9140ba94a51b9e286ef0c0b0d3fa609e8e03cef4c75e1d32502c1b70a4c078d8601d2a1c58058137bb793c8a52cecc4be20b SHA512 29388a339b290bb4de2359c0c54b9e1d43ef207b223a499a1a4faa36de4d9590a777a796dd773948e995d052b71f3ef47ca5bad5c133116c4dbb53b4fe336123 +EBUILD sagan-0.2.3.ebuild 2024 BLAKE2B c3d9db48c8aa738f812ce22b5c3c1ab4ed436b8130480a30f7daad2f64dca7d425fccfec0668c96bcd18ee2fd5a4f3b49b8c1f785eaa9d4030c8865f0327cc69 SHA512 892c84a08c01258e6cafb52c8e5b12fcd38b4644c9160645baf39cf37dd1e270b951e9dcdc8aa1c720445b89f9848fb3905cbe7b806ad4e292be3f0f1d72be40 +EBUILD sagan-1.0.0_rc3.ebuild 2080 BLAKE2B a82272fc36cbd9eafa62cf7da9bd0b412c06f4d235861be44be21fd811fddcbe299e75dcdd56370787a3f9f35c47592a3dcc2d9608457e532ce1c0ee3dc68c44 SHA512 3dcc104b0f36a134cc0217c7c5f6373d13a6b479f8f97545953b8c551d28c330515176914c9f3447211a5c6882c68b90e656e53d61a9221489e1229f6302344f +MISC metadata.xml 711 BLAKE2B 19677ce6a88bd62ae22cc1383a8f671082c0f2b844d3e75344e5ff3aa01bc51e4826b3c02f30221af0f9b2b620e9bc9ccb2a6c55944d1b34de072c7f985531eb SHA512 0ddee4d50afea4e3813b9ffc57d444b95c56773f58a469e28d99a85bda787143a23f4adae995632283b2ec5269cbe38e3ffecd294448c675169c4ef10033afb6 diff --git a/app-admin/sagan/files/mysql_check.patch b/app-admin/sagan/files/mysql_check.patch new file mode 100644 index 000000000000..d2247aab571e --- /dev/null +++ b/app-admin/sagan/files/mysql_check.patch @@ -0,0 +1,26 @@ +diff --git a/configure.in b/configure.ac +rename from configure.in +rename to configure.ac +--- a/configure.in ++++ b/configure.ac +@@ -215,13 +215,17 @@ + AC_CHECK_LIB(pthread, main,,AC_MSG_ERROR(Sagan needs pthreads!)) + AC_CHECK_LIB(m, main,,AC_MSG_ERROR(Sagan needs libm!)) + ++save_LIBS=$LIBS + if test "$MYSQL" = "yes"; then + AC_MSG_RESULT([------- MySQL support is enabled -------]) ++ AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config) + AC_CHECK_HEADER([mysql/mysql.h]) + AC_CHECK_HEADER([mysql/errmsg.h]) +- AC_CHECK_LIB(mysqlclient_r, main,,AC_MSG_ERROR(The MySQL library libmysqlclient_r is missing! +-If you're not interested in MySQL support use the --disable-mysql flag.)) +- fi ++ LIBS=$(mysql_config --libs_r) ++ AC_CHECK_LIB(mysqlclient_r, main,,AC_MSG_ERROR(The MySQL library libmysqlclient_r is missing!)) ++fi ++LIBS="$save_LIBS $LIBS" ++ + + if test "$POSTGRES" = "yes"; then + AC_MSG_RESULT([------- PostgreSQL support is enabled -------]) diff --git a/app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch b/app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch new file mode 100644 index 000000000000..f9540652717a --- /dev/null +++ b/app-admin/sagan/files/sagan-1.0.0-liblognorm-json-c.patch @@ -0,0 +1,55 @@ +diff -rupN old/sagan-1.0.0RC3/configure.ac new/sagan-1.0.0RC3/configure.ac +--- old/sagan-1.0.0RC3/configure.ac 2014-06-16 22:23:22.000000000 +0200 ++++ new/sagan-1.0.0RC3/configure.ac 2015-10-11 21:04:26.493632624 +0200 +@@ -192,29 +192,15 @@ If you're not interested in libesmtp sup + fi + + if test "$LOGNORM" = "yes"; then +- AC_MSG_RESULT([------- liblognorm support is enabled -------]) +- AC_CHECK_HEADER([liblognorm.h]) +- AC_CHECK_HEADERS([json/json.h json.h], [break], [AC_MSG_ERROR([json-c headers not found or not usable. +-This library is important for the correlation aspects of Sagan! Please see +-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature +-use the --disable-lognorm flag.])]) +- AC_CHECK_LIB(estr, main,,AC_MSG_ERROR(The libestr library cannot be found. +-This library is important for the correlation aspects of Sagan! Please see +-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature +-use the --disable-lognorm flag. )) +- AC_CHECK_LIB(ee, main,,AC_MSG_ERROR(The libee library cannot be found. +-This library is important for the correlation aspects of Sagan! Please see +-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature +-use the --disable-lognorm flag. )) +- AC_CHECK_LIB(lognorm, main,,AC_MSG_ERROR(The liblognorm library cannot be found. +-This library is important for the correlation aspects of Sagan! Please see +-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature +-use the --disable-lognorm flag. )) +- AC_CHECK_LIB(json, json_object_put,, [ AC_CHECK_LIB(json-c, json_object_put,,AC_MSG_ERROR(The json library cannot be found. +-This library is important for the correlation aspects of Sagan! Please see +-https://wiki.quadrantsec.com/bin/view/Main/LibLogNorm. To disable this feature +-use the --disable-lognorm flag.)) ],) +- fi ++ AC_MSG_RESULT([------- liblognorm support is enabled -------]) ++ ++ PKG_CHECK_MODULES(LIBEE, libee >= 0.3.2) ++ PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.9) ++ PKG_CHECK_MODULES([JSON_C], [json-c],, [ ++ PKG_CHECK_MODULES([JSON_C], [json],,) ++ ]) ++ PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 1.0.2) ++fi + + if test "$LIBPCAP" = "yes"; then + AC_MSG_RESULT([------- libpcap support is enabled -------]) +diff -rupN old/sagan-1.0.0RC3/src/Makefile.am new/sagan-1.0.0RC3/src/Makefile.am +--- old/sagan-1.0.0RC3/src/Makefile.am 2014-06-16 22:23:22.000000000 +0200 ++++ new/sagan-1.0.0RC3/src/Makefile.am 2015-10-11 21:05:28.754492699 +0200 +@@ -2,6 +2,9 @@ AUTOMAKE_OPIONS=foreign no-dependencies + + bin_PROGRAMS = sagan + ++sagan_CFLAGS = $(JSON_C_CFLAGS) $(LIBESTR_CFLAGS) $(LIBLOGNORM_CFLAGS) ++sagan_LDFLAGS = $(JSON_C_LIBS) $(LIBESTR_LIBS) $(LIBLOGNORM_LIBS) ++ + sagan_SOURCES = sagan.c \ + sagan-classifications.c \ + sagan-config.c \ diff --git a/app-admin/sagan/files/sagan.confd b/app-admin/sagan/files/sagan.confd new file mode 100644 index 000000000000..cab6db55ccf0 --- /dev/null +++ b/app-admin/sagan/files/sagan.confd @@ -0,0 +1,9 @@ +# Copyright 1999-2011 Gentoo Foundation +# # Distributed under the terms of the GNU General Public License v2 + +# Sagan daemon configuration file +# Make debug mode +# SAGAN_OPTS = " --debug " +# +# Run as user, default sagan +SAGAN_USER="sagan" diff --git a/app-admin/sagan/files/sagan.init b/app-admin/sagan/files/sagan.init new file mode 100644 index 000000000000..99f1f24e3bfa --- /dev/null +++ b/app-admin/sagan/files/sagan.init @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/var/run/sagan/sagan.pid" +command="/usr/bin/sagan" +command_args="-D \"${SAGAN_OPTS}\" -u \"${SAGAN_USER}\"" + +depend() { + use logger mysql postgresql + need localmount +} + +start_pre() { + checkpath -d -o sagan /var/run/sagan + checkpath -p -o sagan -m 0644 /var/run/sagan/sagan.fifo +} diff --git a/app-admin/sagan/files/sagan.init-r1 b/app-admin/sagan/files/sagan.init-r1 new file mode 100644 index 000000000000..f0d556583c43 --- /dev/null +++ b/app-admin/sagan/files/sagan.init-r1 @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/var/run/sagan/sagan.pid" +command="/usr/bin/sagan" +command_args="-D \"${SAGAN_OPTS}\" -u \"${SAGAN_USER}\"" + +depend() { + use logger mysql postgresql + need localmount +} + +start_pre() { + checkpath -d -o sagan /run/sagan + checkpath -p -o sagan -m 0644 /run/sagan/sagan.fifo +} diff --git a/app-admin/sagan/metadata.xml b/app-admin/sagan/metadata.xml new file mode 100644 index 000000000000..3e12feb4a2b3 --- /dev/null +++ b/app-admin/sagan/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>maksbotan@gentoo.org</email> + <name>Maxim Koltsov</name> + </maintainer> + <use> + <flag name="smtp">Build witch SMTP (E-Mail) support</flag> + <flag name="lognorm">Add support for log/rules normalizations via <pkg>dev-libs/liblognorm</pkg></flag> + <flag name="pcap">Add support for network packet capture via <pkg>net-libs/libpcap</pkg></flag> + <flag name="libdnet">Add support for <pkg>dev-libs/libdnet</pkg></flag> + <flag name="snort">Add support to interact with Snort IDE using <pkg>net-analyzer/snortsam</pkg>'</flag> + </use> +</pkgmetadata> diff --git a/app-admin/sagan/sagan-0.2.3.ebuild b/app-admin/sagan/sagan-0.2.3.ebuild new file mode 100644 index 000000000000..64c6a49c8ba3 --- /dev/null +++ b/app-admin/sagan/sagan-0.2.3.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +AUTOTOOLS_AUTORECONF=1 +AUTOTOOLS_IN_SOURCE_BUILD=1 + +inherit eutils autotools-utils user + +DESCRIPTION="Sagan is a multi-threaded, real time system and event log monitoring system" +HOMEPAGE="http://sagan.quadrantsec.com/" +SRC_URI="http://sagan.quadrantsec.com/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="+libdnet +lognorm mysql +pcap postgres smtp snort" + +RDEPEND="dev-libs/libpcre + app-admin/sagan-rules[lognorm?] + smtp? ( net-libs/libesmtp ) + pcap? ( net-libs/libpcap ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql:* ) + lognorm? ( dev-libs/liblognorm ) + libdnet? ( dev-libs/libdnet ) + snort? ( >=net-analyzer/snortsam-2.50 ) + " + +DEPEND="virtual/pkgconfig + ${RDEPEND}" + +DOCS=( AUTHORS ChangeLog FAQ INSTALL README NEWS TODO ) +PATCHES=( "${FILESDIR}"/mysql_check.patch ) + +pkg_setup() { + enewgroup sagan + enewuser sagan -1 -1 /dev/null sagan +} + +src_configure() { + local myeconfargs=( + $(use_enable mysql) + $(use_enable postgres postgresql) + $(use_enable smtp esmtp) + $(use_enable lognorm) + $(use_enable libdnet) + $(use_enable pcap libpcap) + $(use_enable snort snortsam) + --disable-prelude + ) + + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + diropts -g sagan -o sagan -m 775 + + dodir /var/log/sagan + + keepdir /var/log/sagan + + touch "${ED}"/var/log/sagan/sagan.log + chown sagan.sagan "${ED}"/var/log/sagan/sagan.log + + newinitd "${FILESDIR}"/sagan.init sagan + newconfd "${FILESDIR}"/sagan.confd sagan + + insinto /usr/share/doc/${PF}/examples + doins -r extra/* +} + +pkg_postinst() { + if use smtp; then + ewarn "You have enabled smtp use flag. If you plan on using Sagan with" + ewarn "email, create valid writable home directory for user 'sagan'" + ewarn "For security reasons it was created with /dev/null home directory" + fi + + einfo "For configuration assistance see" + einfo "http://wiki.quadrantsec.com/bin/view/Main/SaganHOWTO" +} diff --git a/app-admin/sagan/sagan-1.0.0_rc3.ebuild b/app-admin/sagan/sagan-1.0.0_rc3.ebuild new file mode 100644 index 000000000000..da136ef46dc2 --- /dev/null +++ b/app-admin/sagan/sagan-1.0.0_rc3.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +AUTOTOOLS_AUTORECONF=1 +AUTOTOOLS_IN_SOURCE_BUILD=1 + +inherit eutils autotools-utils user + +DESCRIPTION="Sagan is a multi-threaded, real time system and event log monitoring system" +HOMEPAGE="http://sagan.quadrantsec.com/" +SRC_URI="http://sagan.quadrantsec.com/download/sagan-1.0.0RC3.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="geoip +libdnet +lognorm mysql +pcap smtp snort" + +RDEPEND="dev-libs/libpcre + app-admin/sagan-rules[lognorm?] + smtp? ( net-libs/libesmtp ) + pcap? ( net-libs/libpcap ) + mysql? ( virtual/mysql ) + lognorm? ( + dev-libs/liblognorm + dev-libs/json-c:= + dev-libs/libee + dev-libs/libestr + ) + libdnet? ( dev-libs/libdnet ) + snort? ( >=net-analyzer/snortsam-2.50 ) + geoip? ( dev-libs/geoip ) + " + +DEPEND="virtual/pkgconfig + ${RDEPEND}" + +DOCS=( AUTHORS ChangeLog FAQ INSTALL README NEWS TODO ) +PATCHES=( "${FILESDIR}"/${PN}-1.0.0-liblognorm-json-c.patch ) +S="${WORKDIR}/sagan-1.0.0RC3/" + +pkg_setup() { + enewgroup sagan + enewuser sagan -1 -1 /dev/null sagan +} + +src_configure() { + local myeconfargs=( + $(use_enable smtp esmtp) + $(use_enable lognorm) + $(use_enable libdnet) + $(use_enable pcap libpcap) + $(use_enable snort snortsam) + $(use_enable geoip) + ) + + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + diropts -g sagan -o sagan -m 775 + + dodir /var/log/sagan + + keepdir /var/log/sagan + + touch "${ED}"/var/log/sagan/sagan.log + chown sagan.sagan "${ED}"/var/log/sagan/sagan.log + + newinitd "${FILESDIR}"/sagan.init-r1 sagan + newconfd "${FILESDIR}"/sagan.confd sagan + + insinto /usr/share/doc/${PF}/examples + doins -r extra/* +} + +pkg_postinst() { + if use smtp; then + ewarn "You have enabled smtp use flag. If you plan on using Sagan with" + ewarn "email, create valid writable home directory for user 'sagan'" + ewarn "For security reasons it was created with /dev/null home directory" + fi + + einfo "For configuration assistance see" + einfo "http://wiki.quadrantsec.com/bin/view/Main/SaganHOWTO" +} |