Compare commits

..

26 Commits

Author SHA1 Message Date
Tom Eastep
47557aa4f7 Correct additional issues with 'update'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-18 10:24:52 -07:00
Tom Eastep
93ee4432de Allow <user>: in USER columns
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-18 09:44:35 -07:00
Tom Eastep
8c543ca6f8 Transfer permissions during file updates
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-16 16:04:32 -07:00
Tom Eastep
e71fb3249a Add 'dbl' interface option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-15 16:35:41 -07:00
Tom Eastep
56b6db1a3d Make the allow command work with both ipset and chain dynamic blacklisting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-14 13:42:20 -07:00
Tom Eastep
ea56d4ed19 Make ipset-based dynamic blacklisting work in the FORWARD chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-13 15:02:12 -07:00
Tom Eastep
c65721a139 Correct a warning message
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-13 12:21:16 -07:00
Tom Eastep
f979ccb16d Merge branch '5.0.9' 2016-06-09 14:47:44 -07:00
Tom Eastep
24b396bc67 Avoid run-time Perl diagnostic when validating a null log level
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-09 09:12:13 -07:00
Tom Eastep
cd0837beb5 Avoid run-time Perl diagnostic when validating a null log level
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-09 09:00:12 -07:00
Tom Eastep
4869f61a25 'allow' now works with ipset-based dynamic blacklisting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-09 08:44:25 -07:00
Tom Eastep
6eb8416c2b Don't link SysV init script if $SERVICEDIR is given on Debian.
- Fixes issue with package build environment.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-08 15:56:56 -07:00
Matt Darfeuille
0925636995 (Fwd) [Shorewall-users] Shorewall-lite on OpenWRT
On 7 Jun 2016 at 8:21, Tom Eastep wrote:

> On 06/07/2016 06:40 AM, Matt Darfeuille wrote:
> > On 5 Jun 2016 at 12:53, Tom Eastep wrote:
> >
> >> On 06/05/2016 12:33 PM, Matt Darfeuille wrote:
> >>> On 5 Jun 2016 at 7:57, Tom Eastep wrote:
> >>>
> >>>> On 05/29/2016 02:00 AM, Matt Darfeuille wrote:
> >>>>
> >>>> Hi Matt,
> >>>>
> >>>>>
> >>>>> -------------- Enclosure number 1 ----------------
> >>>>> >From 6ff651108df33ab8be4562caef03a8582e9eac5e Mon Sep 17 00:00:00 2001
> >>>>> From: Matt Darfeuille <matdarf@gmail.com>
> >>>>> Date: Tue, 24 May 2016 13:10:28 +0200
> >>>>> Subject: [PATCH 1/8] Emulate 'ps -p' using grep to work on openwrt
> >>>>>
> >>>>> Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
> >>>>> ---
> >>>>>  Shorewall-core/lib.common | 2 +-
> >>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/Shorewall-core/lib.common b/Shorewall-core/lib.common
> >>>>> index 03ecb2a..fcb02ee 100644
> >>>>> --- a/Shorewall-core/lib.common
> >>>>> +++ b/Shorewall-core/lib.common
> >>>>> @@ -776,7 +776,7 @@ mutex_on()
> >>>>>  		error_message "WARNING: Stale lockfile ${lockf} removed"
> >>>>>  	    elif [ $lockpid -eq $$ ]; then
> >>>>>                  return 0
> >>>>> -	    elif ! qt ps p ${lockpid}; then
> >>>>> +	    elif ! qt ps | grep -v grep | grep ${lockpid}; then
> >>>>
> >>>> I don't see how this can work -- 'qt ps' will produce no output yet the
> >>>> code pipes into tandem greps.
> >>>>
> >>>> Do you really want this instead?
> >>>>
> >>>> elif ! ps | grep -v grep | qt grep ${lockpid}; then
> >>>>
> >>>
> >>> Oops sorry Tom, that's what I meant(do you want the corrected
> >>> patch?)!
> >>
> >> Yes, please.
> >>
> >
> > Tom, along with correcting this faulty commit I realize, after some
> > more testing, that I've also sent unnecessary commits.
> >
> > Should I revert these 3 commits(git revert ...):
> > Set proper permissions for the LOCKFILE on openwrt
> > 2ded346cb557212389212fd5adcd4c6800edbb62
> > Create lockfile before using openwrt's lock utility
> > 08e8796ff1abc3b24b8bbd40bf5e0a2b36464d61
> > Emulate 'ps -p' using grep to work on openwrt
> > 6ff651108df33ab8be4562caef03a8582e9eac5e
> >
> > or should I simply create new commits that will correct these faulty
> > commits?
> >
> > In other words what's the best way to correct submited commits.
> >
>
> Matt,
>
> Either way is fine.
>

Hopefully these 3 commits will do it(code-fixes.patch):

Patch 1 will correct the error you have point out!
On OpenWRT the lock utility doesn't allow to append the pid of the
currently running script to the LOCKFILE that's why I've simply
deleted that line(patch 2).
I've also reordered the permissions line to be added after the line
that will lock the file specified by the LOCKFILE variable(patch 3).

and two other patches:
While installing shorewall-init using the DESTDIR variable on debian,
'mkdir' would complain if the directory ${DESTDIR}/${etc}/default
already exist; corrected using 'mkdir -p ...'(patch 4).
The last patch will correct a typo in the blacklisting_support
article.

-Matt

-------------- Enclosure number 1 ----------------
>From 1a2ff15c8dc994030e819d2882570d188b99c501 Mon Sep 17 00:00:00 2001
From: Matt Darfeuille <matdarf@gmail.com>
Date: Wed, 8 Jun 2016 09:09:46 +0200
Subject: [PATCH 1/5] Correct pid detection mutex_on()

Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-08 15:40:48 -07:00
Matt Darfeuille
cd4e9654d8 (Fwd) [Shorewall-users] Shorewall-lite on OpenWRT
------- Forwarded message follows -------
From:	istvan@istvan.org
To:	shorewall-users@lists.sourceforge.net
Date sent:	Thu, 19 May 2016 09:10:21 +0200
Subject:	[Shorewall-users] Shorewall-lite on OpenWRT
Send reply to:	Shorewall Users <shorewall-users@lists.sourceforge.net>
	<mailto:shorewall-users-request@lists.sourceforge.net?subject=unsubscribe>
	<mailto:shorewall-users-request@lists.sourceforge.net?subject=subscribe>

Hi there,

I use Shorewall on an OpenWRT distribution and I experience 2
problems.
I have solved them myself and report them here to help others with
it.

Shorewall version: shorewall[6]-lite 5.0.4
OpenWRT version: Chaos Calmer 15.05, r46767

Problem 1:
Shorewall uses the lock utility from openwrt. I believe it is used in

the wrong way. File lib.common line 775
First it passes arguments which the utility doesn't use/know. The
util
accepts them dumbly and continues to create a lockfile. It has no
time-out functionality. I do not know the meaning of the r1 argument.
Second the mutex_off simply deletes the lockfile by using the utility

rm. This way a stale lock process keeps running. After a while the
router is running a high number of stale processes which has impact
on
the load of the router. The correct way is to use "lock -u
/lib/shorewall-lite/lock". This way the lockfile will be removed and
the
process will be terminated accordingly. To make it work for me, I no
more let shorewall use the lock utility by using an ugly hack.

Problem 2:
An fgrep on the output of the type utility is wrongly coded. The
output
of the type command probably has been changed. File lib.cli line 4343
It is coded: "if type $1 2> /dev/null | fgrep -q 'is a function';
then"
To make it work for me, it should be coded: "if type $1 2> /dev/null
|
fgrep -q 'is a shell function'; then"

With regards,

Stefan
------- End of forwarded message -------

Tom, attached as code.patch, are the patches that I  believe will
correct those issues

In addition to those patches I've also added 3 patches:
- Patch 1 will emulate the -p flag of the ps utility which is not
available on openwrt.
- The last two patches will add "file" to the progress message of
SYSCONFFILE to make it more consistent among the installers.

In shorewall-init/install.sh the else clause between  the line 586
and 597 will only work for a sysvinit script.
Should I make it also work for a systemd service script or can't we
simply remove that else clause?

In the compiled firewall script the comments before and after the
functions imported from lib.common have two slashes in the path:
$ grep -H lib.common firewall
firewall:#   Functions imported from /usr/share/shorewall//lib.common
firewall:#   End of imports from /usr/share/shorewall//lib.common

-Matt

-------------- Enclosure number 1 ----------------
>From 6ff651108df33ab8be4562caef03a8582e9eac5e Mon Sep 17 00:00:00 2001
From: Matt Darfeuille <matdarf@gmail.com>
Date: Tue, 24 May 2016 13:10:28 +0200
Subject: [PATCH 1/8] Emulate 'ps -p' using grep to work on openwrt

Signed-off-by: Matt Darfeuille <matdarf@gmail.com>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-08 15:40:36 -07:00
Tom Eastep
cd01df4200 Allow more than 9 interfaces with Simple TC
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-06-07 14:43:37 -07:00
Tom Eastep
7798c52a19 Fix DOCKER=Yes when docker0 is defined and Docker isn't started.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-22 17:50:51 -07:00
Tom Eastep
2809d6896c Clarify dynamic sub-zones
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-18 08:20:23 -07:00
Tom Eastep
1d066bdfa4 Minor updates to the Shorewall 5 article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-18 08:19:47 -07:00
Tom Eastep
9b7088158b Correct ipv6-route header number
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-10 07:12:01 -07:00
Tom Eastep
625d763372 Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code
Conflicts:
	Shorewall/Perl/Shorewall/Config.pm
2016-05-07 13:50:01 -07:00
Tom Eastep
82169a0bfd Use 'date' format for compiletime rather than localtime format
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-07 13:48:16 -07:00
Tom Eastep
0d16b2820a Use 'date' format for compiletime rather than localtime format
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-06 13:28:22 -07:00
Tom Eastep
d4df67966d Turn on AUTOMAKE in the sample configurations
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-06 08:46:11 -07:00
Tom Eastep
f16bb887f3 Report versions as Shorewall's rather than Shorewall6's
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-05 15:41:46 -07:00
Tom Eastep
64fb662bb1 Verify Shorewall6 version when compiling for IPv6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-05 15:22:47 -07:00
Tom Eastep
ce20e5592b Cross-check core and standard versions during compilation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2016-05-05 13:53:26 -07:00
33 changed files with 402 additions and 95 deletions

View File

@@ -2522,21 +2522,46 @@ hits_command() {
# 'allow' command executor
#
allow_command() {
[ -n "$g_debugging" ] && set -x
[ $# -eq 1 ] && missing_argument
if product_is_started ; then
local allowed
local which
which='-s'
local range
range='--src-range'
local dynexists
if ! chain_exists dynamic; then
if [ -n "$g_blacklistipset" ]; then
case ${IPSET:=ipset} in
*/*)
if [ ! -x "$IPSET" ]; then
fatal_error "IPSET=$IPSET does not exist or is not executable"
fi
;;
*)
IPSET="$(mywhich $IPSET)"
[ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located"
;;
esac
fi
if chain_exists dynamic; then
dynexists=Yes
elif [ -z "$g_blacklistipset" ]; then
fatal_error "Dynamic blacklisting is not enabled in the current $g_product configuration"
fi
[ -n "$g_nolock" ] || mutex_on
while [ $# -gt 1 ]; do
shift
allowed=''
case $1 in
from)
which='-s'
@@ -2549,29 +2574,48 @@ allow_command() {
continue
;;
*-*)
if qt $g_tool -D dynamic -m iprange $range $1 -j reject ||\
qt $g_tool -D dynamic -m iprange $range $1 -j DROP ||\
qt $g_tool -D dynamic -m iprange $range $1 -j logdrop ||\
qt $g_tool -D dynamic -m iprange $range $1 -j logreject
if [ -n "$g_blacklistipset" ]; then
if qt $IPSET -D $g_blacklistipset $1; then
allowed=Yes
fi
fi
if [ -n "$dynexists" ]; then
if qt $g_tool -D dynamic -m iprange $range $1 -j reject ||\
qt $g_tool -D dynamic -m iprange $range $1 -j DROP ||\
qt $g_tool -D dynamic -m iprange $range $1 -j logdrop ||\
qt $g_tool -D dynamic -m iprange $range $1 -j logreject
then
echo "$1 Allowed"
else
echo "$1 Not Dropped or Rejected"
allowed=Yes
fi
fi
;;
*)
if qt $g_tool -D dynamic $which $1 -j reject ||\
qt $g_tool -D dynamic $which $1 -j DROP ||\
qt $g_tool -D dynamic $which $1 -j logdrop ||\
qt $g_tool -D dynamic $which $1 -j logreject
if [ -n "$g_blacklistipset" ]; then
if qt $IPSET -D $g_blacklistipset $1; then
allowed=Yes
fi
fi
if [ -n "$dynexists" ]; then
if qt $g_tool -D dynamic $which $1 -j reject ||\
qt $g_tool -D dynamic $which $1 -j DROP ||\
qt $g_tool -D dynamic $which $1 -j logdrop ||\
qt $g_tool -D dynamic $which $1 -j logreject
then
echo "$1 Allowed"
else
echo "$1 Not Dropped or Rejected"
allowed=Yes
fi
fi
;;
esac
if [ -n "$allowed" ]; then
progress_message2 "$1 Allowed"
else
error_message "WARNING: $1 already allowed (not dynamically blacklisted)"
fi
done
[ -n "$g_nolock" ] || mutex_off
else
error_message "ERROR: $g_product is not started"
@@ -3507,7 +3551,7 @@ blacklist_command() {
;;
esac
$IPSET -A $g_blacklistipset $@ || { error_message "ERROR: Address $1 not blacklisted"; return 1; }
$IPSET -A $g_blacklistipset $@ && progress_message2 "$1 Blacklisted" || { error_message "ERROR: Address $1 not blacklisted"; return 1; }
return 0
}
@@ -4560,6 +4604,11 @@ shorewall_cli() {
# It's a shell function -- call it
#
$@
elif type $1 2> /dev/null | fgrep -q 'is a shell function'; then
#
# It's a shell function -- call it
#
$@
else
#
# It isn't a function visible to this script -- try

View File

@@ -776,7 +776,7 @@ mutex_on()
error_message "WARNING: Stale lockfile ${lockf} removed"
elif [ $lockpid -eq $$ ]; then
return 0
elif ! qt ps p ${lockpid}; then
elif ! ps | grep -v grep | qt grep ${lockpid}; then
rm -f ${lockf}
error_message "WARNING: Stale lockfile ${lockf} from pid ${lockpid} removed"
fi
@@ -788,10 +788,8 @@ mutex_on()
echo $$ > ${lockf}
chmod u-w ${lockf}
elif qt mywhich lock; then
lock -${MUTEX_TIMEOUT} -r1 ${lockf}
chmod u+w ${lockf}
echo $$ > ${lockf}
chmod u-w ${lockf}
lock ${lockf}
chmod u=r ${lockf}
else
while [ -f ${lockf} -a ${try} -lt ${MUTEX_TIMEOUT} ] ; do
sleep 1
@@ -813,6 +811,7 @@ mutex_on()
#
mutex_off()
{
[ -f ${CONFDIR}/rc.common ] && lock -u ${LOCKFILE:=${VARDIR}/lock}
rm -f ${LOCKFILE:=${VARDIR}/lock}
}

View File

@@ -412,7 +412,7 @@ if [ $HOST = debian ]; then
if [ ! -f ${DESTDIR}${CONFDIR}/default/shorewall-init ]; then
if [ -n "${DESTDIR}" ]; then
mkdir ${DESTDIR}${ETC}/default
mkdir -p ${DESTDIR}${ETC}/default
fi
[ $configure -eq 1 ] || mkdir -p ${DESTDIR}${CONFDIR}/default
@@ -585,7 +585,7 @@ if [ -z "$DESTDIR" ]; then
fi
else
if [ $configure -eq 1 -a -n "$first_install" ]; then
if [ $HOST = debian ]; then
if [ $HOST = debian -a -z "$SERVICEDIR" ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/rcS.d
fi

View File

@@ -550,7 +550,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PR
fi
install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT} 0640
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ ${SHAREDIR} != /usr/share ]; then

View File

@@ -702,7 +702,9 @@
blacklisted by a <emphasis role="bold">drop</emphasis>, <emphasis
role="bold">logdrop</emphasis>, <emphasis
role="bold">reject</emphasis>, or <emphasis
role="bold">logreject</emphasis> command.</para>
role="bold">logreject</emphasis> command. Beginning with Shorewall
5.0.10, this command can also re-enable addresses blacklisted using
the <command>blacklist</command> command.</para>
</listitem>
</varlistentry>

View File

@@ -244,7 +244,7 @@ sub create_arptables_load( $ ) {
emit "exec 3>\${VARDIR}/.arptables-input";
my $date = localtime;
my $date = compiletime;
unless ( $test ) {
emit_unindented '#';
@@ -294,7 +294,7 @@ sub create_arptables_load( $ ) {
#
sub preview_arptables_load() {
my $date = localtime;
my $date = compiletime;
print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n";

View File

@@ -5220,6 +5220,8 @@ sub do_user( $ ) {
if ( supplied $2 ) {
$user = $2;
$user =~ s/:$//;
if ( $user =~ /^(\d+)(-(\d+))?$/ ) {
if ( supplied $2 ) {
fatal_error "Invalid User Range ($user)" unless $3 >= $1;
@@ -8575,7 +8577,7 @@ sub create_netfilter_load( $ ) {
enter_cat_mode;
my $date = localtime;
my $date = compiletime;
unless ( $test ) {
emit_unindented '#';
@@ -8683,7 +8685,7 @@ sub preview_netfilter_load() {
enter_cat_mode1;
my $date = localtime;
my $date = compiletime;
print "#\n# Generated by Shorewall $globals{VERSION} - $date\n#\n";
@@ -8919,7 +8921,7 @@ sub create_stop_load( $ ) {
enter_cat_mode;
unless ( $test ) {
my $date = localtime;
my $date = compiletime;
emit_unindented '#';
emit_unindented "# Generated by Shorewall $globals{VERSION} - $date";
emit_unindented '#';

View File

@@ -90,7 +90,7 @@ sub generate_script_1( $ ) {
if ( $test ) {
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall-perl\n#";
} else {
my $date = localtime;
my $date = compiletime;
emit "#!$config{SHOREWALL_SHELL}\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#";
@@ -600,7 +600,7 @@ EOF
# Generate info_command()
#
sub compile_info_command() {
my $date = localtime;
my $date = compiletime;
emit( "\n",
"#",

View File

@@ -84,6 +84,8 @@ our @EXPORT = qw(
require_capability
report_used_capabilities
kernel_version
compiletime
);
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
@@ -163,6 +165,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
directive_callback
add_ipset
all_ipsets
transfer_permissions
$product
$Product
@@ -681,6 +684,8 @@ our %ipsets; # All required IPsets
#
our %filecache;
our $compiletime;
sub process_shorewallrc($$);
sub add_variables( \% );
#
@@ -737,7 +742,7 @@ sub initialize( $;$$) {
TC_SCRIPT => '',
EXPORT => 0,
KLUDGEFREE => '',
VERSION => "5.0.1",
VERSION => "5.0.9-Beta2",
CAPVERSION => 50004 ,
BLACKLIST_LOG_TAG => '',
RELATED_LOG_TAG => '',
@@ -1172,6 +1177,12 @@ sub initialize( $;$$) {
%shorewallrc1 = %shorewallrc unless $shorewallrc1;
add_variables %shorewallrc1;
$compiletime = `date`;
chomp $compiletime;
$compiletime =~ s/ +/ /g;
}
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
@@ -1184,6 +1195,10 @@ sub all_ipsets() {
sort keys %ipsets;
}
sub compiletime() {
$compiletime;
}
#
# Create 'currentlineinfo'
#
@@ -3880,9 +3895,10 @@ my %logoptions = ( tcp_sequence => '--log-tcp-sequence',
sub validate_level( $;$ ) {
my ( $rawlevel, $option ) = @_;
my $level = uc $rawlevel;
my $level;
if ( supplied ( $level ) ) {
if ( supplied ( $rawlevel ) ) {
$level = uc $rawlevel;
$level =~ s/!$//;
my $value = $level;
my $qualifier;
@@ -5074,6 +5090,19 @@ sub update_default($$) {
$config{$var} = $val unless defined $config{$var};
}
#
# Transfer the permissions from an old .bak file to a newly-created file
#
sub transfer_permissions( $$ ) {
my ( $old, $new ) = @_;
my @stat = stat $old;
if ( @stat ) {
fatal_error "Can't transfer permissions from $old to $new" unless chmod( $stat[2] & 0777, $new );
}
}
sub update_config_file( $ ) {
my ( $annotate ) = @_;
@@ -5223,6 +5252,7 @@ EOF
if ( system( "diff -q $configfile $configfile.bak > /dev/null" ) ) {
progress_message3 "Configuration file $configfile updated - old file renamed $configfile.bak";
transfer_permissions( "$configfile.bak", $configfile );
} else {
if ( rename "$configfile.bak", $configfile ) {
progress_message3 "No update required to configuration file $configfile; $configfile.bak not saved";
@@ -5737,6 +5767,24 @@ sub get_configuration( $$$$ ) {
$ENV{PATH} = $default_path;
}
fatal_error "Shorewall-core does not appear to be installed" unless open_file "$globals{SHAREDIRPL}coreversion";
fatal_error "$globals{SHAREDIRPL}coreversion is empty" unless read_a_line( PLAIN_READ );
close_file;
warning_message "Version Mismatch: Shorewall-core is version $currentline, while the Shorewall version is $globals{VERSION}" unless $currentline eq $globals{VERSION};
if ( $family == F_IPV6 ) {
open_file( "$globals{SHAREDIR}/version" ) || fatal_error "Unable to open $globals{SHAREDIR}/version";
fatal_error "$globals{SHAREDIR}/version is empty" unless read_a_line( PLAIN_READ );
close_file;
warning_message "Version Mismatch: Shorewall6 is version $currentline, while the Shorewall version is $globals{VERSION}" unless $currentline eq $globals{VERSION};
}
my $have_capabilities;
if ( $export || $> != 0 ) {
@@ -6152,8 +6200,10 @@ sub get_configuration( $$$$ ) {
require_capability( 'IPSET_V5', 'DYNAMIC_BLACKLIST=ipset...', 's' );
} else {
default_yes_no( 'DYNAMIC_BLACKLIST' , 'Yes' );
default_yes_no( 'DYNAMIC_BLACKLIST', 'Yes' );
}
} else {
default_yes_no( 'DYNAMIC_BLACKLIST', 'Yes' );
}
default_yes_no 'REQUIRE_INTERFACE' , '';

View File

@@ -200,6 +200,7 @@ sub remove_blacklist( $ ) {
if ( $changed ) {
rename $fn, "$fn.bak" or fatal_error "Unable to rename $fn to $fn.bak: $!";
rename "$fn.new", $fn or fatal_error "Unable to rename $fn.new to $fn: $!";
transfer_permissions( "$fn.bak", $fn );
progress_message2 "\u$file file $fn saved in $fn.bak"
}
}
@@ -302,12 +303,13 @@ sub convert_blacklist() {
if ( @rules ) {
my $fn1 = find_writable_file( 'blrules' );
my $blrules;
my $date = localtime;
my $date = compiletime;
if ( -f $fn1 ) {
open $blrules, '>>', $fn1 or fatal_error "Unable to open $fn1: $!";
} else {
open $blrules, '>', $fn1 or fatal_error "Unable to open $fn1: $!";
transfer_permissions( $fn, $fn1 );
print $blrules <<'EOF';
#
# Shorewall version 5.0 - Blacklist Rules File
@@ -393,7 +395,7 @@ sub convert_routestopped() {
my ( @allhosts, %source, %dest , %notrack, @rule );
my $seq = 0;
my $date = localtime;
my $date = compiletime;
my ( $stoppedrules, $fn1 );
@@ -401,6 +403,7 @@ sub convert_routestopped() {
open $stoppedrules, '>>', $fn1 or fatal_error "Unable to open $fn1: $!";
} else {
open $stoppedrules, '>', $fn1 or fatal_error "Unable to open $fn1: $!";
transfer_permissions( $fn, $fn1 );
print $stoppedrules <<'EOF';
#
# Shorewall version 5 - Stopped Rules File
@@ -421,7 +424,7 @@ EOF
first_entry(
sub {
my $date = localtime;
my $date = compiletime;
progress_message2 "$doing $fn...";
print( $stoppedrules
"#\n" ,
@@ -649,9 +652,15 @@ sub create_docker_rules() {
add_ijump( $chainref, j => 'ACCEPT', o => 'docker0', state_imatch 'ESTABLISHED,RELATED' );
add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => '! docker0' );
add_ijump( $chainref, j => 'ACCEPT', i => 'docker0', o => 'docker0' ) if $dockerref->{options}{routeback};
add_ijump( $filter_table->{OUTPUT}, j => 'DOCKER' );
decr_cmd_level( $chainref );
add_commands( $chainref, 'fi' );
my $outputref;
add_commands( $outputref = $filter_table->{OUTPUT}, 'if [ -n "$g_docker" ]; then' );
incr_cmd_level( $outputref );
add_ijump( $outputref, j => 'DOCKER' );
decr_cmd_level( $outputref );
add_commands( $outputref, 'fi' );
}
add_commands( $chainref, '[ -f ${VARDIR}/.filter_FORWARD ] && cat $VARDIR/.filter_FORWARD >&3', );
@@ -860,13 +869,30 @@ sub add_common_rules ( $ ) {
}
}
if ( $dbl_ipset && ! get_interface_option( $interface, 'nodbl' ) ) {
add_ijump_extended( $filter_table->{input_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset src" );
add_ijump_extended( $filter_table->{output_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset dst" ) if $dbl_type =~ /,src-dst$/;
if ( $dbl_ipset && ( ( my $setting = get_interface_option( $interface, 'dbl' ) ) ne '0:0' ) ) {
my ( $in, $out ) = split /:/, $setting;
if ( $in == 1 ) {
#
# src
#
add_ijump_extended( $filter_table->{input_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset src" );
add_ijump_extended( $filter_table->{forward_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset src" );
} elsif ( $in == 2 ) {
add_ijump_extended( $filter_table->{forward_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset dst" );
}
if ( $out == 2 ) {
#
# dst
#
add_ijump_extended( $filter_table->{output_option_chain($interface)}, j => $dbl_target, $origin{DYNAMIC_BLACKLIST}, @state, set => "--match-set $dbl_ipset dst" );
}
}
for ( option_chains( $interface ) ) {
add_ijump_extended( $filter_table->{$_}, j => $dynamicref, $origin{DYNAMIC_BLACKLIST}, @state ) if $dynamicref && ! get_interface_option( $interface, 'nodbl' );
add_ijump_extended( $filter_table->{$_}, j => $dynamicref, $origin{DYNAMIC_BLACKLIST}, @state ) if $dynamicref && ( get_interface_option( $interface, 'dbl' ) ne '0:0' );
add_ijump_extended( $filter_table->{$_}, j => 'ACCEPT', $origin{FASTACCEPT}, state_imatch $faststate )->{comment} = '' if $config{FASTACCEPT};
}
}

View File

@@ -368,12 +368,19 @@ sub setup_conntrack($) {
if ( $convert ) {
my $conntrack;
my $empty = 1;
my $date = localtime;
my $date = compiletime;
my $fn1 = find_writable_file 'conntrack';
if ( $fn ) {
open $conntrack, '>>', $fn or fatal_error "Unable to open $fn for notrack conversion: $!";
$fn = open_file( 'notrack' , 3, 1 ) || fatal_error "Unable to open the notrack file for conversion: $!";
if ( -f $fn1 ) {
open $conntrack, '>>', $fn1 or fatal_error "Unable to open $fn for notrack conversion: $!";
} else {
open $conntrack, '>', $fn = find_file 'conntrack' or fatal_error "Unable to open $fn for notrack conversion: $!";
open $conntrack, '>' , $fn1 or fatal_error "Unable to open $fn for notrack conversion: $!";
#
# Transfer permissions from the existing notrack file
#
transfer_permissions( $fn, $fn1 );
print $conntrack <<'EOF';
#
@@ -396,8 +403,6 @@ EOF
"# Rules generated from notrack file $fn by Shorewall $globals{VERSION} - $date\n" ,
"#\n" );
$fn = open_file( 'notrack' , 3, 1 ) || fatal_error "Unable to open the notrack file for conversion: $!";
while ( read_a_line( PLAIN_READ ) ) {
#
# Don't copy the header comments from the old notrack file

View File

@@ -4749,10 +4749,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
}
}
unless ( ( $chain || $default_chain ) == OUTPUT ) {
fatal_error 'A USER/GROUP may only be specified when the SOURCE is $FW' unless $user eq '-';
}
if ( $dest ne '-' ) {
if ( $dest eq $fw ) {
fatal_error 'Rules with DEST $FW must use the INPUT chain' if $designator && $designator ne INPUT;
@@ -4795,6 +4791,7 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
fatal_error "Duplicate STATE ($_)" if $state{$_}++;
}
}
#
# Call the command's processing function
#
@@ -4805,12 +4802,23 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
if ( $chain == ACTIONCHAIN ) {
fatal_error "$cmd rules are not allowed in the $chainlabels{$chain} chain" unless $commandref->{allowedchains} & $chainref->{allowedchains};
$chainref->{allowedchains} &= $commandref->{allowedchains};
$chainref->{allowedchains} &= (OUTPUT | POSTROUTING ) if $user ne '-';
} else {
#
# Inline within one of the standard chains
#
fatal_error "$cmd rules are not allowed in the $chainlabels{$chain} chain" unless $commandref->{allowedchains} & $chain;
unless ( $chain == OUTPUT || $chain == POSTROUTING ) {
fatal_error 'A USER/GROUP may only be specified when the SOURCE is $FW' unless $user eq '-';
}
}
} else {
$resolve_chain->();
fatal_error "$cmd rules are not allowed in the $chainlabels{$chain} chain" unless $commandref->{allowedchains} & $chain;
unless ( $chain == OUTPUT || $chain == POSTROUTING ) {
fatal_error 'A USER/GROUP may only be specified when the SOURCE is $FW' unless $user eq '-';
}
$chainref = ensure_chain( 'mangle', $chainnames{$chain} );
}
@@ -4976,6 +4984,13 @@ sub process_tc_rule1( $$$$$$$$$$$$$$$$ ) {
$mark = $rest;
} elsif ( supplied $2 ) {
$mark = $2;
if ( supplied $mark && $command eq 'IPMARK' ) {
my @params = split ',', $mark;
$params[1] = '0xff' unless supplied $params[1];
$params[2] = '0x00' unless supplied $params[2];
$params[3] = '0' unless supplied $params[3];
$mark = join ',', @params;
}
} else {
$mark = '';
}
@@ -4986,7 +5001,7 @@ sub process_tc_rule1( $$$$$$$$$$$$$$$$ ) {
}
}
$command = ( $command ? "$command($mark)" : $mark ) . $designator;
$command = ( $command ? supplied $mark ? "$command($mark)" : $command : $mark ) . $designator;
my $line = ( $family == F_IPV6 ?
"$command\t$source\t$dest\t$proto\t$ports\t$sports\t$user\t$testval\t$length\t$tos\t$connbytes\t$helper\t$headers\t$probability\t$dscp\t$state" :
"$command\t$source\t$dest\t$proto\t$ports\t$sports\t$user\t$testval\t$length\t$tos\t$connbytes\t$helper\t$probability\t$dscp\t$state" );

View File

@@ -352,7 +352,7 @@ sub process_simple_device() {
my $prio = 16 | $i;
emit "run_tc qdisc add dev $physical parent $number:$i handle ${number}${i}: sfq quantum 1875 limit 127 perturb 10";
emit "run_tc filter add dev $physical protocol all prio $prio parent $number: handle $i fw classid $number:$i";
emit "run_tc filter add dev $physical protocol all prio 1 parent ${number}$i: handle ${number}${i} flow hash keys $type divisor 1024" if $type ne '-' && have_capability 'FLOW_FILTER';
emit "run_tc filter add dev $physical protocol all prio 1 parent ${number}$i: flow hash keys $type divisor 1024" if $type ne '-' && have_capability 'FLOW_FILTER';
emit '';
}
@@ -2166,7 +2166,7 @@ sub convert_tos($$) {
if ( my $fn = open_file 'tos' ) {
first_entry(
sub {
my $date = localtime;
my $date = compiletime;
progress_message2 "Converting $fn...";
print( $mangle
"#\n" ,
@@ -2234,13 +2234,19 @@ sub convert_tos($$) {
}
}
sub open_mangle_for_output() {
sub open_mangle_for_output( $ ) {
my ($fn ) = @_;
my ( $mangle, $fn1 );
if ( -f ( $fn1 = find_writable_file( 'mangle' ) ) ) {
open( $mangle , '>>', $fn1 ) || fatal_error "Unable to open $fn1:$!";
} else {
open( $mangle , '>', $fn1 ) || fatal_error "Unable to open $fn1:$!";
#
# Transfer permissions from the existing tcrules file to the new mangle file
#
transfer_permissions( $fn, $fn1 );
print $mangle <<'EOF';
#
# Shorewall version 4 - Mangle File
@@ -2326,13 +2332,13 @@ sub setup_tc( $ ) {
#
# We are going to convert this tcrules file to the equivalent mangle file
#
( $mangle, $fn1 ) = open_mangle_for_output;
( $mangle, $fn1 ) = open_mangle_for_output( $fn );
directive_callback( sub () { print $mangle "$_[1]\n" unless $_[0] eq 'FORMAT'; 0; } );
first_entry(
sub {
my $date = localtime;
my $date = compiletime;
progress_message2 "Converting $fn...";
print( $mangle
"#\n" ,
@@ -2376,7 +2382,7 @@ sub setup_tc( $ ) {
#
# We are going to convert this tosfile to the equivalent mangle file
#
( $mangle, $fn1 ) = open_mangle_for_output;
( $mangle, $fn1 ) = open_mangle_for_output( $fn );
convert_tos( $mangle, $fn1 );
close $mangle;
}

View File

@@ -337,6 +337,7 @@ sub initialize( $$ ) {
arp_ignore => ENUM_IF_OPTION,
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
bridge => SIMPLE_IF_OPTION,
dbl => ENUM_IF_OPTION,
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
detectnets => OBSOLETE_IF_OPTION,
dhcp => SIMPLE_IF_OPTION,
@@ -387,6 +388,7 @@ sub initialize( $$ ) {
%validinterfaceoptions = ( accept_ra => NUMERIC_IF_OPTION,
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
bridge => SIMPLE_IF_OPTION,
dbl => ENUM_IF_OPTION,
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
dhcp => SIMPLE_IF_OPTION,
ignore => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
@@ -1191,6 +1193,7 @@ sub process_interface( $$ ) {
my %options;
$options{port} = 1 if $port;
$options{dbl} = $config{DYNAMIC_BLACKLIST} =~ /^ipset(-only)?,src-dst/ ? '1:2' : $config{DYNAMIC_BLACKLIST} ? '1:0' : '0:0';
my $hostoptionsref = {};
@@ -1234,6 +1237,8 @@ sub process_interface( $$ ) {
} else {
warning_message "The 'blacklist' option is ignored on multi-zone interfaces";
}
} elsif ( $option eq 'nodbl' ) {
$options{dbl} = '0:0';
} else {
$options{$option} = 1;
$hostoptions{$option} = 1 if $hostopt;
@@ -1256,6 +1261,11 @@ sub process_interface( $$ ) {
} else {
$options{arp_ignore} = 1;
}
} elsif ( $option eq 'dbl' ) {
my %values = ( none => '0:0', src => '1:0', dst => '2:0', 'src-dst' => '1:2' );
fatal_error q(The 'dbl' option requires a value) unless defined $value;
fatal_error qq(Invalid setting ($value) for 'dbl') unless defined ( $options{dbl} = $values{$value} );
} else {
assert( 0 );
}
@@ -1906,7 +1916,7 @@ sub verify_required_interfaces( $ ) {
my $returnvalue = 0;
my $interfaces = find_interfaces_by_option 'wait';
my $interfaces = find_interfaces_by_option( 'wait');
if ( @$interfaces ) {
my $first = 1;
@@ -1972,7 +1982,7 @@ sub verify_required_interfaces( $ ) {
}
$interfaces = find_interfaces_by_option 'required';
$interfaces = find_interfaces_by_option( 'required' );
if ( @$interfaces ) {

View File

@@ -136,7 +136,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -147,7 +147,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -144,7 +144,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -147,7 +147,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -1215,7 +1215,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PR
fi
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then

View File

@@ -493,13 +493,13 @@ compiler() {
case "$g_doing" in
Compiling|Checking)
progress_message3 "$g_doing using $g_product $SHOREWALL_VERSION..."
progress_message3 "$g_doing using Shorewall $SHOREWALL_VERSION..."
;;
Updating)
progress_message3 "Updating $g_product configuration to $SHOREWALL_VERSION..."
;;
*)
[ -n "$g_doing" ] && progress_message3 "$g_doing using $g_product $SHOREWALL_VERSION..."
[ -n "$g_doing" ] && progress_message3 "$g_doing using Shorewall $SHOREWALL_VERSION..."
;;
esac
#

View File

@@ -306,6 +306,72 @@ loc eth2 -</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">dbl={none|src|dst|src-dst}</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.10. This option defined whether
or not dynamic blacklisting is applied to packets entering the
firewall through this interface and whether the source address
and/or destination address is to be compared against the
ipset-based dynamic blacklist (DYNAMIC_BLACKLIST=ipset... in
<ulink
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink>).
The default is determine by the setting of
DYNAMIC_BLACKLIST:</para>
<variablelist>
<varlistentry>
<term>DYNAMIC_BLACKLIST=No</term>
<listitem>
<para>Default is <emphasis role="bold">none</emphasis>
(e.g., no dynamic blacklist checking).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DYNAMIC_BLACKLIST=Yes</term>
<listitem>
<para>Default is <emphasis role="bold">src</emphasis>
(e.g., the source IP address is checked).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DYNAMIC_BLACKLIST=ipset[-only]</term>
<listitem>
<para>Default is <emphasis
role="bold">src</emphasis>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DYNAMIC_BLACKLIST=ipset[-only],src-dst...</term>
<listitem>
<para>Default is <emphasis
role="bold">src-dst</emphasis> (e.g., the source IP
addresses in checked against the ipset on input and the
destination IP address is checked against the ipset on
packets originating from the firewall and leaving
through this interface).</para>
</listitem>
</varlistentry>
</variablelist>
<para>The normal setting for this option will be <emphasis
role="bold">dst</emphasis> or <emphasis
role="bold">none</emphasis> for internal interfaces and
<emphasis role="bold">src</emphasis> or <emphasis
role="bold">src-dst</emphasis> for Internet-facing
interfaces.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">destonly</emphasis></term>
@@ -348,7 +414,7 @@ loc eth2 -</programlisting>
url="../bridge-Shorewall-perl.html">Shorewall-perl for
firewall/bridging</ulink>, then you need to include
DHCP-specific rules in <ulink
url="/manpages/shorewall-rules.html">shorewall-rules</ulink>(8).
url="/manpages/shorewall-rules.html">shorewall-rules</ulink>(5).
DHCP uses UDP ports 67 and 68.</para>
</note>
</listitem>
@@ -380,7 +446,7 @@ loc eth2 -</programlisting>
</varlistentry>
<varlistentry>
<term>loopback</term>
<term><emphasis role="bold">loopback</emphasis></term>
<listitem>
<para>Added in Shorewall 4.6.6. Designates the interface as
@@ -451,8 +517,8 @@ loc eth2 -</programlisting>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">mss</emphasis>=<emphasis>number</emphasis></term>
<term><emphasis role="bold"><emphasis
role="bold">mss</emphasis>=</emphasis><emphasis>number</emphasis></term>
<listitem>
<para>Added in Shorewall 4.0.3. Causes forwarded TCP SYN
@@ -493,7 +559,10 @@ loc eth2 -</programlisting>
<listitem>
<para>Added in Shorewall 5.0.8. When specified, dynamic
blacklisting is disabled on the interface.</para>
blacklisting is disabled on the interface. Beginning with
Shorewall 5.0.10, <emphasis role="bold">nodbl</emphasis> is
equivalent to <emphasis
role="bold">dbl=none</emphasis>.</para>
</listitem>
</varlistentry>

View File

@@ -964,7 +964,9 @@
blacklisted by a <emphasis role="bold">drop</emphasis>, <emphasis
role="bold">logdrop</emphasis>, <emphasis
role="bold">reject</emphasis>, or <emphasis
role="bold">logreject</emphasis> command.</para>
role="bold">logreject</emphasis> command. Beginning with Shorewall
5.0.10, this command can also re-enable addresses blacklisted using
the <command>blacklist</command> command.</para>
</listitem>
</varlistentry>

View File

@@ -679,7 +679,9 @@
<para>Re-enables receipt of packets from hosts previously
blacklisted by a <command>drop</command>,
<command>logdrop</command>, <command>reject</command>, or
<command>logreject</command> command.</para>
<command>logreject</command> command. Beginning with Shorewall
5.0.10, this command can also re-enable addresses blacklisted using
the <command>blacklist</command> command.</para>
</listitem>
</varlistentry>

View File

@@ -129,7 +129,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -130,7 +130,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -129,7 +129,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -129,7 +129,7 @@ AUTOCOMMENT=Yes
AUTOHELPERS=Yes
AUTOMAKE=No
AUTOMAKE=Yes
BLACKLIST="NEW,INVALID,UNTRACKED"

View File

@@ -237,6 +237,66 @@ loc eth2 -</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">dbl={none|src|dst|src-dst}</emphasis></term>
<listitem>
<para>Added in Shorewall 5.0.10. This option defined whether
or not dynamic blacklisting is applied to packets entering the
firewall through this interface and whether the source address
and/or destination address is to be compared against the
ipset-based dynamic blacklist (DYNAMIC_BLACKLIST=ipset... in
<ulink
url="manpages6/shorewall6.conf.html">shorewall6.conf(5)</ulink>).
The default is determine by the setting of
DYNAMIC_BLACKLIST:</para>
<variablelist>
<varlistentry>
<term>DYNAMIC_BLACKLIST=No</term>
<listitem>
<para>Default is <emphasis role="bold">none</emphasis>
(e.g., no dynamic blacklist checking).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DYNAMIC_BLACKLIST=Yes</term>
<listitem>
<para>Default is <emphasis role="bold">src</emphasis>
(e.g., the source IP address is checked against the
ipset).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DYNAMIC_BLACKLIST=ipset[-only]</term>
<listitem>
<para>Default is <emphasis
role="bold">src</emphasis>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>DYNAMIC_BLACKLIST=ipset[-only],src-dst...</term>
<listitem>
<para>Default is <emphasis
role="bold">src-dst</emphasis> (e.g., the source IP
addresses in checked against the ipset on input and the
destination IP address is checked against the ipset on
packets originating from the firewall and leaving
through this interface).</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">destonly</emphasis></term>
@@ -321,7 +381,7 @@ loc eth2 -</programlisting>
</varlistentry>
<varlistentry>
<term>loopback</term>
<term><emphasis role="bold">loopback</emphasis></term>
<listitem>
<para>Added in Shorewall 4.6.6. Designates the interface as
@@ -370,7 +430,10 @@ loc eth2 -</programlisting>
<listitem>
<para>Added in Shorewall 5.0.8. When specified, dynamic
blacklisting is disabled on the interface.</para>
blacklisting is disabled on the interface. Beginning with
Shorewall 5.0.10, <emphasis role="bold">nodbl</emphasis> is
equivalent to <emphasis
role="bold">dbl=none</emphasis>.</para>
</listitem>
</varlistentry>

View File

@@ -1658,7 +1658,7 @@
<varlistentry>
<term><emphasis role="bold">route</emphasis>, <emphasis
role="bold">ipv6-route</emphasis> or <emphasis
role="bold">41</emphasis></term>
role="bold">43</emphasis></term>
<listitem>
<para>IPv6 Route extension header.</para>

View File

@@ -932,7 +932,9 @@
blacklisted by a <emphasis role="bold">drop</emphasis>, <emphasis
role="bold">logdrop</emphasis>, <emphasis
role="bold">reject</emphasis>, or <emphasis
role="bold">logreject</emphasis> command.</para>
role="bold">logreject</emphasis> command. Beginning with Shorewall
5.0.10, this command can also re-enable addresses blacklisted using
the <command>blacklist</command> command.</para>
</listitem>
</varlistentry>

View File

@@ -95,6 +95,11 @@ rsyncok eth1:<emphasis role="bold">dynamic</emphasis></programlisting>
<para>When the <emphasis role="bold">dynamic_shared</emphasis> option is
specified, a single ipset is created; the ipset has the same name as the
zone.</para>
<para>In the above example, <emphasis role="bold">rsyncok</emphasis> is
a sub-zone of the single zone <emphasis role="bold">loc</emphasis>.
Making a dynamic zone a sub-zone of multiple other zones is also
supported.</para>
</section>
<section id="Adding">

View File

@@ -301,8 +301,8 @@
<para>COMMENT, FORMAT and SECTION Lines now require the leading question
mark ("?"). In earlier releases, the question mark was optional. The
<command>shorewall[6] update -D</command> command will insert the
question marks for you.</para>
<command>shorewall[6] update -D</command> command in Shorewall 4.6 will
insert the question marks for you.</para>
</section>
</section>
@@ -359,7 +359,7 @@
<para>It is strongly recommended that you first upgrade your installation
to a 4.6 release that supports the <option>-A</option> option to the
<command>update</command> command; 4.6.13 is preferred.</para>
<command>update</command> command; 4.6.13.2 or later is preferred.</para>
<para>Once you are on that release, execute the <command>shorewall update
-A</command> command (and <command>shorewall6 update -A</command> if you
@@ -374,11 +374,11 @@
likely won't start or work correctly until you do.</para>
<para>The <command>update</command> command in Shorewall 5 has many fewer
options. The <option>-b</option>, <option>-t</option>, <option>-n</option>
and <option>-s </option>options have been removed -- the updates triggered
by those options are now performed unconditionally. The <option>-i
</option>and <option>-A </option>options have been retained - both enable
checking for issues that could result if INLINE_MATCHES were to be set to
Yes.</para>
options. The <option>-b</option>, <option>-t</option>,
<option>-n</option>, <option>-D</option> and <option>-s </option>options
have been removed -- the updates triggered by those options are now
performed unconditionally. The <option>-i </option>and <option>-A
</option>options have been retained - both enable checking for issues that
could result if INLINE_MATCHES were to be set to Yes.</para>
</section>
</article>

View File

@@ -48,7 +48,7 @@
<section id="Intro">
<title>Introduction</title>
<para>Shorewall supports two different types of blackliisting; rule-based,
<para>Shorewall supports two different types of blacklisting; rule-based,
static and dynamic. The BLACKLIST option in /etc/shorewall/shorewall.conf
controls the degree of blacklist filtering.</para>