Feature #4581 » dshield-sensor.diff
builder_scripts/conf/pfPorts/buildports.RELENG_2_2 | ||
---|---|---|
99 | 99 |
ipmitool /usr/ports/sysutils/ipmitool /usr/local/bin/ipmitool |
100 | 100 |
dmidecode /usr/ports/sysutils/dmidecode /usr/local/sbin/dmidecode |
101 | 101 |
unbound /usr/ports/dns/unbound /usr/local/sbin/unbound |
102 |
dshield-sensor /usr/ports/net-mgmt/dshield-sensor /usr/local/sbin/dshield-sensor |
pfPorts/dshield-sensor/Makefile | ||
---|---|---|
1 |
# Created by: Robert Nelson <robertn@the-nelsons.org> |
|
2 |
# $FreeBSD$ |
|
3 | ||
4 |
PORTNAME= dshield-sensor |
|
5 |
PORTVERSION= 2015.04.03 |
|
6 |
CATEGORIES= net-mgmt |
|
7 | ||
8 |
MAINTAINER= robertn@the-nelsons.org |
|
9 |
COMMENT= Submit firewall logs to Dshield Sensor periodically |
|
10 | ||
11 |
RUN_DEPENDS= p5-Net-IP>=0:${PORTSDIR}/net-mgmt/p5-Net-IP |
|
12 | ||
13 |
USE_GITHUB= yes |
|
14 |
GH_ACCOUNT= Robert-Nelson |
|
15 |
GH_PROJECT= dshield-framework |
|
16 | ||
17 |
DISTVERSIONPREFIX= v |
|
18 | ||
19 |
USES= perl5 shebangfix |
|
20 |
SHEBANG_FILES= ${WRKSRC}/build_clients.pl |
|
21 | ||
22 |
USE_PERL5= build run |
|
23 | ||
24 |
NO_ARCH= yes |
|
25 | ||
26 |
.include <bsd.port.pre.mk> |
|
27 | ||
28 |
post-extract: |
|
29 |
${CP} ${FILESDIR}/dshield-sensor ${WRKSRC} |
|
30 | ||
31 |
post-patch: |
|
32 |
@${REINPLACE_CMD} -e 's,@@DATADIR@@,${DATADIR},g' -e 's,@@ETCDIR@@,${ETCDIR},g' ${WRKSRC}/dshield-sensor ${WRKSRC}/dshield.cnf |
|
33 | ||
34 |
do-build: |
|
35 |
cd ${WRKSRC}; ./build_clients.pl |
|
36 |
@${REINPLACE_CMD} ${_SHEBANG_REINPLACE_ARGS} ${WRKSRC}/pfsense.pl |
|
37 | ||
38 |
do-install: |
|
39 |
${MKDIR} ${STAGEDIR}${DATADIR} |
|
40 |
${INSTALL_SCRIPT} ${WRKSRC}/pfsense.pl ${STAGEDIR}${DATADIR}/pfsense.pl |
|
41 |
${MKDIR} ${STAGEDIR}${ETCDIR} |
|
42 |
${INSTALL_DATA} ${WRKSRC}/dshield-source-exclude.lst ${STAGEDIR}${ETCDIR}/dshield-source-exclude.lst.sample |
|
43 |
${INSTALL_DATA} ${WRKSRC}/dshield-source-port-exclude.lst ${STAGEDIR}${ETCDIR}/dshield-source-port-exclude.lst.sample |
|
44 |
${INSTALL_DATA} ${WRKSRC}/dshield-target-exclude.lst ${STAGEDIR}${ETCDIR}/dshield-target-exclude.lst.sample |
|
45 |
${INSTALL_DATA} ${WRKSRC}/dshield-target-port-exclude.lst ${STAGEDIR}${ETCDIR}/dshield-target-port-exclude.lst.sample |
|
46 |
${INSTALL_DATA} ${WRKSRC}/dshield.cnf ${STAGEDIR}${ETCDIR}/dshield.cnf.sample |
|
47 |
${INSTALL_SCRIPT} ${WRKSRC}/dshield-sensor ${STAGEDIR}${PREFIX}/sbin/dshield-sensor |
|
48 | ||
49 |
.include <bsd.port.post.mk> |
pfPorts/dshield-sensor/distinfo | ||
---|---|---|
1 |
SHA256 (dshield-sensor-v2015.04.03_GH0.tar.gz) = c0dc2fba04a1d492e69ebcb30077ed1107d68c13562497851fc417d41875608a |
|
2 |
SIZE (dshield-sensor-v2015.04.03_GH0.tar.gz) = 57749 |
pfPorts/dshield-sensor/files/dshield-sensor | ||
---|---|---|
1 |
#!/bin/sh |
|
2 |
@@DATADIR@@/pfsense.pl -config=@@ETCDIR@@/dshield.cnf |
pfPorts/dshield-sensor/files/patch-dshield.cnf | ||
---|---|---|
1 |
--- dshield.cnf.orig 2015-03-29 17:50:14 UTC |
|
2 |
+++ dshield.cnf |
|
3 |
@@ -35,7 +35,7 @@ replyto= |
|
4 |
# client processes 'syslog' reports. Unless your firewall logs go to |
|
5 |
# a different file.... |
|
6 |
|
|
7 |
-log=/var/log/messages |
|
8 |
+#log=/var/log/messages |
|
9 |
|
|
10 |
# Regular expression that must match in each log line that is processed |
|
11 |
# Needed if your log contains all kinds of different things, not just |
|
12 |
@@ -79,20 +79,21 @@ sendmail=/usr/sbin/sendmail -oi -t |
|
13 |
# Or for testing and debugging, so that you don't have to fool with mail until |
|
14 |
# you have it working right. |
|
15 |
|
|
16 |
-whereto=MAIL |
|
17 |
+#whereto=MAIL |
|
18 |
+whereto=- |
|
19 |
|
|
20 |
# These optional files contain ranges that are used to exclude |
|
21 |
# log lines, so you can filter out log lines that you don't want |
|
22 |
# to submit to DShield. |
|
23 |
# |
|
24 |
# IP addresses |
|
25 |
-source_exclude=/etc/dshield-source-exclude.lst |
|
26 |
-target_exclude=/etc/dshield-target-exclude.lst |
|
27 |
+source_exclude=@@ETCDIR@@/dshield-source-exclude.lst |
|
28 |
+target_exclude=@@ETCDIR@@/dshield-target-exclude.lst |
|
29 |
|
|
30 |
# |
|
31 |
# Ports |
|
32 |
-source_port_exclude=/etc/dshield-source-port-exclude.lst |
|
33 |
-target_port_exclude=/etc/dshield-target-port-exclude.lst |
|
34 |
+source_port_exclude=@@ETCDIR@@/dshield-source-port-exclude.lst |
|
35 |
+target_port_exclude=@@ETCDIR@@/dshield-target-port-exclude.lst |
|
36 |
|
|
37 |
# Replace the first byte of the target IP with '10.' |
|
38 |
# Note that if you set this to 'Y' then DShield won't send FightBack |
|
39 |
@@ -112,7 +113,7 @@ obfus=N |
|
40 |
# yyyymmddhhmmss format, so you can manually edit this if you need to |
|
41 |
# reset where processing will start. |
|
42 |
|
|
43 |
-linecnt=/tmp/dshield.cnt |
|
44 |
+linecnt=/var/tmp/dshield.cnt |
|
45 |
|
|
46 |
# Setting these to "Y" makes the client spit out a lot of stuff |
|
47 |
# to standard output, some of which may be helpful. |
pfPorts/dshield-sensor/pkg-descr | ||
---|---|---|
1 |
This is a set of scripts which automatically submits firewall logs to DShield |
|
2 | ||
3 |
WWW: https://dshield.org/howto.html |
pfPorts/dshield-sensor/pkg-plist | ||
---|---|---|
1 |
sbin/dshield-sensor |
|
2 |
%%DATADIR%%/pfsense.pl |
|
3 |
@sample %%ETCDIR%%/dshield-source-exclude.lst.sample |
|
4 |
@sample %%ETCDIR%%/dshield-source-port-exclude.lst.sample |
|
5 |
@sample %%ETCDIR%%/dshield-target-exclude.lst.sample |
|
6 |
@sample %%ETCDIR%%/dshield-target-port-exclude.lst.sample |
|
7 |
@sample %%ETCDIR%%/dshield.cnf.sample |