diff --git a/net/neighbot/Makefile b/net/neighbot/Makefile new file mode 100644 index 00000000000..9d68c873fe0 --- /dev/null +++ b/net/neighbot/Makefile @@ -0,0 +1,34 @@ +COMMENT = network neighbor monitoring daemon + +V = 0.5.5 +DISTNAME = neighbot-${V} + +CATEGORIES = net + +HOMEPAGE = https://github.com/renaudallard/neighbot +SITES = https://github.com/renaudallard/neighbot/releases/download/v${V}/ + +MAINTAINER = Renaud Allard + +# BSD +PERMIT_PACKAGE = Yes + +# uses pledge() and unveil() +WANTLIB = c pcap + +RUN_DEPENDS = net/arp-scan,-mac + +NO_TEST = Yes + +MAKE_FLAGS = CC="${CC}" CFLAGS="${CFLAGS}" PREFIX="${PREFIX}" + +ALL_TARGET = all + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/neighbot ${PREFIX}/sbin/neighbot + ${INSTALL_MAN} ${WRKSRC}/neighbot.8 ${PREFIX}/man/man8/neighbot.8 + ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/neighbot + ${INSTALL_DATA} /dev/null \ + ${PREFIX}/share/examples/neighbot/neighbot.csv + +.include diff --git a/net/neighbot/distinfo b/net/neighbot/distinfo new file mode 100644 index 00000000000..32e8641f31d --- /dev/null +++ b/net/neighbot/distinfo @@ -0,0 +1,2 @@ +SHA256 (neighbot-0.5.5.tar.gz) = JIuTdzAHXdew/QdcJvt3c5gFBnt+N541dzbOtTXGIhA= +SIZE (neighbot-0.5.5.tar.gz) = 44884 diff --git a/net/neighbot/pkg/DESCR b/net/neighbot/pkg/DESCR new file mode 100644 index 00000000000..24bb22559ec --- /dev/null +++ b/net/neighbot/pkg/DESCR @@ -0,0 +1,7 @@ +Neighbot passively monitors ARP (IPv4) and NDP (IPv6) traffic on all +Ethernet interfaces. It maintains a CSV database of IP-to-MAC address +mappings and sends email alerts when new stations appear or existing +mappings change. + +On OpenBSD, neighbot uses pledge(2) and unveil(2) to restrict its +privileges after initialization. diff --git a/net/neighbot/pkg/PLIST b/net/neighbot/pkg/PLIST new file mode 100644 index 00000000000..2923663dbfc --- /dev/null +++ b/net/neighbot/pkg/PLIST @@ -0,0 +1,12 @@ +@newgroup _neighbot:904 +@newuser _neighbot:904:_neighbot::neighbot daemon:/var/empty:/sbin/nologin +@rcscript ${RCDIR}/neighbot +@man man/man8/neighbot.8 +@bin sbin/neighbot +share/examples/neighbot/ +@owner _neighbot +@group _neighbot +@sample /var/neighbot/ +share/examples/neighbot/neighbot.csv +@mode 644 +@sample /var/neighbot/neighbot.csv diff --git a/net/neighbot/pkg/neighbot.rc b/net/neighbot/pkg/neighbot.rc new file mode 100644 index 00000000000..97448d496f6 --- /dev/null +++ b/net/neighbot/pkg/neighbot.rc @@ -0,0 +1,14 @@ +#!/bin/ksh + +daemon="${TRUEPREFIX}/sbin/neighbot -d" +daemon_flags="-u _neighbot -o ${TRUEPREFIX}/share/arp-scan/ieee-oui.txt" + +. /etc/rc.d/rc.subr + +rc_reload=NO + +rc_pre() { + install -d -o _neighbot -g _neighbot ${LOCALSTATEDIR}/neighbot +} + +rc_cmd $1