diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/barnyard |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/barnyard')
-rw-r--r-- | net-analyzer/barnyard/Manifest | 9 | ||||
-rw-r--r-- | net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild | 99 | ||||
-rw-r--r-- | net-analyzer/barnyard/files/barnyard.64bit.diff | 81 | ||||
-rw-r--r-- | net-analyzer/barnyard/files/barnyard.confd | 19 | ||||
-rw-r--r-- | net-analyzer/barnyard/files/barnyard.rc6 | 29 | ||||
-rw-r--r-- | net-analyzer/barnyard/metadata.xml | 16 |
6 files changed, 253 insertions, 0 deletions
diff --git a/net-analyzer/barnyard/Manifest b/net-analyzer/barnyard/Manifest new file mode 100644 index 000000000000..42fb3f9d3cc9 --- /dev/null +++ b/net-analyzer/barnyard/Manifest @@ -0,0 +1,9 @@ +AUX barnyard.64bit.diff 3625 SHA256 69213f4beac73dfe1181b4692928d7e544d71893fcdc1839fa88c49b29f13576 SHA512 f445a91759b0a1f72588f5be27ecf5bb016f01c7ce30380c2e3026c304d45eb122616d5bf4905f4ec9aebd48fa3267223be6e08092ba3d50c58663be63e36a14 WHIRLPOOL 1be576d5df78deb556d204ee2e482cf54f92e020baf24e3d5b343b3d07ba23ce819de9077cb4281bd5a7e5e7e31d7c577e3a54083a0367dfa2caa1e87ede9eb8 +AUX barnyard.confd 663 SHA256 657deeb7046a72b60cb9ccabc66a8bb85fbcbfe792b919d62de48641d776d078 SHA512 7d4f12f04a128525a2f1f329619e919add917a6ceb62a70cb082f7d9013ad17f8f9cb4ea4098ce622060e4374343c786d6efb444b7a9d20aecbdb73a7ed14536 WHIRLPOOL a70b6eb03d48a4515105632b14e7191d908059244a3e6d61c7e3400d562e406afaf167d9a18439aa081e3875f84a619a1041e9ad31147708bf62fdeef5268e5b +AUX barnyard.rc6 620 SHA256 159db5b609aeaccc1b964c94e019fea6dc838de268f0cd85eaf2f42996ef9aa1 SHA512 8dacb73e749b49fe3dbef061a8d5dea5d3f3861a290c846a892264eb2ebf75034121efaff91a352b6ab4639fab76ff11eeb39ce31f407a4d617c9c114e1862f5 WHIRLPOOL 21a8850ab10496b3eb323809b6c12bb354a714d6ade4a90936c5977ef5b8585c8cd96c6fad655358ee7f02cb5b15b5ccfe3ec14a7a025709de25b3863e31a47c +DIST barnyard-0.2.0-patches.tar.bz2 12911 SHA256 cecc0c983899d12ae217232e2cd34d86e780b4be34ac36ccb3f73a1b954ea6f0 SHA512 e8e5243d49b71dd76e3274e27116f99ea6c674983cb18499889c9d27a83740a6b17aa6d30c8a9acdb46103da8314679f4eba8bf1cd252d7fb6b8a34afac46b21 WHIRLPOOL 6e42d6049e5b3e12b4d88ba1e89db7bbde7bfb325a5eaa4b25e2ff79f993c50edbe256b4a0bba22cfdb9beb0dd7d3f1476de2f689e87a5dfb7d7838ee3e9b6af +DIST barnyard-0.2.0.tar.gz 161543 SHA256 09e0f8e095e79cfe70ea069d13e7d02521a504a1f400a45556a634dccfd31a3a SHA512 73424acf2e0c620b2f8f2f407d74812f7740234ce523e37557273998108c131311fffb16cfc2cea0f652d6b21072431081bad35b045f5654e2245786d27568e6 WHIRLPOOL 0c1dc3aeeca64ba8ced705238d3d760168de45f961ef97b8e919d3f40da84dd9fd2496d700d7be23cf148a9cd3cc0b3da4f78d15a93cfada384536e5779bf0ed +EBUILD barnyard-0.2.0-r3.ebuild 2276 SHA256 ff7afa3458f57ac1414fb8873beb696fd4e69ce2576d5907ea56c5a5a35f70f1 SHA512 1067a1255a39adec1c37a5a0067b527ac281b939b5577def41e0a558002b46279562d104e5c807719ce10adc91a8fc194f950548bf99c08f43670527886c6cfe WHIRLPOOL 7107aeacf2eec9a66bf69713aa2fc1268fcbf229aaefc4eb098fda1a6d0cbb5b39b9c717100917d56544efc5725f07d99f979dc414adb42708bed50094f39f5d +MISC ChangeLog 2759 SHA256 3f108b0e45b7ead4b94a4e50efed7d93f62d2213cbbea01eb1cf2ef2fca2b20a SHA512 dde46e04bbfc57309518026fe30547dd59bae3dc6636d8c9e9e87c69999f7a413c0a782787cb0e56838f67cef475b081e292e3dc7078d7a5fcad2a90ebd9c261 WHIRLPOOL aae615142b11c195c1f771937fe071dbb959078aa3097218a5a64b84895007d823e2e11c906b1a5d1fbbc7618f01be4688abd4802ae4563d68c1223990846fa1 +MISC ChangeLog-2015 5049 SHA256 91aaa3220c3bb6a784fdbccc1c91468ab3757f617d5b87ef88dcef8c82b60668 SHA512 049d2cec4e95ee46967af8c2c4e5938f9d1d99c706618647709c7bef6be918df462e8ff4502b16baf80a3e9f6d4af65f9b6a43d62297636138158ea53e08fc0b WHIRLPOOL b66dc04388cabbd1916d2254491dd2b98699aba3fb1cd2ff48cec18f005db202599e64496cf6804729b81835488b2d046691588fbb905173c51f9e8babc5e360 +MISC metadata.xml 541 SHA256 f87085a687632ed3901f8e20e96018cf1e1fe9507f4120bade8cc1ebd356bd83 SHA512 7a936ec510957c8fb449857a12ff6c54b7498657af33244fcd0759c0786adc9523fda42e6a5e46b0a36c57144f9a2dc2d4179624b1fa700fac53fe83d0d73b1a WHIRLPOOL 10db3093321dfc1a78ec8bd945b351a5948feaf65d70d0d822e72189c1826f9f80625035230603d237a0e4c04dc05cafc12738a6576a7e50d72c8982c4a607d6 diff --git a/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild b/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild new file mode 100644 index 000000000000..52e010ccc6b7 --- /dev/null +++ b/net-analyzer/barnyard/barnyard-0.2.0-r3.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=2 + +inherit eutils autotools + +DESCRIPTION="Fast output system for Snort" +HOMEPAGE="https://sourceforge.net/projects/barnyard" +SRC_URI=" + mirror://sourceforge/barnyard/barnyard-${PV/_/-}.tar.gz + mirror://gentoo/${P}-patches.tar.bz2" + +SLOT="0" +LICENSE="QPL GPL-2" +KEYWORDS="~amd64 -sparc ~x86" +IUSE="mysql postgres sguil" + +DEPEND=" + net-libs/libpcap + postgres? ( dev-db/postgresql[server] ) + mysql? ( virtual/mysql ) + sguil? ( dev-lang/tcl:0 )" +RDEPEND="${DEPEND} + net-analyzer/snort" + +S="${WORKDIR}/${P/_/-}" + +src_prepare() { + epatch "${FILESDIR}/barnyard.64bit.diff" + if use sguil ; then + epatch "${WORKDIR}/${PV}-sguil_files.patch" + epatch "${WORKDIR}/${PV}-configure-in.patch" + cd "${S}/src/output-plugins" + epatch "${WORKDIR}/${PV}-op_plugbase.c.patch" + cd "${S}" + fi + eautoreconf +} + +src_configure() { + local myconf + if use sguil ; then + myconf="--enable-tcl" + fi + + econf \ + ${myconf} \ + --sysconfdir=/etc/snort \ + $(use_enable postgres) \ + $(use_enable mysql) +} +src_compile() { + emake || die "compile problem" +} + +src_install () { + + make DESTDIR="${D}" install || die + + dodoc docs/* + dodoc AUTHORS README + + keepdir /var/log/snort + keepdir /var/log/snort/archive + + insinto /etc/snort + newins etc/barnyard.conf barnyard.conf + if use sguil ; then + sed -i -e "/config hostname:/s%snorthost%$(hostname)%" \ + -e "/config interface/s:fxp0:eth0:" \ + -e "s:output alert_fast:#output alert_fast:" \ + -e "s:output log_dump:#output log_dump:" \ + "${D}/etc/snort/barnyard.conf" || die "sed failed" + fi + + newconfd "${FILESDIR}"/barnyard.confd barnyard + if use sguil ; then + sed -i -e s:/var/log/snort:/var/lib/sguil/$(hostname): \ + -e s:/var/run/barnyard.pid:/var/run/sguil/barnyard.pid: \ + "${D}/etc/conf.d/barnyard" || die "sed failed" + fi + + newinitd "${FILESDIR}"/barnyard.rc6 barnyard + if use sguil ; then + sed -i -e "/start-stop-daemon --start/s:--exec:-c sguil --exec:" \ + "${D}/etc/init.d/barnyard" || die "sed failed" + fi +} + +pkg_postinst() { + if use sguil ; then + elog + elog "Make sure to edit /etc/snort/barnyard.conf and uncomment the" + elog "sguil section along with supplying the appropriate database" + elog "information." + elog + fi +} diff --git a/net-analyzer/barnyard/files/barnyard.64bit.diff b/net-analyzer/barnyard/files/barnyard.64bit.diff new file mode 100644 index 000000000000..f338d291ff1c --- /dev/null +++ b/net-analyzer/barnyard/files/barnyard.64bit.diff @@ -0,0 +1,81 @@ +diff -ur barnyard-0.2.0/src/barnyard.h barnyard-0.2.0.64bit/src/barnyard.h +--- barnyard-0.2.0/src/barnyard.h 2004-05-01 12:43:29.000000000 -0400 ++++ barnyard-0.2.0.64bit/src/barnyard.h 2007-08-11 23:22:53.000000000 -0400 +@@ -34,7 +34,8 @@ + + typedef struct _SnortPktHeader + { +- struct timeval ts; /* packet timestamp */ ++ // struct timeval ts; /* packet timestamp */ ++ struct pcap_timeval ts; /* packet timestamp */ + u_int32_t caplen; /* packet capture length */ + u_int32_t pktlen; /* packet "real" length */ + } SnortPktHeader; +Only in barnyard-0.2.0.64bit/src: barnyard.h~ +diff -ur barnyard-0.2.0/src/event.h barnyard-0.2.0.64bit/src/event.h +--- barnyard-0.2.0/src/event.h 2003-05-02 22:44:12.000000000 -0400 ++++ barnyard-0.2.0.64bit/src/event.h 2007-08-12 00:13:44.000000000 -0400 +@@ -19,6 +19,11 @@ + #include <sys/types.h> + #include <sys/time.h> + ++struct pcap_timeval { ++ u_int32_t tv_sec; /* seconds */ ++ u_int32_t tv_usec; /* microseconds */ ++}; ++ + typedef struct _Event + { + u_int32_t sig_generator; /* which part of snort generated the alert? */ +@@ -30,6 +35,7 @@ + u_int32_t event_reference; /* reference to other events that have gone off, + * such as in the case of tagged packets... + */ +- struct timeval ref_time; /* reference time for the event reference */ ++ // struct timeval ref_time; /* reference time for the event reference */ ++ struct pcap_timeval ref_time; /* reference time for the event reference */ + } Event; + #endif /* __EVENT_H__ */ +Only in barnyard-0.2.0.64bit/src: event.h~ +diff -ur barnyard-0.2.0/src/input-plugins/dp_alert.h barnyard-0.2.0.64bit/src/input-plugins/dp_alert.h +--- barnyard-0.2.0/src/input-plugins/dp_alert.h 2004-02-19 20:59:48.000000000 -0500 ++++ barnyard-0.2.0.64bit/src/input-plugins/dp_alert.h 2007-08-11 23:24:25.000000000 -0400 +@@ -34,7 +34,8 @@ + typedef struct _UnifiedAlertRecord + { + Event event; +- struct timeval ts; /* event timestamp */ ++ // struct timeval ts; /* event timestamp */ ++ struct pcap_timeval ts; /* event timestamp */ + u_int32_t sip; /* src ip */ + u_int32_t dip; /* dest ip */ + u_int16_t sp; /* src port */ +Only in barnyard-0.2.0.64bit/src/input-plugins: dp_alert.h~ +diff -ur barnyard-0.2.0/src/util.c barnyard-0.2.0.64bit/src/util.c +--- barnyard-0.2.0/src/util.c 2004-03-06 17:30:15.000000000 -0500 ++++ barnyard-0.2.0.64bit/src/util.c 2007-08-12 00:14:52.000000000 -0400 +@@ -514,7 +514,8 @@ + + static char tmpbuf[256]; + +-int RenderTimeval(struct timeval *tv, char *timebuf, size_t len) ++// int RenderTimeval(struct timeval *tv, char *timebuf, size_t len) ++int RenderTimeval(struct pcap_timeval *tv, char *timebuf, size_t len) + { + struct tm *lt; + time_t timet; +Only in barnyard-0.2.0.64bit/src: util.c~ +diff -ur barnyard-0.2.0/src/util.h barnyard-0.2.0.64bit/src/util.h +--- barnyard-0.2.0/src/util.h 2004-03-06 19:23:50.000000000 -0500 ++++ barnyard-0.2.0.64bit/src/util.h 2007-08-11 23:23:46.000000000 -0400 +@@ -39,7 +39,8 @@ + void ClearDumpBuf(); + void GoDaemon(); + size_t RenderTimestamp(time_t timet, char *timebuf, size_t len); +-int RenderTimeval(struct timeval *tv, char *timebuf, size_t len); ++// int RenderTimeval(struct timeval *tv, char *timebuf, size_t len); ++int RenderTimeval(struct pcap_timeval *tv, char *timebuf, size_t len); + int CreatePidFile(char *filename); + int String2Long(char *string, long *result); + int String2ULong(char *string, unsigned long *result); +Only in barnyard-0.2.0.64bit/src: util.h~ diff --git a/net-analyzer/barnyard/files/barnyard.confd b/net-analyzer/barnyard/files/barnyard.confd new file mode 100644 index 000000000000..be0013cb1fe9 --- /dev/null +++ b/net-analyzer/barnyard/files/barnyard.confd @@ -0,0 +1,19 @@ +# Config file for /etc/init.d/barnyard +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE="/var/run/barnyard.pid" +LOG_FILE="snort_unified.log" + +# You probably don't want to change this, but in case you do +LOGDIR="/var/log/snort" +ARCHIVEDIR="$LOGDIR/archive" +GENMSG_FILE="/etc/snort/gen-msg.map" +SIDMSG_FILE="/etc/snort/sid-msg.map" +WALDO_FILE="$LOGDIR/barnyard.waldo" + +# Probably not this either +CONF=/etc/snort/barnyard.conf + +# This pulls in the options above +BARNYARD_OPTS="-D -c $CONF -d $LOGDIR -g $GENMSG_FILE -s $SIDMSG_FILE -w $WALDO_FILE -L $LOGDIR -a $ARCHIVEDIR -f $LOG_FILE -X $PIDFILE" diff --git a/net-analyzer/barnyard/files/barnyard.rc6 b/net-analyzer/barnyard/files/barnyard.rc6 new file mode 100644 index 000000000000..abe42a194a60 --- /dev/null +++ b/net-analyzer/barnyard/files/barnyard.rc6 @@ -0,0 +1,29 @@ +#!/sbin/openrc-run +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +checkconfig() { + if [ ! -e $CONF ] ; then + eerror "You need a configuration file to run barnyard" + eerror "There is an example config in /etc/snort/barnyard.conf.distrib" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting barnyard" + start-stop-daemon --start --quiet --exec /usr/bin/barnyard \ + -- ${BARNYARD_OPTS} >/dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Stopping barnyard" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + eend $? +} diff --git a/net-analyzer/barnyard/metadata.xml b/net-analyzer/barnyard/metadata.xml new file mode 100644 index 000000000000..f2d12be5195d --- /dev/null +++ b/net-analyzer/barnyard/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>netmon@gentoo.org</email> + <name>Gentoo network monitoring and analysis project</name> + </maintainer> + <longdescription>Fast output system for Snort</longdescription> + <use> + <flag name="sguil">Enable sguil (The Analyst Console for Network Security +Monitoring) support</flag> + </use> + <upstream> + <remote-id type="sourceforge">barnyard</remote-id> + </upstream> +</pkgmetadata> |