summaryrefslogtreecommitdiff
path: root/net-misc/ip-sentinel
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/ip-sentinel
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/ip-sentinel')
-rw-r--r--net-misc/ip-sentinel/Manifest8
-rw-r--r--net-misc/ip-sentinel/files/ip-sentinel.cfg11
-rw-r--r--net-misc/ip-sentinel/files/ip-sentinel.conf.d11
-rw-r--r--net-misc/ip-sentinel/files/ip-sentinel.init49
-rw-r--r--net-misc/ip-sentinel/ip-sentinel-0.12.ebuild67
-rw-r--r--net-misc/ip-sentinel/metadata.xml23
6 files changed, 169 insertions, 0 deletions
diff --git a/net-misc/ip-sentinel/Manifest b/net-misc/ip-sentinel/Manifest
new file mode 100644
index 000000000000..99121e696547
--- /dev/null
+++ b/net-misc/ip-sentinel/Manifest
@@ -0,0 +1,8 @@
+AUX ip-sentinel.cfg 278 SHA256 e27ccda1fbdd551d71cbd0d15d8ae0ed40fb256aef549840bee0eb184d0e95e5 SHA512 315181c3ad90f677bb2ebca2309ae98cceb33ee74b0bae48138283c77612657a632af05a4467994b5b0981e835262f178515dfe8fb6787b4067ff749f97359d5 WHIRLPOOL 1d607e11a70f46f338f54cd366b151cf9659df66bc9ec395c1451f4c35f0c8c7fc5da44570179e7bf2c8f7b5babd3df3e5baccb53fef24c1e58534df35d3ffa5
+AUX ip-sentinel.conf.d 357 SHA256 9b694f986093ad4d25d2102b0a09729d6c9814d2e4116eac63f595383b7fa8c5 SHA512 c35614e812cc0b3caea671cf2703493030f6de96f8b5afc80455c93f3e6181ddaf7eb6c22d8b63244f219b506db4bddfdf9792bf89ec17d7c56d274d003d4506 WHIRLPOOL 661acacc217f3aaf24ae83fad6b45ee19357319d84d2dd9bfece671a0687659cd00da795cb7ee6e5477ca19f11349379bbaeebc0aed11d2c9826b7a3d564c7c5
+AUX ip-sentinel.init 1051 SHA256 1093cee9812247ca60fff11464adb34f84141b1453971ea914225e5ede3cdd21 SHA512 025be17c390e0e07b60bd4dcc1c8ed33dbb51f53b1dc4037b25b9a1275c2b7043cf5e147124f3ef11481771c20ad20a0fcd9543cbab5294fd412192ad221257a WHIRLPOOL 8f78f91d08106ddba21d3e08a7ccdd913989b1a574c34bbc0412c850009b33d9d012adcf2ef68a3202e4e9ec3665c83a8432142d881db376270e3beb68be071f
+DIST ip-sentinel-0.12.tar.bz2 165803 SHA256 1767fe155280361804cf1a62b2f77228bd764452668783050b6309cca888fb22 SHA512 dfa025fd96260073903ffe33dbaa5a146658dee2b8cb9bc04da0894a8de83207971a7f1e731128e42a0421052cdc352ed43a0298916f521d5f230533266e5077 WHIRLPOOL 5e377d38b5a6c5a70bc23044fa5103efdf48a3511df76ab7435e9445e5e85c2b910bd40bb6af2e0e40ab455c78754e7e97954f99a504a14e060086c6fbd27557
+EBUILD ip-sentinel-0.12.ebuild 2077 SHA256 4cbe2626aac9f998383dfee8b7b6b3f386999fe7f48e83d474779fb19b8c080f SHA512 09d5f004cc90df5f0460b8dfaddcd32e928d9b86e23e616acc784d02b7d77647d36de332c7f5c07cd784866b6c2926df46608123a4fe61543fa2d0765937b09e WHIRLPOOL 058be7ee2eb0236d2906e03736b7a1b8c0ddb2d9d4522c435b1dd829a00d4ffbd15adaf81bec894ff97ebad28acfa68519642f602d9bb49719a97972d02385dd
+MISC ChangeLog 2757 SHA256 cd8ea3b449ff3ef529952a61c73902292115af1dd5112de2797bf2829455aa76 SHA512 bb9d4e517572712261b44adb27d5606a802f72c74e79e838e262f02803bcac2e23f13104f61c5671868f42423fb3a0689467d5904a453ad16cbdb0422a830233 WHIRLPOOL 959a7532a031f299516596498d35cedb3b2a88ba0403e0229bc52d15424c6024af0e806eddfe1317581ba391beded43ecfb453e9e0e74e099a2d58d2854e33af
+MISC ChangeLog-2015 1863 SHA256 2f80c7ccd626017cb76fb7e3045db13cea2599d4392f2533a04fa51a85044a48 SHA512 ea0a7bae34d5342b9ff485f3361f8873a9a9b56ca91f48f9903b2c92bbbed490f517dd0c98b3cb1879b85b2eab4cb42986e0f50e7dd78bec159c95c0bf7f7098 WHIRLPOOL 9372047b3a9a3ca8d56c91ce55e8f174685f03bada0b2594ae4fb05f82d5c88484caff3f6136f142eff08f9e68af586dad562fa05bdbb122de4c0e53e1382e67
+MISC metadata.xml 1303 SHA256 50c75eec93bbf4740af949408b34571dbf82e056b65c26598493e1eddd774484 SHA512 9ca404d2b97faf88cf40cf991584dfb1888e78b41817cc6dacfb2ac2bf13afdbb9c8496f61236e85ce2932c12d889975758108df0229760a16fa4478e5c0ffed WHIRLPOOL fb875852d838863533d4c31f7e79f140b5d530877360d4629415b82e24234a0d4f59eab7e7dc84eed2cad20a0f54cc0dcea303bfeadc104747e640f94cc41b06
diff --git a/net-misc/ip-sentinel/files/ip-sentinel.cfg b/net-misc/ip-sentinel/files/ip-sentinel.cfg
new file mode 100644
index 000000000000..f767cd1d0d5f
--- /dev/null
+++ b/net-misc/ip-sentinel/files/ip-sentinel.cfg
@@ -0,0 +1,11 @@
+# This is configuration file for ip-sentinel
+
+# Next line blocks all computers inside network
+0.0.0.0/0
+
+# Now please add computers that are allowed to communicate
+# ! denotes not to block
+!10.10.146.1
+!10.10.146.236@be:ef:de:ad:be:ef
+
+# see "man ip-sentinel" for more details.
diff --git a/net-misc/ip-sentinel/files/ip-sentinel.conf.d b/net-misc/ip-sentinel/files/ip-sentinel.conf.d
new file mode 100644
index 000000000000..d61fc9f5bfc9
--- /dev/null
+++ b/net-misc/ip-sentinel/files/ip-sentinel.conf.d
@@ -0,0 +1,11 @@
+# Configure which interface for ip-sentinel to listen on.
+IFACE="eth0"
+
+# Insert any other options needed
+OPTS=""
+
+# If you wish to run ip-sentinel in a chroot, run:
+# emerge --config =net-misc/<ip-sentinel-version>
+# and un-comment the following line.
+# You can specify a different chroot directory but MAKE SURE it's empty.
+# CHROOT="/chroot/ip-sentinel"
diff --git a/net-misc/ip-sentinel/files/ip-sentinel.init b/net-misc/ip-sentinel/files/ip-sentinel.init
new file mode 100644
index 000000000000..923cedeac13c
--- /dev/null
+++ b/net-misc/ip-sentinel/files/ip-sentinel.init
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CFG_FILE="/etc/ip-sentinel.cfg"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f "${CFG_FILE}" ] ; then
+ eerror "File ${CFG_FILE} does not exists!"
+ return 1
+ fi
+
+ if [ -n "${CHROOT}" ] ; then
+ local_opts="--user ipsentinel --group ipsentinel -r ${CHROOT}"
+ else
+ local_opts="--user ipsentinel --group ipsentinel -r /"
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ip-sentinel..."
+ start-stop-daemon --start --quiet --exec /usr/sbin/ip-sentinel -- --ipfile ${CFG_FILE} ${local_opts} $OPTS $IFACE &
+ eend $? "Failed to start ip-sentinel"
+}
+
+stop() {
+ ebegin "Stoping ip-sentinel..."
+ start-stop-daemon --stop --quiet --pidfile /var/run/ip-sentinel.run
+ eend $? "Failed to stop ip-sentinel"
+}
+
+restart () {
+ svc_stop
+ echo "Please, wait while child process quit..."
+ while `ps aux | grep -v 'init.d' | grep [i]p-sentinel >/dev/null`
+ do
+ echo -n ". "
+ sleep 1
+ done
+ echo "[Done]"
+ svc_start
+}
+
diff --git a/net-misc/ip-sentinel/ip-sentinel-0.12.ebuild b/net-misc/ip-sentinel/ip-sentinel-0.12.ebuild
new file mode 100644
index 000000000000..97256539afd6
--- /dev/null
+++ b/net-misc/ip-sentinel/ip-sentinel-0.12.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils user
+
+DESCRIPTION="Prevent unauthorized usage of IPs in the local ethernet broadcastdomain by answering ARP-requests"
+HOMEPAGE="http://www.nongnu.org/ip-sentinel/"
+LICENSE="GPL-2"
+SRC_URI="https://savannah.nongnu.org/download/ip-sentinel/${P}.tar.bz2"
+SLOT="0"
+KEYWORDS="x86"
+
+DOCS=( AUTHORS ChangeLog NEWS README THANKS )
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/ip-sentinel.init ip-sentinel
+ newconfd "${FILESDIR}"/ip-sentinel.conf.d ip-sentinel
+
+ insinto /etc
+ newins "${FILESDIR}"/ip-sentinel.cfg ip-sentinel.cfg
+}
+
+pkg_setup() {
+ enewgroup ipsentinel
+ enewuser ipsentinel -1 -1 -1 ipsentinel
+}
+
+pkg_postinst() {
+ elog "You can edit /etc/conf.d/ip-sentinel to customize startup daemon"
+ elog "settings."
+ elog
+ elog "Default ip-sentinel config is in /etc/ip-sentinel.cfg"
+ elog
+ elog "The ip-sentinel ebuild has chroot support."
+ elog "If you like to run ip-sentinel in chroot AND this is a new install OR"
+ elog "your ip-sentinel doesn't already run in chroot, simply run:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Before running the above command you might want to change the chroot"
+ elog "dir in /etc/conf.d/ip-sentinel, otherwise /chroot/ip-sentinel will be used."
+ echo
+ ewarn "And please! DO NOT START THIS DAEMON thoughtlessly."
+ ewarn "If you DO this will BLOCK ALL communication inside your ethernet"
+ ewarn "segment!!! If you have any doubts do not start ip-sentinel."
+}
+
+pkg_config() {
+ CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/ip-sentinel 2>/dev/null`
+
+ if [ ! -d "${CHROOT:=/chroot/ip-sentinel}" ] ; then
+ ebegin "Setting up the chroot directory"
+ mkdir -m 0755 -p "${CHROOT}/etc"
+ cp -R /etc/ip-sentinel.cfg "${CHROOT}/etc"
+ eend
+
+ if [ "`grep '^#[[:blank:]]\?CHROOT' /etc/conf.d/ip-sentinel`" ] ; then
+ sed -e '/^#[[:blank:]]\?CHROOT/s/^#[[:blank:]]\?//' \
+ -i /etc/conf.d/ip-sentinel
+ fi
+ else
+ eerror
+ eerror "${CHROOT} already exists. Quitting."
+ eerror
+ fi
+}
diff --git a/net-misc/ip-sentinel/metadata.xml b/net-misc/ip-sentinel/metadata.xml
new file mode 100644
index 000000000000..c89beb74d359
--- /dev/null
+++ b/net-misc/ip-sentinel/metadata.xml
@@ -0,0 +1,23 @@
+<?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>
+This program tries to prevent unauthorized usage of IPs within the local
+ethernet broadcastdomain by giving an answer to ARP-requests. After receiving
+such a faked reply, the requesting party stores the told MAC in its ARP-table
+and will send future packets to this MAC. Because this MAC is invalid, the host
+with the invalid IP can not be reached.
+</longdescription>
+<longdescription lang="ja">
+このプログラムは ARP リクエストへの応答を利用したローカルイーサネットの
+ブロードキャストドメイン内で認められていない IP パケットの使用法を阻止し
+ようと試みます。偽造された応答を受信すれば、そのリクエスト・パーティは
+ARP テーブル内の該当する MAC アドレスを覚え、その後のパケットをこの MAC
+アドレスへ送ります。何故ならばこの MAC アドレスは不正なもので、無効な IP
+パケットはそのホストへ到達できないからです。
+</longdescription>
+</pkgmetadata>