Add support for 'scfilter' script

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-10-01 09:15:58 -07:00
parent 2fa7e11976
commit 468af44876
10 changed files with 124 additions and 0 deletions

View File

@ -247,6 +247,18 @@ if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall-lite/shorewall.conf
fi
#
# Install the Scfilter file
#
if [ ! -f ${DESTDIR}/etc/shorewall-lite/scfilter ]; then
run_install $OWNERSHIP -m 0744 scfilter ${DESTDIR}/etc/shorewall-lite
echo "Scfilter file installed as ${DESTDIR}/etc/shorewall-lite/scfilter"
fi
if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall-lite/shorewall.conf
fi
#
# Install the Makefile
#

15
Shorewall-lite/scfilter Normal file
View File

@ -0,0 +1,15 @@
#! /bin/sh
#
# Shorewall version 4 - Show Connections Filter
#
# /etc/shorewall/scfilter
#
# Replace the 'cat' command below to filter the output of
# 'show connections. Unlike other extension scripts, this file
# must be executable before Shorewall will use it.
#
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
# information.
#
###############################################################################
cat -

View File

@ -11,6 +11,8 @@ Changes in Shorewall 4.4.14
5) Dramatically reduce the amount of CPU time spent in optimization.
6) Add 'scfilter' script.
Changes in Shorewall 4.4.13
1) Allow zone lists in rules SOURCE and DEST.

View File

@ -0,0 +1,15 @@
#! /bin/sh
#
# Shorewall version 4 - Show Connections Filter
#
# /etc/shorewall/scfilter
#
# Replace the 'cat' command below to filter the output of
# 'show connections. Unlike other extension scripts, this file
# must be executable before Shorewall will use it.
#
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
# information.
#
###############################################################################
cat -

View File

@ -737,6 +737,15 @@ if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcclear ]; then
echo "Tcclear file installed as ${DESTDIR}/etc/shorewall/tcclear"
fi
#
# Install the Scfilter file
#
run_install $OWNERSHIP -m 744 configfiles/scfilter ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/scfilter ]; then
run_install $OWNERSHIP -m 0700 configfiles/scfilter ${DESTDIR}/etc/shorewall
echo "Scfilter file installed as ${DESTDIR}/etc/shorewall/scfilter"
fi
#
# Install the Standard Actions file
#
install_file actions.std ${DESTDIR}/usr/share/shorewall/actions.std 0644

View File

@ -51,6 +51,30 @@ VI. PROBLEMS CORRECTED AND NEW FEATURES IN PRIOR RELEASES
with a letter and be composed of letters, digits, underscores ("_")
and hyphens ("-").
5) An 'scfilter' extension script has been added. This extension
script differs from other such scripts in that it is invoked by the
command line tools (/sbin/shorewall, /sbin/shorewall6,
/sbin/shorewall-lite and /sbin/shorewall6-lite). In order to be
used, the script must be executable.
The script acts as a filter for the output of the 'show
connections' command. Each connection is piped through the filter
which can modify and/or drop information as desired.
Example:
#!/bin/sh
sed 's/secmark=0 //'
That script will remove 'secmark=0 ' from each line.
The default script is:
#!/bin/sh
cat -
which passes the output through unmodified.
----------------------------------------------------------------------------
I I. K N O W N P R O B L E M S R E M A I N I N G
----------------------------------------------------------------------------

View File

@ -245,6 +245,14 @@ if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall6-lite/shorewall.conf
fi
#
# Install the Scfilter file
#
if [ ! -f ${DESTDIR}/etc/shorewall6-lite/scfilter ]; then
install_file scfilter ${DESTDIR}/etc/shorewall6-lite/scfilter 0744
echo "Scfilter file installed as ${DESTDIR}/etc/shorewall6-lite/scfilter"
fi
#
# Install the Makefile
#

15
Shorewall6-lite/scfilter Normal file
View File

@ -0,0 +1,15 @@
#! /bin/sh
#
# Shorewall version 4 - Show Connections Filter
#
# /etc/shorewall/scfilter
#
# Replace the 'cat' command below to filter the output of
# 'show connections. Unlike other extension scripts, this file
# must be executable before Shorewall will use it.
#
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
# information.
#
###############################################################################
cat -

View File

@ -631,6 +631,15 @@ if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcclear ]; then
echo "Tcclear file installed as ${DESTDIR}/etc/shorewall6/tcclear"
fi
#
# Install the Scfilter file
#
run_install $OWNERSHIP -m 0744 tcclear ${DESTDIR}/usr/share/shorewall6/configfiles/scfilter
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/scfilter ]; then
run_install $OWNERSHIP -m 0700 scfilter ${DESTDIR}/etc/shorewall6/scfilter
echo "Scfilter file installed as ${DESTDIR}/etc/shorewall6/scfilter"
fi
#
# Install the Standard Actions file
#
install_file actions.std ${DESTDIR}/usr/share/shorewall6/actions.std 0644

15
Shorewall6/scfilter Normal file
View File

@ -0,0 +1,15 @@
#! /bin/sh
#
# Shorewall version 4 - Show Connections Filter
#
# /etc/shorewall/scfilter
#
# Replace the 'cat' command below to filter the output of
# 'show connections. Unlike other extension scripts, this file
# must be executable before Shorewall will use it.
#
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
# information.
#
###############################################################################
cat -