forked from extern/shorewall_code
Compare commits
136 Commits
5.0.7-Base
...
5.0.8-base
Author | SHA1 | Date | |
---|---|---|---|
|
f16e3f1fbe | ||
|
71bd7a4647 | ||
|
ab95607f5f | ||
|
f9bbca8b05 | ||
|
0faf3b6db1 | ||
|
3253c882e9 | ||
|
5212dba7cb | ||
|
35a22eedac | ||
|
2b7ef0fe32 | ||
|
b53de922d1 | ||
|
365ffaf645 | ||
|
ae852b513d | ||
|
9611b588e3 | ||
|
eb95532248 | ||
|
fb8dbcf44b | ||
|
62a14aab28 | ||
|
335f2968f8 | ||
|
32f888a7d4 | ||
|
c725372639 | ||
|
524838ae47 | ||
|
549af8b402 | ||
|
6aa0ecae4f | ||
|
434e042494 | ||
|
9fa0df2fd1 | ||
|
074655d1bd | ||
|
216bc715e8 | ||
|
541ecb67b4 | ||
|
dbd42e1d5d | ||
|
04ec8273ef | ||
|
772f88b1fd | ||
|
3e0b8c60a2 | ||
|
fc2b555cdb | ||
|
16afd880b2 | ||
|
76a5841fcd | ||
|
9758e8cdc5 | ||
|
2cf3706864 | ||
|
3028dafbac | ||
|
16a31c3d29 | ||
|
d3f377e915 | ||
|
54a5748395 | ||
|
6c00f72f44 | ||
|
8dc88898c8 | ||
|
deaaecdf1c | ||
|
05e4049174 | ||
|
ef10515a42 | ||
|
5db6cb1b7d | ||
|
76c8917aa7 | ||
|
be58d530c4 | ||
|
321476fd51 | ||
|
bd6b32eb25 | ||
|
4fdf54eca1 | ||
|
70bbd21b35 | ||
|
87a9b95f73 | ||
|
ecd7261365 | ||
|
293cd1d66a | ||
|
436b5d89ce | ||
|
26795cf082 | ||
|
95e4071f34 | ||
|
6366fb40cf | ||
|
20179a5c9d | ||
|
b7e6893f7d | ||
|
3ac3ae279f | ||
|
54843c617d | ||
|
e9467326f3 | ||
|
80bf77e8a8 | ||
|
1e5ebee799 | ||
|
74fe7b302e | ||
|
d70e18535b | ||
|
64a6b36918 | ||
|
35bc0bd8ef | ||
|
4034ebc270 | ||
|
bd33bb7105 | ||
|
dbb23d8807 | ||
|
5c4ee58f44 | ||
|
bf8b519da6 | ||
|
724d430ba4 | ||
|
11479b14f9 | ||
|
54eea167e5 | ||
|
8d92d07352 | ||
|
6122a1db19 | ||
|
2962809243 | ||
|
23a91d7c26 | ||
|
30b2b2dcb4 | ||
|
46a86cfa58 | ||
|
ad2dfd9eaf | ||
|
001aabf72c | ||
|
7052819a9c | ||
|
2b1244c110 | ||
|
94803b63b1 | ||
|
5f33cb5d0a | ||
|
deda26c790 | ||
|
f9f349a148 | ||
|
2842e897c9 | ||
|
de44a16094 | ||
|
6560e74c2c | ||
|
f7ddf3008d | ||
|
cb608172d3 | ||
|
f806010521 | ||
|
205254e043 | ||
|
a7efa12fff | ||
|
95c4f2d7f6 | ||
|
89189f7836 | ||
|
c2e3156e5c | ||
|
ffe9f88c07 | ||
|
e4c9c83e2b | ||
|
9a7f6512a1 | ||
|
77a93d10a4 | ||
|
a96ee0ab9a | ||
|
646572098c | ||
|
75df718865 | ||
|
ae8e2f70ea | ||
|
39f5b77e5f | ||
|
cb5a2519f3 | ||
|
4151f7c504 | ||
|
054837aeea | ||
|
ebf55a84f0 | ||
|
b637d303b9 | ||
|
0dbf42424d | ||
|
f22e8d6d55 | ||
|
d98305c6f4 | ||
|
3cbfdadb32 | ||
|
81d76e3817 | ||
|
df1b1f6768 | ||
|
3881b38e02 | ||
|
8a8f3b6f59 | ||
|
b9bed00123 | ||
|
38aa7797c4 | ||
|
404540ffe1 | ||
|
dd3c0daa08 | ||
|
4fddfcfba0 | ||
|
421d5f6043 | ||
|
382ab380a2 | ||
|
2342c7cd9c | ||
|
66ae4975b2 | ||
|
5b7a9db170 | ||
|
899a317c95 |
@@ -339,7 +339,15 @@ show_classifiers() {
|
||||
#
|
||||
# Display blacklist chains
|
||||
#
|
||||
blacklist_filter() {
|
||||
awk \
|
||||
'BEGIN { prnt=0; }; \
|
||||
/^Members:/ { print "Dynamic:"; prnt=1; next; }; \
|
||||
{ if (prnt == 1) print; };'
|
||||
}
|
||||
|
||||
show_bl() {
|
||||
[ -n "$g_blacklistipset" ] && ipset -L $g_blacklistipset | blacklist_filter && echo
|
||||
$g_tool -L $g_ipt_options | \
|
||||
awk 'BEGIN {prnt=0; };
|
||||
/^$/ {if (prnt == 1) print ""; prnt=0; };
|
||||
@@ -3444,6 +3452,29 @@ reject_command() {
|
||||
fi
|
||||
}
|
||||
|
||||
blacklist_command() {
|
||||
local family
|
||||
|
||||
[ $# -gt 0 ] || fatal_error "Missing address"
|
||||
|
||||
[ -z "$g_blacklistipset" ] && fatal_error "The blacklist command is not supported in the current $g_product configuration"
|
||||
|
||||
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
|
||||
|
||||
$IPSET -A $g_blacklistipset $@ || { error_message "ERROR: Address $1 not blacklisted"; return 1; }
|
||||
|
||||
return 0
|
||||
}
|
||||
save_command() {
|
||||
local finished
|
||||
finished=0
|
||||
@@ -3793,6 +3824,38 @@ get_config() {
|
||||
g_pager="| $g_pager"
|
||||
fi
|
||||
|
||||
if [ -n "$DYNAMIC_BLACKLIST" ]; then
|
||||
case $DYNAMIC_BLACKLIST in
|
||||
[Nn]o)
|
||||
DYNAMIC_BLACKLIST='';
|
||||
;;
|
||||
[Yy]es)
|
||||
;;
|
||||
ipset|ipset::*|ipset-only|ipset-only::*|ipset,src-dst|ipset-only,src-dst::*)
|
||||
g_blacklistipset=SW_DBL$g_family
|
||||
;;
|
||||
ipset:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
ipset,src-dst:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset,src-dst:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
ipset-only:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
ipset-only,src-dst:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only,src-dst:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
*)
|
||||
fatal_error "Invalid value ($DYNAMIC_BLACKLIST) for DYNAMIC_BLACKLIST"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
lib=$(find_file lib.cli-user)
|
||||
|
||||
[ -f $lib ] && . $lib
|
||||
@@ -3819,7 +3882,7 @@ start_command() {
|
||||
rc=$?
|
||||
else
|
||||
error_message "${VARDIR}/firewall is missing or is not executable"
|
||||
logger -p kern.err "ERROR:$g_product start failed"
|
||||
mylogger kern.err "ERROR:$g_product start failed"
|
||||
rc=6
|
||||
fi
|
||||
|
||||
@@ -3952,7 +4015,7 @@ restart_command() {
|
||||
rc=$?
|
||||
else
|
||||
error_message "${VARDIR}/firewall is missing or is not executable"
|
||||
logger -p kern.err "ERROR:$g_product $COMMAND failed"
|
||||
mylogger kern.err "ERROR:$g_product $COMMAND failed"
|
||||
rc=6
|
||||
fi
|
||||
|
||||
@@ -3983,6 +4046,7 @@ usage() # $1 = exit status
|
||||
echo "where <command> is one of:"
|
||||
echo " add <interface>[:<host-list>] ... <zone>"
|
||||
echo " allow <address> ..."
|
||||
echo " blacklist <address> [ <option> ... ]"
|
||||
ecko " [ check | ck ] [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ -i ] [ <directory> ]"
|
||||
echo " clear"
|
||||
ecko " [ compile | co ] [ -e ] [ -p ] [ -t ] [ -c ] [ -d ] [ -T ] [ -i ] [ <directory name> ] [ <path name> ]"
|
||||
@@ -4134,6 +4198,7 @@ shorewall_cli() {
|
||||
g_loopback=
|
||||
g_compiled=
|
||||
g_pager=
|
||||
g_blacklistipset=
|
||||
|
||||
VERBOSE=
|
||||
VERBOSITY=1
|
||||
@@ -4325,6 +4390,13 @@ shorewall_cli() {
|
||||
fatal_error "$g_product is not running"
|
||||
fi
|
||||
;;
|
||||
blacklist)
|
||||
get_config Yes
|
||||
shift
|
||||
[ -n "$g_nolock" ] || mutex_on
|
||||
blacklist_command $@
|
||||
[ -n "$g_nolock" ] || mutex_off
|
||||
;;
|
||||
run)
|
||||
[ $# -gt 1 ] || fatal_error "Missing function name"
|
||||
get_config Yes
|
||||
|
@@ -25,6 +25,22 @@
|
||||
# scripts rather than loaded at run-time.
|
||||
#
|
||||
#########################################################################################
|
||||
#
|
||||
# Wrapper around logger that sets the tag according to $SW_LOGGERTAG
|
||||
#
|
||||
mylogger() {
|
||||
local level
|
||||
|
||||
level=$1
|
||||
shift
|
||||
|
||||
if [ -n "$SW_LOGGERTAG" ]; then
|
||||
logger -p $level -t "$SW_LOGGERTAG" $*
|
||||
else
|
||||
logger -p $level $*
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Issue a message and stop
|
||||
#
|
||||
@@ -33,24 +49,24 @@ startup_error() # $* = Error Message
|
||||
echo " ERROR: $@: Firewall state not changed" >&2
|
||||
|
||||
if [ $LOG_VERBOSITY -ge 0 ]; then
|
||||
timestamp="$(date +'%b %d %T') "
|
||||
timestamp="$(date +'%b %e %T') "
|
||||
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
|
||||
fi
|
||||
|
||||
case $COMMAND in
|
||||
start)
|
||||
logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed"
|
||||
mylogger kern.err "ERROR:$g_product start failed:Firewall state not changed"
|
||||
;;
|
||||
restart)
|
||||
logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed"
|
||||
mylogger kern.err "ERROR:$g_product restart failed:Firewall state not changed"
|
||||
;;
|
||||
restore)
|
||||
logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed"
|
||||
mylogger kern.err "ERROR:$g_product restore failed:Firewall state not changed"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $LOG_VERBOSITY -ge 0 ]; then
|
||||
timestamp="$(date +'%b %d %T') "
|
||||
timestamp="$(date +'%b %e %T') "
|
||||
|
||||
case $COMMAND in
|
||||
start)
|
||||
|
@@ -1 +0,0 @@
|
||||
This is the Shorewall-init stable 4.4 branch of Git.
|
@@ -1 +0,0 @@
|
||||
This is the Shorewall-lite stable 4.4 branch of Git.
|
@@ -47,6 +47,19 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>blacklist</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
@@ -693,6 +706,25 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">blacklist</emphasis>
|
||||
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
|
||||
... ]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8 and requires
|
||||
DYNAMIC_BLACKLIST=ipset.. in <ulink
|
||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).
|
||||
Causes packets from the given host or network
|
||||
<replaceable>address</replaceable> to be dropped, based on the
|
||||
setting of BLACKLIST in <ulink
|
||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). The
|
||||
<replaceable>address</replaceable> along with any
|
||||
<replaceable>option</replaceable>s are passed to the <command>ipset
|
||||
add</command> command.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">call <replaceable>function</replaceable> [
|
||||
<replaceable>parameter</replaceable> ... ]</emphasis></term>
|
||||
@@ -1553,6 +1585,34 @@
|
||||
started.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>ENVIRONMENT</title>
|
||||
|
||||
<para>Two environmental variables are recognized by Shorewall-lite:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>SHOREWALL_INIT_SCRIPT</term>
|
||||
|
||||
<listitem>
|
||||
<para>When set to 1, causes Std out to be redirected to the file
|
||||
specified in the STARTUP_LOG option in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>SW_LOGGERTAG</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
|
||||
value is passed to the logger utility in its -t (--tag)
|
||||
option.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>FILES</title>
|
||||
|
||||
|
9
Shorewall/Macros/macro.RedisCluster
Normal file
9
Shorewall/Macros/macro.RedisCluster
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/macro.RedisCluster
|
||||
#
|
||||
# This macro handles Redis Cluster traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||
|
||||
PARAM - - tcp 16379
|
9
Shorewall/Macros/macro.RedisSentinel
Normal file
9
Shorewall/Macros/macro.RedisSentinel
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/macro.RedisSentinel
|
||||
#
|
||||
# This macro handles Redis Sentinel traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||
|
||||
PARAM - - tcp 26379
|
@@ -279,6 +279,7 @@ our %EXPORT_TAGS = (
|
||||
save_docker_rules
|
||||
load_ipsets
|
||||
create_save_ipsets
|
||||
create_load_ipsets
|
||||
validate_nfobject
|
||||
create_nfobjects
|
||||
create_netfilter_load
|
||||
@@ -286,6 +287,7 @@ our %EXPORT_TAGS = (
|
||||
create_chainlist_reload
|
||||
create_stop_load
|
||||
initialize_switches
|
||||
terminating
|
||||
%targets
|
||||
%builtin_target
|
||||
%dscpmap
|
||||
@@ -619,7 +621,7 @@ our %builtin_target = ( ACCEPT => STANDARD + FILTER_TABLE + NAT_TABLE + MAN
|
||||
RAWDNAT => STANDARD + RAW_TABLE,
|
||||
RAWSNAT => STANDARD + RAW_TABLE,
|
||||
REDIRECT => STANDARD + NAT_TABLE,
|
||||
REJECT => STANDARD + FILTER_TABLE,
|
||||
REJECT => STANDARD + FILTER_TABLE + OPTIONS,
|
||||
RETURN => STANDARD + MANGLE_TABLE + RAW_TABLE,
|
||||
SAME => STANDARD,
|
||||
SECMARK => STANDARD + MANGLE_TABLE,
|
||||
@@ -808,14 +810,13 @@ sub initialize( $$$ ) {
|
||||
NETMAP => 1,
|
||||
NFQUEUE => 1,
|
||||
NOTRACK => 1,
|
||||
REDIRECT => 1,
|
||||
RAWDNAT => 1,
|
||||
REDIRECT => 1,
|
||||
RAWSNAT => 1,
|
||||
REJECT => 1,
|
||||
SAME => 1,
|
||||
SNAT => 1,
|
||||
TPROXY => 1,
|
||||
reject => 1,
|
||||
);
|
||||
#
|
||||
# The chain table is initialized via a call to initialize_chain_table() after the configuration and capabilities have been determined.
|
||||
@@ -842,6 +843,24 @@ sub make_terminating( $ ) {
|
||||
$terminating{$_[0]} = 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Determine if a chain is terminating
|
||||
#
|
||||
sub terminating( $ ) {
|
||||
my ( $chainref ) = @_;
|
||||
|
||||
return $chainref->{complete} && ! ( $chainref->{optflags} & RETURNS );
|
||||
}
|
||||
|
||||
sub is_terminating( $$ ) {
|
||||
my ( $table, $target ) = @_;
|
||||
|
||||
if ( my $chainref = $chain_table{$table}{$target} ) {
|
||||
terminating( $chainref );
|
||||
} else {
|
||||
$terminating{$target};
|
||||
}
|
||||
}
|
||||
#
|
||||
# Transform the passed iptables rule into an internal-form hash reference.
|
||||
# Most of the compiler has been converted to use the new form natively.
|
||||
@@ -1309,6 +1328,8 @@ sub push_rule( $$ ) {
|
||||
my $complete = 0;
|
||||
my $ruleref = transform_rule( $_[1], $complete );
|
||||
|
||||
fatal_error "Chain $chainref->{name} jumps to itself" if ( $ruleref->{target} || '' ) eq $chainref->{name};
|
||||
|
||||
set_irule_comment( $chainref, $ruleref );
|
||||
|
||||
$ruleref->{mode} = CMD_MODE if $ruleref->{cmdlevel} = $chainref->{cmdlevel};
|
||||
@@ -1539,6 +1560,7 @@ sub create_irule( $$$;@ ) {
|
||||
$ruleref->{jump} = $jump;
|
||||
$ruleref->{target} = $target;
|
||||
$chainref->{optflags} |= RETURNS_DONT_MOVE if $target eq 'RETURN';
|
||||
$chainref->{complete} ||= ( ! @matches && ( $jump eq 'g' || is_terminating( $chainref->{table}, $target ) ) );
|
||||
$ruleref->{targetopts} = $targetopts if $targetopts;
|
||||
} else {
|
||||
$ruleref->{target} = '';
|
||||
@@ -2030,7 +2052,7 @@ sub chain_base( $ ) {
|
||||
sub forward_chain($)
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_fwd';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_fwd';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2085,7 +2107,7 @@ sub use_forward_chain($$) {
|
||||
#
|
||||
sub input_option_chain($) {
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_iop';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_iop';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2093,7 +2115,7 @@ sub input_option_chain($) {
|
||||
#
|
||||
sub output_option_chain($) {
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_oop';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_oop';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2101,7 +2123,7 @@ sub output_option_chain($) {
|
||||
#
|
||||
sub forward_option_chain($) {
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_fop';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_fop';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2110,7 +2132,7 @@ sub forward_option_chain($) {
|
||||
sub input_chain($)
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_in';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_in';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2173,7 +2195,7 @@ sub use_input_chain($$) {
|
||||
sub output_chain($)
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_out';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_out';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2182,7 +2204,7 @@ sub output_chain($)
|
||||
sub prerouting_chain($)
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_pre';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_pre';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2191,7 +2213,7 @@ sub prerouting_chain($)
|
||||
sub postrouting_chain($)
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_post';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_post';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2244,7 +2266,7 @@ sub use_output_chain($$) {
|
||||
sub masq_chain($)
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_masq';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_masq';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2260,7 +2282,7 @@ sub syn_flood_chain ( $ ) {
|
||||
sub mac_chain( $ )
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_mac';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_mac';
|
||||
}
|
||||
|
||||
sub macrecent_target($)
|
||||
@@ -2297,7 +2319,7 @@ sub load_chain( $ ) {
|
||||
sub snat_chain( $ )
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_snat';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_snat';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2306,7 +2328,7 @@ sub snat_chain( $ )
|
||||
sub ecn_chain( $ )
|
||||
{
|
||||
my $interface = shift;
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : $interface ) . '_ecn';
|
||||
( $config{USE_PHYSICAL_NAMES} ? chain_base( get_physical( $interface ) ) : get_logical( $interface ) ) . '_ecn';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2485,7 +2507,7 @@ sub add_ijump_internal( $$$$$;@ ) {
|
||||
}
|
||||
|
||||
if ( $ruleref->{simple} ) {
|
||||
$fromref->{complete} = 1 if $jump eq 'g' || $terminating{$to};
|
||||
$fromref->{complete} = 1 if $jump eq 'g' || ( $toref ? terminating( $toref ) : $terminating{$to} );
|
||||
}
|
||||
|
||||
$ruleref->{origin} = $origin if $origin;
|
||||
@@ -2915,8 +2937,6 @@ sub initialize_chain_table($) {
|
||||
'A_ACCEPT!' => STANDARD + AUDIT,
|
||||
'A_DROP' => STANDARD + AUDIT,
|
||||
'A_DROP!' => STANDARD + AUDIT,
|
||||
'A_REJECT' => STANDARD + AUDIT,
|
||||
'A_REJECT!' => STANDARD + AUDIT,
|
||||
'NONAT' => STANDARD + NONAT + NATONLY,
|
||||
'CONNMARK' => STANDARD + OPTIONS,
|
||||
'CONTINUE' => STANDARD,
|
||||
@@ -2987,8 +3007,6 @@ sub initialize_chain_table($) {
|
||||
'A_DROP!' => STANDARD + AUDIT,
|
||||
'REJECT' => STANDARD + OPTIONS,
|
||||
'REJECT!' => STANDARD + OPTIONS,
|
||||
'A_REJECT' => STANDARD + AUDIT,
|
||||
'A_REJECT!' => STANDARD + AUDIT,
|
||||
'DNAT' => NATRULE + OPTIONS,
|
||||
'DNAT-' => NATRULE + NATONLY,
|
||||
'REDIRECT' => NATRULE + REDIRECT + OPTIONS,
|
||||
@@ -6335,7 +6353,7 @@ sub log_rule_limit( $$$$$$$$;$ ) {
|
||||
my ($level, $chainref, $chn, $dispo, $limit, $tag, $command, $matches, $origin ) = @_;
|
||||
|
||||
my $prefix = '';
|
||||
my $chain = get_action_chain_name || $chn;
|
||||
my $chain = get_action_chain_name || $chn;
|
||||
my $disposition = get_action_disposition || $dispo;
|
||||
my $original_matches = $matches;
|
||||
my $ruleref;
|
||||
@@ -6435,7 +6453,7 @@ sub log_irule_limit( $$$$$$$$@ ) {
|
||||
|
||||
my $prefix = '';
|
||||
my %matches;
|
||||
my $chain = get_action_chain_name || $chn;
|
||||
my $chain = get_action_chain_name || $chn;
|
||||
my $disposition = get_action_disposition || $dispo;
|
||||
my $original_matches = @matches;
|
||||
|
||||
@@ -7748,7 +7766,10 @@ sub expand_rule( $$$$$$$$$$$$;$ )
|
||||
# No logging or user-specified logging -- add the target rule with matches to the rule chain
|
||||
#
|
||||
if ( $targetref ) {
|
||||
add_expanded_jump( $chainref, $targetref , 0, $prerule . $matches );
|
||||
add_expanded_jump( $chainref ,
|
||||
$targetref ,
|
||||
terminating( $targetref ) ,
|
||||
$prerule . $matches );
|
||||
} else {
|
||||
add_rule( $chainref, $prerule . $matches . $jump , 1 );
|
||||
}
|
||||
@@ -8172,6 +8193,15 @@ else
|
||||
rm -f \${VARDIR}/.dynamic
|
||||
fi
|
||||
EOF
|
||||
if ( $config{MINIUPNPD} ) {
|
||||
emit << "EOF";
|
||||
if chain_exists 'MINIUPNPD-POSTROUTING -t nat'; then
|
||||
$tool -t nat -S MINIUPNPD-POSTROUTING | tail -n +2 > \${VARDIR}/.MINIUPNPD-POSTROUTING
|
||||
else
|
||||
rm -f \${VARDIR}/.MINIUPNPD-POSTROUTING
|
||||
fi
|
||||
EOF
|
||||
}
|
||||
} else {
|
||||
emit <<"EOF";
|
||||
if chain_exists 'UPnP -t nat'; then
|
||||
@@ -8192,6 +8222,15 @@ else
|
||||
rm -f \${VARDIR}/.dynamic
|
||||
fi
|
||||
EOF
|
||||
if ( $config{MINIUPNPD} ) {
|
||||
emit << "EOF";
|
||||
if chain_exists 'MINIUPNPD-POSTROUTING -t nat'; then
|
||||
$utility -t nat | grep '^-A MINIUPNPD-POSTROUTING' > \${VARDIR}/.MINIUPNPD-POSTROUTING
|
||||
else
|
||||
rm -f \${VARDIR}/.MINIUPNPD-POSTROUTING
|
||||
fi
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
pop_indent;
|
||||
@@ -8210,14 +8249,22 @@ EOF
|
||||
emit( '' ), save_docker_rules( $tool ), emit( '' ) if $config{DOCKER};
|
||||
}
|
||||
|
||||
sub ensure_ipset( $ ) {
|
||||
my $set = shift;
|
||||
sub ensure_ipsets( @ ) {
|
||||
my $set;
|
||||
|
||||
if ( @_ > 1 ) {
|
||||
push_indent;
|
||||
emit( "for set in @_; do" );
|
||||
$set = '$set';
|
||||
} else {
|
||||
$set = $_[0];
|
||||
}
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
if ( have_capability 'IPSET_V5' ) {
|
||||
emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
|
||||
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:ip set") ,
|
||||
qq( \$IPSET -N $set hash:ip family inet) ,
|
||||
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:net set") ,
|
||||
qq( \$IPSET -N $set hash:net family inet timeout 0 counters) ,
|
||||
qq( fi) );
|
||||
} else {
|
||||
emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
|
||||
@@ -8227,10 +8274,15 @@ sub ensure_ipset( $ ) {
|
||||
}
|
||||
} else {
|
||||
emit ( qq( if ! qt \$IPSET -L $set -n; then) ,
|
||||
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:ip set") ,
|
||||
qq( \$IPSET -N $set hash:ip family inet6) ,
|
||||
qq( error_message "WARNING: ipset $set does not exist; creating it as an hash:net set") ,
|
||||
qq( \$IPSET -N $set hash:net family inet6 timeout 0 counters) ,
|
||||
qq( fi) );
|
||||
}
|
||||
|
||||
if ( @_ > 1 ) {
|
||||
emit 'done';
|
||||
pop_indent;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
@@ -8239,22 +8291,26 @@ sub ensure_ipset( $ ) {
|
||||
sub create_save_ipsets() {
|
||||
my @ipsets = all_ipsets;
|
||||
|
||||
emit( "#\n#Save the ipsets specified by the SAVE_IPSETS setting and by dynamic zones\n#",
|
||||
emit( "#\n#Save the ipsets specified by the SAVE_IPSETS setting and by dynamic zones and blacklisting\n#",
|
||||
'save_ipsets() {' );
|
||||
|
||||
if ( @ipsets || @{$globals{SAVED_IPSETS}} || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
|
||||
emit( ' local file' ,
|
||||
' local set' ,
|
||||
'',
|
||||
' file=${1:-${VARDIR}/save.ipsets}'
|
||||
);
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit '';
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
ensure_ipsets( @ipsets );
|
||||
}
|
||||
|
||||
if ( $config{SAVE_IPSETS} ) {
|
||||
if ( $family == F_IPV6 || $config{SAVE_IPSETS} eq 'ipv4' ) {
|
||||
#
|
||||
# Requires V5 or later
|
||||
#
|
||||
my $select = $family == F_IPV4 ? '^create.*family inet ' : 'create.*family inet6 ';
|
||||
|
||||
emit( '' ,
|
||||
@@ -8263,11 +8319,6 @@ sub create_save_ipsets() {
|
||||
' local set' ,
|
||||
);
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit '';
|
||||
emit( " \$IPSET -S $_ >> \$file" ) for @ipsets;
|
||||
}
|
||||
|
||||
emit( '',
|
||||
" for set in \$(\$IPSET save | grep '$select' | cut -d' ' -f2); do" ,
|
||||
" \$IPSET save \$set >> \$file" ,
|
||||
@@ -8275,6 +8326,9 @@ sub create_save_ipsets() {
|
||||
'',
|
||||
);
|
||||
} else {
|
||||
#
|
||||
# Saving all ipsets (IPv4 and IPv6, if any )
|
||||
#
|
||||
emit (
|
||||
'',
|
||||
' if eval $IPSET -S > ${VARDIR}/ipsets.tmp; then' ,
|
||||
@@ -8283,28 +8337,48 @@ sub create_save_ipsets() {
|
||||
}
|
||||
|
||||
emit( " return 0",
|
||||
'',
|
||||
"}\n" );
|
||||
} elsif ( @ipsets || $globals{SAVED_IPSETS} ) {
|
||||
#
|
||||
# Requires V5 or later
|
||||
#
|
||||
my %ipsets;
|
||||
#
|
||||
# Requires V
|
||||
#
|
||||
$ipsets{$_} = 1 for ( @ipsets, @{$globals{SAVED_IPSETS}} );
|
||||
|
||||
my @sets = sort keys %ipsets;
|
||||
|
||||
emit( '' ,
|
||||
' rm -f $file' ,
|
||||
' touch $file' ,
|
||||
' rm -f ${VARDIR}/ipsets.tmp' ,
|
||||
' touch ${VARDIR}/ipsets.tmp' ,
|
||||
);
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit '';
|
||||
emit( " \$IPSET -S $_ >> \${VARDIR}/ipsets.tmp" ) for @ipsets;
|
||||
if ( @sets > 1 ) {
|
||||
emit( '' ,
|
||||
" for set in @sets; do" ,
|
||||
' if qt $IPSET list $set; then' ,
|
||||
' $IPSET save $set >> ${VARDIR}/ipsets.tmp' ,
|
||||
' else' ,
|
||||
' error_message "ipset $set not saved (not found)"' ,
|
||||
' fi' ,
|
||||
' done' );
|
||||
} else {
|
||||
my $set = $sets[0];
|
||||
|
||||
emit( '' ,
|
||||
" if qt \$IPSET list $set; then" ,
|
||||
" \$IPSET save $set >> \${VARDIR}/ipsets.tmp" ,
|
||||
' else' ,
|
||||
" error_message 'ipset $set not saved (not found)'" ,
|
||||
' fi' );
|
||||
}
|
||||
|
||||
emit( '' ,
|
||||
" if qt \$IPSET list $_; then" ,
|
||||
" \$IPSET save $_ >> \${VARDIR}/ipsets.tmp" ,
|
||||
' else' ,
|
||||
" error_message 'ipset $_ not saved (not found)'" ,
|
||||
" fi\n" ) for @{$globals{SAVED_IPSETS}};
|
||||
|
||||
emit( '' ,
|
||||
" grep -qE -- \"(-N|^create )\" \${VARDIR}/ipsets.tmp && cat \${VARDIR}/ipsets.tmp >> \$file\n" ,
|
||||
" grep -q -- \"^create \" \${VARDIR}/ipsets.tmp && mv -f \${VARDIR}/ipsets.tmp \$file\n" ,
|
||||
'' ,
|
||||
' return 0',
|
||||
'' ,
|
||||
@@ -8320,13 +8394,58 @@ sub create_save_ipsets() {
|
||||
}
|
||||
}
|
||||
|
||||
sub load_ipsets() {
|
||||
sub create_load_ipsets() {
|
||||
|
||||
my @ipsets = all_ipsets;
|
||||
my @ipsets = all_ipsets; #Dynamic Zone IPSETS
|
||||
|
||||
if ( @ipsets || @{$globals{SAVED_IPSETS}} || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
|
||||
emit ( '', );
|
||||
emit ( '',
|
||||
my $setting = $config{SAVE_IPSETS};
|
||||
|
||||
my $havesets = @ipsets || @{$globals{SAVED_IPSETS}} || ( $setting && have_ipset_rules );
|
||||
|
||||
#
|
||||
# Generate a function that flushes and destroys sets prior to restoring them
|
||||
#
|
||||
if ( $havesets ) {
|
||||
my $select = $family == F_IPV4 ? '^create.*family inet ' : 'create.*family inet6 ';
|
||||
|
||||
emit ( "#\n#Flush and Destroy the sets that we will subsequently attempt to restore\n#",
|
||||
'zap_ipsets() {',
|
||||
' local set',
|
||||
'' );
|
||||
|
||||
if ( $family == F_IPV6 || $setting !~ /yes/i ) {
|
||||
#
|
||||
# Requires V5 or later
|
||||
#
|
||||
emit( '' ,
|
||||
" for set in \$(\$IPSET save | grep '$select' | cut -d' ' -f2); do" ,
|
||||
' $IPSET flush $set' ,
|
||||
' $IPSET destroy $set' ,
|
||||
" done" ,
|
||||
'',
|
||||
);
|
||||
} else {
|
||||
#
|
||||
# Restoring all ipsets (IPv4 and IPv6, if any)
|
||||
#
|
||||
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
|
||||
' $IPSET -F' ,
|
||||
' $IPSET -X' ,
|
||||
' fi' );
|
||||
};
|
||||
|
||||
emit( '}' );
|
||||
}
|
||||
#
|
||||
# Now generate load_ipsets()
|
||||
|
||||
emit ( "#\n#Flush and Destroy the sets then load fresh copy from a saved ipset file\n#",
|
||||
'load_ipsets() {' );
|
||||
|
||||
push_indent;
|
||||
|
||||
if ( $havesets ) {
|
||||
emit( '',
|
||||
'case $IPSET in',
|
||||
' */*)',
|
||||
' [ -x "$IPSET" ] || startup_error "IPSET=$IPSET does not exist or is not executable"',
|
||||
@@ -8337,86 +8456,56 @@ sub load_ipsets() {
|
||||
' ;;',
|
||||
'esac' ,
|
||||
'' ,
|
||||
'if [ "$COMMAND" = start ]; then' );
|
||||
'if [ "$COMMAND" = start ]; then' ); ##################### Start Command ##################
|
||||
|
||||
if ( $config{SAVE_IPSETS} ) {
|
||||
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
|
||||
' $IPSET -F' ,
|
||||
' $IPSET -X' ,
|
||||
' $IPSET -R < ${VARDIR}/ipsets.save' ,
|
||||
' fi' );
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit ( '' );
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
emit ( '' );
|
||||
|
||||
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
|
||||
' $IPSET flush' ,
|
||||
' $IPSET destroy' ,
|
||||
' $IPSET restore < ${VARDIR}/ipsets.save' ,
|
||||
" fi\n" ) for @{$globals{SAVED_IPSETS}};
|
||||
}
|
||||
} else {
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
|
||||
if ( @{$globals{SAVED_IPSETS}} ) {
|
||||
emit ( '' );
|
||||
|
||||
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
|
||||
' $IPSET flush' ,
|
||||
' $IPSET destroy' ,
|
||||
' $IPSET restore < ${VARDIR}/ipsets.save' ,
|
||||
" fi\n" ) for @{$globals{SAVED_IPSETS}};
|
||||
}
|
||||
if ( $config{SAVE_IPSETS} || @{$globals{SAVED_IPSETS}} ) {
|
||||
emit( ' if [ -f ${VARDIR}/ipsets.save ]; then',
|
||||
' zap_ipsets',
|
||||
' $IPSET -R < ${VARDIR}/ipsets.save',
|
||||
' fi' );
|
||||
}
|
||||
|
||||
emit ( 'elif [ "$COMMAND" = restore -a -z "$g_recovering" ]; then' );
|
||||
if ( @ipsets ) {
|
||||
emit ( '' );
|
||||
ensure_ipsets( @ipsets );
|
||||
}
|
||||
|
||||
if ( $config{SAVE_IPSETS} ) {
|
||||
emit ( 'elif [ "$COMMAND" = restore -a -z "$g_recovering" ]; then' ); ### Restore Command #################
|
||||
|
||||
if ( $config{SAVE_IPSETS} || @{$globals{SAVED_IPSETS}} ) {
|
||||
emit( ' if [ -f $(my_pathname)-ipsets ]; then' ,
|
||||
' if chain_exists shorewall; then' ,
|
||||
' startup_error "Cannot restore $(my_pathname)-ipsets with Shorewall running"' ,
|
||||
' else' ,
|
||||
' $IPSET -F' ,
|
||||
' $IPSET -X' ,
|
||||
' zap_ipsets' ,
|
||||
' $IPSET -R < $(my_pathname)-ipsets' ,
|
||||
' fi' ,
|
||||
' fi' ,
|
||||
);
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit ( '' );
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
emit ( '' );
|
||||
}
|
||||
} else {
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
|
||||
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
|
||||
' $IPSET flush' ,
|
||||
' $IPSET destroy' ,
|
||||
' $IPSET restore < ${VARDIR}/ipsets.save' ,
|
||||
" fi\n" ) for @{$globals{SAVED_IPSETS}};
|
||||
}
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit ( 'elif [ "$COMMAND" = reload ]; then' );
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
}
|
||||
emit ( '' );
|
||||
ensure_ipsets( @ipsets );
|
||||
|
||||
emit( 'elif [ "$COMMAND" = stop ]; then' ,
|
||||
' save_ipsets'
|
||||
);
|
||||
emit ( 'elif [ "$COMMAND" = reload ]; then' ); ################### Reload Command ####################
|
||||
ensure_ipsets( @ipsets );
|
||||
|
||||
if ( @ipsets ) {
|
||||
emit( 'elif [ "$COMMAND" = refresh ]; then' );
|
||||
ensure_ipset( $_ ) for @ipsets;
|
||||
emit( 'elif [ "$COMMAND" = refresh ]; then' ); ################### Refresh Command ###################
|
||||
emit ( '' );
|
||||
ensure_ipsets( @ipsets );
|
||||
emit ( '' );
|
||||
};
|
||||
|
||||
emit ( 'fi' ,
|
||||
'' );
|
||||
} else {
|
||||
emit 'true';
|
||||
}
|
||||
|
||||
pop_indent;
|
||||
|
||||
emit '}';
|
||||
}
|
||||
|
||||
#
|
||||
@@ -8627,12 +8716,12 @@ sub preview_netfilter_load() {
|
||||
print( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
|
||||
print "\n";
|
||||
} elsif ( $name eq 'DOCKER-ISOLATION' ) {
|
||||
enter_cmd_mode1 unless $mode = CMD_MODE;
|
||||
enter_cmd_mode1 unless $mode == CMD_MODE;
|
||||
print( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||
print "\n";
|
||||
enter_cat_mode1;
|
||||
} else {
|
||||
enter_cmd_mode1 unless $mode = CMD_MODE;
|
||||
enter_cmd_mode1 unless $mode == CMD_MODE;
|
||||
print( ":$name - [0:0]\n" );
|
||||
}
|
||||
} else {
|
||||
|
@@ -368,6 +368,7 @@ sub generate_script_3($) {
|
||||
create_arptables_load( $test ) if $have_arptables;
|
||||
create_chainlist_reload( $_[0] );
|
||||
create_save_ipsets;
|
||||
create_load_ipsets;
|
||||
|
||||
emit "#\n# Start/Reload the Firewall\n#";
|
||||
|
||||
@@ -406,7 +407,9 @@ sub generate_script_3($) {
|
||||
'fi',
|
||||
'' );
|
||||
|
||||
load_ipsets;
|
||||
emit( 'load_ipsets' ,
|
||||
'' );
|
||||
|
||||
create_nfobjects;
|
||||
verify_address_variables;
|
||||
save_dynamic_chains;
|
||||
@@ -573,16 +576,16 @@ date > ${VARDIR}/restarted
|
||||
|
||||
case $COMMAND in
|
||||
start)
|
||||
logger -p kern.info "$g_product started"
|
||||
mylogger kern.info "$g_product started"
|
||||
;;
|
||||
reloaded)
|
||||
logger -p kern.info "$g_product reloaded"
|
||||
reload)
|
||||
mylogger kern.info "$g_product reloaded"
|
||||
;;
|
||||
refresh)
|
||||
logger -p kern.info "$g_product refreshed"
|
||||
mylogger kern.info "$g_product refreshed"
|
||||
;;
|
||||
restore)
|
||||
logger -p kern.info "$g_product restored"
|
||||
mylogger kern.info "$g_product restored"
|
||||
;;
|
||||
esac
|
||||
EOF
|
||||
@@ -867,10 +870,6 @@ sub compiler {
|
||||
#
|
||||
complete_policy_chains;
|
||||
#
|
||||
# Reject Action
|
||||
#
|
||||
process_reject_action if $config{REJECT_ACTION};
|
||||
#
|
||||
# Accounting.
|
||||
#
|
||||
setup_accounting if $config{ACCOUNTING};
|
||||
|
@@ -161,6 +161,8 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
|
||||
set_section_function
|
||||
clear_section_function
|
||||
directive_callback
|
||||
add_ipset
|
||||
all_ipsets
|
||||
|
||||
$product
|
||||
$Product
|
||||
@@ -344,7 +346,7 @@ our %capdesc = ( NAT_ENABLED => 'NAT',
|
||||
=> 'Ipset Match nomatch',
|
||||
IPSET_MATCH_COUNTERS
|
||||
=> 'Ipset Match counters',
|
||||
IPSET_V5 => 'Version 5 ipsets',
|
||||
IPSET_V5 => 'Version 5 or later ipset',
|
||||
CONNMARK => 'CONNMARK Target',
|
||||
XCONNMARK => 'Extended CONNMARK Target',
|
||||
CONNMARK_MATCH => 'Connmark Match',
|
||||
@@ -673,6 +675,7 @@ our $section_function; #Function Reference for handling ?section
|
||||
|
||||
our $evals = 0; # Number of times eval() called out of evaluate_expression() or embedded_perl().
|
||||
|
||||
our %ipsets; # All required IPsets
|
||||
#
|
||||
# Files located via find_file()
|
||||
#
|
||||
@@ -885,6 +888,7 @@ sub initialize( $;$$) {
|
||||
RESTART => undef ,
|
||||
DOCKER => undef ,
|
||||
PAGER => undef ,
|
||||
MINIUPNPD => undef ,
|
||||
#
|
||||
# Packet Disposition
|
||||
#
|
||||
@@ -1072,6 +1076,7 @@ sub initialize( $;$$) {
|
||||
%actparams = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '' );
|
||||
$parmsmodified = 0;
|
||||
$usedcaller = 0;
|
||||
%ipsets = ();
|
||||
|
||||
%helpers_enabled = (
|
||||
amanda => 1,
|
||||
@@ -1170,6 +1175,14 @@ sub initialize( $;$$) {
|
||||
|
||||
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
||||
|
||||
sub add_ipset( $ ) {
|
||||
$ipsets{$_[0]} = 1;
|
||||
}
|
||||
|
||||
sub all_ipsets() {
|
||||
sort keys %ipsets;
|
||||
}
|
||||
|
||||
#
|
||||
# Create 'currentlineinfo'
|
||||
#
|
||||
@@ -1243,6 +1256,34 @@ sub shortlineinfo( $ ) {
|
||||
|
||||
sub handle_first_entry();
|
||||
|
||||
#
|
||||
# Issue a Information Message
|
||||
#
|
||||
sub info_message
|
||||
{
|
||||
my $currentlineinfo = currentlineinfo;
|
||||
our @localtime;
|
||||
|
||||
handle_first_entry if $first_entry;
|
||||
|
||||
$| = 1; #Reset output buffering (flush any partially filled buffers).
|
||||
|
||||
if ( $log ) {
|
||||
@localtime = localtime;
|
||||
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
}
|
||||
|
||||
if ( $confess ) {
|
||||
print STDERR longmess( " INFO: @_$currentlineinfo" );
|
||||
print $log longmess( " INFO: @_$currentlineinfo\n" ) if $log;
|
||||
} else {
|
||||
print STDERR " INFO: @_$currentlineinfo\n";
|
||||
print $log " INFO: @_$currentlineinfo\n" if $log;
|
||||
}
|
||||
|
||||
$| = 0; #Re-allow output buffering
|
||||
}
|
||||
|
||||
#
|
||||
# Issue a Warning Message
|
||||
#
|
||||
@@ -1672,7 +1713,7 @@ sub progress_message {
|
||||
|
||||
@localtime = localtime unless $havelocaltime;
|
||||
|
||||
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
print $log "${leading}${line}\n";
|
||||
}
|
||||
}
|
||||
@@ -1691,7 +1732,7 @@ sub progress_message_nocompress {
|
||||
|
||||
@localtime = localtime unless $havelocaltime;
|
||||
|
||||
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
print $log "@_\n";
|
||||
}
|
||||
}
|
||||
@@ -1712,7 +1753,7 @@ sub progress_message2 {
|
||||
|
||||
@localtime = localtime unless $havelocaltime;
|
||||
|
||||
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
print $log "@_\n";
|
||||
}
|
||||
}
|
||||
@@ -1733,7 +1774,7 @@ sub progress_message3 {
|
||||
|
||||
@localtime = localtime unless $havelocaltime;
|
||||
|
||||
printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
|
||||
print $log "@_\n";
|
||||
}
|
||||
}
|
||||
@@ -2509,6 +2550,13 @@ sub directive_warning( $$$ ) {
|
||||
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno );
|
||||
}
|
||||
|
||||
sub directive_info( $$$ ) {
|
||||
my ( $savefilename, $savelineno ) = ( $currentfilename, $currentlinenumber );
|
||||
( my $info, $currentfilename, $currentlinenumber ) = @_;
|
||||
info_message $info;
|
||||
( $currentfilename, $currentlinenumber ) = ( $savefilename, $savelineno );
|
||||
}
|
||||
|
||||
#
|
||||
# Add quotes to the passed value if the passed 'first part' has an odd number of quotes
|
||||
# Return an expression that concatenates $first, $val and $rest
|
||||
@@ -2655,7 +2703,7 @@ sub process_compiler_directive( $$$$ ) {
|
||||
|
||||
print "CD===> $line\n" if $debug;
|
||||
|
||||
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+)(.*)$/i;
|
||||
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+|WARNING\s+|INFO\s+)(.*)$/i;
|
||||
|
||||
my ($keyword, $expression) = ( uc $1, $2 );
|
||||
|
||||
@@ -2800,7 +2848,26 @@ sub process_compiler_directive( $$$$ ) {
|
||||
1 ) ,
|
||||
$filename ,
|
||||
$linenumber ) unless $omitting;
|
||||
}
|
||||
} ,
|
||||
|
||||
WARNING => sub() {
|
||||
directive_warning( evaluate_expression( $expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$filename ,
|
||||
$linenumber ) unless $omitting;
|
||||
} ,
|
||||
|
||||
INFO => sub() {
|
||||
directive_info( evaluate_expression( $expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$filename ,
|
||||
$linenumber ) unless $omitting;
|
||||
} ,
|
||||
|
||||
);
|
||||
|
||||
if ( my $function = $directives{$keyword} ) {
|
||||
@@ -3300,9 +3367,9 @@ sub push_action_params( $$$$$$ ) {
|
||||
$actparams{caller} = $caller;
|
||||
$actparams{disposition} = '' if $chainref->{action};
|
||||
#
|
||||
# The Shorewall variable '@chain' has the non-word charaters removed
|
||||
# The Shorewall variable '@chain' has non-word characters other than hyphen removed
|
||||
#
|
||||
( $actparams{chain} = $chainref->{name} ) =~ s/[^\w]//g;
|
||||
( $actparams{chain} = $chainref->{name} ) =~ s/[^\w-]//g;
|
||||
|
||||
\%oldparms;
|
||||
}
|
||||
@@ -3513,7 +3580,7 @@ sub read_a_line($) {
|
||||
#
|
||||
# Handle directives
|
||||
#
|
||||
if ( /^\s*\?(?:IF|ELSE|ELSIF|ENDIF|SET|RESET|FORMAT|COMMENT|ERROR)/i ) {
|
||||
if ( /^\s*\?(?:IF|ELSE|ELSIF|ENDIF|SET|RESET|FORMAT|COMMENT|ERROR|WARNING|INFO)/i ) {
|
||||
$omitting = process_compiler_directive( $omitting, $_, $currentfilename, $. );
|
||||
next;
|
||||
}
|
||||
@@ -4893,8 +4960,16 @@ sub ensure_config_path() {
|
||||
|
||||
@config_path = split /:/, $config{CONFIG_PATH};
|
||||
|
||||
#
|
||||
# To accomodate Cygwin-based compilation, we have separate directories for files whose names
|
||||
# clash on a case-insensitive filesystem.
|
||||
#
|
||||
push @config_path, $globals{SHAREDIR} . "/deprecated";
|
||||
push @config_path, $shorewallrc{SHAREDIR}. '/shorewall/deprecated' unless $globals{PRODUCT} eq 'shorewall';
|
||||
|
||||
for ( @config_path ) {
|
||||
$_ .= '/' unless m|/$|;
|
||||
s|//|/|g;
|
||||
}
|
||||
|
||||
if ( $shorewall_dir ) {
|
||||
@@ -5410,7 +5485,7 @@ sub get_params( $ ) {
|
||||
#
|
||||
delete $params{$_};
|
||||
} else {
|
||||
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) {
|
||||
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' ) {
|
||||
fatal_error "The variable name $_ is reserved and may not be set in the params file"
|
||||
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
|
||||
}
|
||||
@@ -5850,16 +5925,21 @@ sub get_configuration( $$$$ ) {
|
||||
unsupported_yes_no 'BRIDGING';
|
||||
unsupported_yes_no_warning 'RFC1918_STRICT';
|
||||
|
||||
$val = $config{SAVE_IPSETS};
|
||||
|
||||
unless (default_yes_no 'SAVE_IPSETS', '', '*' ) {
|
||||
$val = $config{SAVE_IPSETS};
|
||||
unless ( $val eq 'ipv4' ) {
|
||||
if ( $val eq 'ipv4' ) {
|
||||
fatal_error 'SAVE_IPSETS=ipv4 is invalid in shorewall6.conf' if $family == F_IPV6;
|
||||
} else {
|
||||
my @sets = split_list( $val , 'ipset' );
|
||||
$globals{SAVED_IPSETS} = \@sets;
|
||||
require_capability 'IPSET_V5', 'A saved ipset list', 's';
|
||||
$config{SAVE_IPSETS} = '';
|
||||
}
|
||||
|
||||
require_capability( 'IPSET_V5', "SAVE_IPSETS=$val", 's' ) if $config{SAVE_IPSETS};
|
||||
}
|
||||
|
||||
|
||||
default_yes_no 'SAVE_ARPTABLES' , '';
|
||||
default_yes_no 'STARTUP_ENABLED' , 'Yes';
|
||||
default_yes_no 'DELAYBLACKLISTLOAD' , '';
|
||||
@@ -5942,7 +6022,7 @@ sub get_configuration( $$$$ ) {
|
||||
default_yes_no 'INLINE_MATCHES' , '';
|
||||
default_yes_no 'BASIC_FILTERS' , '';
|
||||
default_yes_no 'WORKAROUNDS' , 'Yes';
|
||||
default_yes_no 'DOCKER' , '';
|
||||
default_yes_no 'DOCKER' , '';
|
||||
|
||||
if ( $config{DOCKER} ) {
|
||||
fatal_error "DOCKER=Yes is not allowed in Shorewall6" if $family == F_IPV6;
|
||||
@@ -5990,7 +6070,33 @@ sub get_configuration( $$$$ ) {
|
||||
$config{ACCOUNTING_TABLE} = 'filter';
|
||||
}
|
||||
|
||||
default_yes_no 'DYNAMIC_BLACKLIST' , 'Yes';
|
||||
if ( supplied( $val = $config{DYNAMIC_BLACKLIST} ) ) {
|
||||
if ( $val =~ /^ipset/ ) {
|
||||
my ( $key, $set, $level, $tag, $rest ) = split( ':', $val , 5 );
|
||||
|
||||
fatal_error "Invalid DYNAMIC_BLACKLIST setting ( $val )" if $key !~ /^ipset(?:-only)?(?:,src-dst)?$/ || defined $rest;
|
||||
|
||||
if ( supplied( $set ) ) {
|
||||
fatal_error "Invalid DYNAMIC_BLACKLIST ipset name" unless $set =~ /^[A-Za-z][\w-]*/;
|
||||
} else {
|
||||
$set = 'SW_DBL' . $family;
|
||||
}
|
||||
|
||||
add_ipset( $set );
|
||||
|
||||
$level = validate_level( $level );
|
||||
|
||||
$tag = '' unless defined $tag;
|
||||
|
||||
$config{DYNAMIC_BLACKLIST} = join( ':', $key, $set, $level, $tag );
|
||||
|
||||
require_capability( 'IPSET_V5', 'DYNAMIC_BLACKLIST=ipset...', 's' );
|
||||
|
||||
} else {
|
||||
default_yes_no( 'DYNAMIC_BLACKLIST' , 'Yes' );
|
||||
}
|
||||
}
|
||||
|
||||
default_yes_no 'REQUIRE_INTERFACE' , '';
|
||||
default_yes_no 'FORWARD_CLEAR_MARK' , have_capability( 'MARK' ) ? 'Yes' : '';
|
||||
default_yes_no 'COMPLETE' , '';
|
||||
@@ -6002,8 +6108,9 @@ sub get_configuration( $$$$ ) {
|
||||
default_yes_no 'IGNOREUNKNOWNVARIABLES' , 'Yes';
|
||||
default_yes_no 'WARNOLDCAPVERSION' , 'Yes';
|
||||
default_yes_no 'DEFER_DNS_RESOLUTION' , 'Yes';
|
||||
default_yes_no 'MINIUPNPD' , '';
|
||||
|
||||
$config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset';
|
||||
$config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset';
|
||||
|
||||
require_capability 'MARK' , 'FORWARD_CLEAR_MARK=Yes', 's', if $config{FORWARD_CLEAR_MARK};
|
||||
|
||||
@@ -6501,7 +6608,7 @@ sub generate_aux_config() {
|
||||
|
||||
emit "#\n# Shorewall auxiliary configuration file created by Shorewall version $globals{VERSION} - $date\n#";
|
||||
|
||||
for my $option ( qw(VERBOSITY LOGFILE LOGFORMAT ARPTABLES IPTABLES IP6TABLES IP TC IPSET PATH SHOREWALL_SHELL SUBSYSLOCK LOCKFILE RESTOREFILE WORKAROUNDS RESTART) ) {
|
||||
for my $option ( qw(VERBOSITY LOGFILE LOGFORMAT ARPTABLES IPTABLES IP6TABLES IP TC IPSET PATH SHOREWALL_SHELL SUBSYSLOCK LOCKFILE RESTOREFILE WORKAROUNDS RESTART DYNAMIC_BLACKLIST) ) {
|
||||
conditionally_add_option $option;
|
||||
}
|
||||
|
||||
|
@@ -89,6 +89,7 @@ sub setup_ecn()
|
||||
{
|
||||
my %interfaces;
|
||||
my @hosts;
|
||||
my $interfaceref;
|
||||
|
||||
if ( my $fn = open_file 'ecn' ) {
|
||||
|
||||
@@ -105,7 +106,13 @@ sub setup_ecn()
|
||||
2 );
|
||||
|
||||
fatal_error 'INTERFACE must be specified' if $interface eq '-';
|
||||
fatal_error "Unknown interface ($interface)" unless known_interface $interface;
|
||||
fatal_error "Unknown interface ($interface)" unless $interfaceref = known_interface( $interface );
|
||||
|
||||
if ( $interfaceref->{root} ) {
|
||||
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
|
||||
} else {
|
||||
$interface = $interfaceref->{name};
|
||||
}
|
||||
|
||||
my $lineinfo = shortlineinfo( '' );
|
||||
|
||||
@@ -639,6 +646,7 @@ sub create_docker_rules() {
|
||||
add_commands( $chainref, 'if [ -n "$g_docker" ]; then' );
|
||||
incr_cmd_level( $chainref );
|
||||
add_ijump( $chainref, j => 'DOCKER', o => 'docker0' );
|
||||
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' );
|
||||
@@ -667,16 +675,88 @@ sub add_common_rules ( $ ) {
|
||||
my $level = $config{BLACKLIST_LOG_LEVEL};
|
||||
my $tag = $globals{BLACKLIST_LOG_TAG};
|
||||
my $rejectref = $filter_table->{reject};
|
||||
my $dbl_type;
|
||||
my $dbl_ipset;
|
||||
my $dbl_level;
|
||||
my $dbl_tag;
|
||||
my $dbl_target;
|
||||
|
||||
if ( $config{REJECT_ACTION} ) {
|
||||
process_reject_action;
|
||||
fatal_eror( "The REJECT_ACTION ($config{REJECT_ACTION}) is not terminating" ) unless terminating( $rejectref );
|
||||
} else {
|
||||
if ( have_capability( 'ADDRTYPE' ) ) {
|
||||
add_ijump $rejectref , j => 'DROP' , addrtype => '--src-type BROADCAST';
|
||||
} else {
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_commands $rejectref, 'for address in $ALL_BCASTS; do';
|
||||
} else {
|
||||
add_commands $rejectref, 'for address in $ALL_ACASTS; do';
|
||||
}
|
||||
|
||||
incr_cmd_level $rejectref;
|
||||
add_ijump $rejectref, j => 'DROP', d => '$address';
|
||||
decr_cmd_level $rejectref;
|
||||
add_commands $rejectref, 'done';
|
||||
}
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_ijump $rejectref , j => 'DROP', s => '224.0.0.0/4';
|
||||
} else {
|
||||
add_ijump $rejectref , j => 'DROP', s => IPv6_MULTICAST;
|
||||
}
|
||||
|
||||
add_ijump $rejectref , j => 'DROP', p => 2;
|
||||
add_ijump $rejectref , j => 'REJECT', targetopts => '--reject-with tcp-reset', p => 6;
|
||||
|
||||
if ( have_capability( 'ENHANCED_REJECT' ) ) {
|
||||
add_ijump $rejectref , j => 'REJECT', p => 17;
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-unreachable', p => 1;
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-prohibited';
|
||||
} else {
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-addr-unreachable', p => 58;
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-adm-prohibited';
|
||||
}
|
||||
} else {
|
||||
add_ijump $rejectref , j => 'REJECT';
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Insure that Docker jumps are early in the builtin chains
|
||||
#
|
||||
create_docker_rules if $config{DOCKER};
|
||||
|
||||
if ( $config{DYNAMIC_BLACKLIST} ) {
|
||||
add_rule_pair( set_optflags( new_standard_chain( 'logdrop' ) , DONT_OPTIMIZE | DONT_DELETE ), '' , 'DROP' , $level , $tag);
|
||||
add_rule_pair( set_optflags( new_standard_chain( 'logreject' ), DONT_OPTIMIZE | DONT_DELETE ), '' , 'reject' , $level , $tag);
|
||||
$dynamicref = set_optflags( new_standard_chain( 'dynamic' ) , DONT_OPTIMIZE );
|
||||
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
|
||||
if ( my $val = $config{DYNAMIC_BLACKLIST} ) {
|
||||
( $dbl_type, $dbl_ipset, $dbl_level, $dbl_tag ) = split( ':', $val );
|
||||
|
||||
unless ( $dbl_type =~ /^ipset-only/ ) {
|
||||
add_rule_pair( set_optflags( new_standard_chain( 'logdrop' ) , DONT_OPTIMIZE | DONT_DELETE ), '' , 'DROP' , $level , $tag);
|
||||
add_rule_pair( set_optflags( new_standard_chain( 'logreject' ), DONT_OPTIMIZE | DONT_DELETE ), '' , 'reject' , $level , $tag);
|
||||
$dynamicref = set_optflags( new_standard_chain( 'dynamic' ) , DONT_OPTIMIZE );
|
||||
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
|
||||
}
|
||||
|
||||
if ( $dbl_ipset ) {
|
||||
if ( $dbl_level ) {
|
||||
my $chainref = set_optflags( new_standard_chain( $dbl_target = 'dbl_log' ) , DONT_OPTIMIZE | DONT_DELETE );
|
||||
|
||||
log_rule_limit( $dbl_level,
|
||||
$chainref,
|
||||
'dbl_log',
|
||||
'DROP',
|
||||
$globals{LOGLIMIT},
|
||||
$dbl_tag,
|
||||
'add',
|
||||
'',
|
||||
$origin{DYNAMIC_BLACKLIST} );
|
||||
add_ijump_extended( $chainref, j => 'DROP', $origin{DYNAMIC_BLACKLIST} );
|
||||
} else {
|
||||
$dbl_target = 'DROP';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setup_mss;
|
||||
@@ -780,8 +860,13 @@ 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$/;
|
||||
}
|
||||
|
||||
for ( option_chains( $interface ) ) {
|
||||
add_ijump_extended( $filter_table->{$_}, j => $dynamicref, $origin{DYNAMIC_BLACKLIST}, @state ) if $dynamicref;
|
||||
add_ijump_extended( $filter_table->{$_}, j => $dynamicref, $origin{DYNAMIC_BLACKLIST}, @state ) if $dynamicref && ! get_interface_option( $interface, 'nodbl' );
|
||||
add_ijump_extended( $filter_table->{$_}, j => 'ACCEPT', $origin{FASTACCEPT}, state_imatch $faststate )->{comment} = '' if $config{FASTACCEPT};
|
||||
}
|
||||
}
|
||||
@@ -940,46 +1025,6 @@ sub add_common_rules ( $ ) {
|
||||
}
|
||||
}
|
||||
|
||||
unless ( $config{REJECT_ACTION} ) {
|
||||
if ( have_capability( 'ADDRTYPE' ) ) {
|
||||
add_ijump $rejectref , j => 'DROP' , addrtype => '--src-type BROADCAST';
|
||||
} else {
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_commands $rejectref, 'for address in $ALL_BCASTS; do';
|
||||
} else {
|
||||
add_commands $rejectref, 'for address in $ALL_ACASTS; do';
|
||||
}
|
||||
|
||||
incr_cmd_level $rejectref;
|
||||
add_ijump $rejectref, j => 'DROP', d => '$address';
|
||||
decr_cmd_level $rejectref;
|
||||
add_commands $rejectref, 'done';
|
||||
}
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_ijump $rejectref , j => 'DROP', s => '224.0.0.0/4';
|
||||
} else {
|
||||
add_ijump $rejectref , j => 'DROP', s => IPv6_MULTICAST;
|
||||
}
|
||||
|
||||
add_ijump $rejectref , j => 'DROP', p => 2;
|
||||
add_ijump $rejectref , j => 'REJECT', targetopts => '--reject-with tcp-reset', p => 6;
|
||||
|
||||
if ( have_capability( 'ENHANCED_REJECT' ) ) {
|
||||
add_ijump $rejectref , j => 'REJECT', p => 17;
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-unreachable', p => 1;
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp-host-prohibited';
|
||||
} else {
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-addr-unreachable', p => 58;
|
||||
add_ijump $rejectref, j => 'REJECT --reject-with icmp6-adm-prohibited';
|
||||
}
|
||||
} else {
|
||||
add_ijump $rejectref , j => 'REJECT';
|
||||
}
|
||||
}
|
||||
|
||||
$list = find_interfaces_by_option 'dhcp';
|
||||
|
||||
if ( @$list ) {
|
||||
@@ -1095,10 +1140,18 @@ sub add_common_rules ( $ ) {
|
||||
|
||||
add_commands( $chainref, '[ -s /${VARDIR}/.UPnP ] && cat ${VARDIR}/.UPnP >&3' );
|
||||
|
||||
my $chainref1;
|
||||
|
||||
if ( $config{MINIUPNPD} ) {
|
||||
$chainref1 = set_optflags( new_nat_chain( 'MINIUPNPD-POSTROUTING' ), DONT_OPTIMIZE );
|
||||
add_commands( $chainref, '[ -s /${VARDIR}/.MINIUPNPD-POSTROUTING ] && cat ${VARDIR}/.MINIUPNPD-POSTROUTING >&3' );
|
||||
}
|
||||
|
||||
$announced = 1;
|
||||
|
||||
for $interface ( @$list ) {
|
||||
add_ijump_extended $nat_table->{PREROUTING} , j => 'UPnP', get_interface_origin($interface), imatch_source_dev ( $interface );
|
||||
add_ijump_extended $nat_table->{PREROUTING} , j => 'UPnP', get_interface_origin($interface), imatch_source_dev ( $interface );
|
||||
add_ijump_extended $nat_table->{$globals{POSTROUTING}} , j => 'MINIUPNPD-POSTROUTING' , $origin{MINIUPNPD} , imatch_dest_dev ( $interface ) if $chainref1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1786,12 +1839,14 @@ sub add_output_jumps( $$$$$$$$ ) {
|
||||
my $use_output = 0;
|
||||
my @dest = imatch_dest_net $net;
|
||||
my @ipsec_out_match = match_ipsec_out $zone , $hostref;
|
||||
my @zone_interfaces = keys %{zone_interfaces( $zone )};
|
||||
|
||||
if ( @vservers || use_output_chain( $interface, $interfacechainref ) || ( @{$interfacechainref->{rules}} && ! $chain1ref ) ) {
|
||||
if ( @vservers || use_output_chain( $interface, $interfacechainref ) || ( @{$interfacechainref->{rules}} && ! $chain1ref ) || @zone_interfaces > 1 ) {
|
||||
#
|
||||
# - There are vserver zones (so OUTPUT will have multiple source; or
|
||||
# - We must use the interface output chain; or
|
||||
# - There are rules in the interface chain and none in the rules chain
|
||||
# - The zone has multiple interfaces
|
||||
#
|
||||
# In any of these cases use the inteface output chain
|
||||
#
|
||||
@@ -1808,7 +1863,7 @@ sub add_output_jumps( $$$$$$$$ ) {
|
||||
unless $output_jump_added{$interface}++;
|
||||
} else {
|
||||
#
|
||||
# Not a bridge -- match the input interface
|
||||
# Not a bridge -- match the output interface
|
||||
#
|
||||
add_ijump_extended $filter_table->{OUTPUT}, j => $outputref, $origin, imatch_dest_dev( $interface ) unless $output_jump_added{$interface}++;
|
||||
}
|
||||
@@ -2418,16 +2473,16 @@ EOF
|
||||
emit <<'EOF';
|
||||
case $COMMAND in
|
||||
start)
|
||||
logger -p kern.err "ERROR:$g_product start failed"
|
||||
mylogger kern.err "ERROR:$g_product start failed"
|
||||
;;
|
||||
reload)
|
||||
logger -p kern.err "ERROR:$g_product reload failed"
|
||||
mylogger kern.err "ERROR:$g_product reload failed"
|
||||
;;
|
||||
refresh)
|
||||
logger -p kern.err "ERROR:$g_product refresh failed"
|
||||
mylogger kern.err "ERROR:$g_product refresh failed"
|
||||
;;
|
||||
enable)
|
||||
logger -p kern.err "ERROR:$g_product 'enable $g_interface' failed"
|
||||
mylogger kern.err "ERROR:$g_product 'enable $g_interface' failed"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2636,7 +2691,7 @@ EOF
|
||||
emit '
|
||||
|
||||
set_state "Stopped"
|
||||
logger -p kern.info "$g_product Stopped"
|
||||
mylogger kern.info "$g_product Stopped"
|
||||
|
||||
case $COMMAND in
|
||||
stop|clear)
|
||||
|
@@ -173,7 +173,9 @@ sub process_one_masq1( $$$$$$$$$$$ )
|
||||
|
||||
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
|
||||
|
||||
unless ( $interfaceref->{root} ) {
|
||||
if ( $interfaceref->{root} ) {
|
||||
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
|
||||
} else {
|
||||
$rule .= match_dest_dev( $interface );
|
||||
$interface = $interfaceref->{name};
|
||||
}
|
||||
@@ -457,7 +459,9 @@ sub do_one_nat( $$$$$ )
|
||||
|
||||
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
|
||||
|
||||
unless ( $interfaceref->{root} ) {
|
||||
if ( $interfaceref->{root} ) {
|
||||
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
|
||||
} else {
|
||||
$rulein = match_source_dev $interface;
|
||||
$ruleout = match_dest_dev $interface;
|
||||
$interface = $interfaceref->{name};
|
||||
@@ -559,7 +563,9 @@ sub setup_netmap() {
|
||||
$net1 = validate_net $net1, 0;
|
||||
$net2 = validate_net $net2, 0;
|
||||
|
||||
unless ( $interfaceref->{root} ) {
|
||||
if ( $interfaceref->{root} ) {
|
||||
$interface = $interfaceref->{name} if $interface eq $interfaceref->{physical};
|
||||
} else {
|
||||
@rulein = imatch_source_dev( $interface );
|
||||
@ruleout = imatch_dest_dev( $interface );
|
||||
$interface = $interfaceref->{name};
|
||||
|
@@ -392,7 +392,7 @@ sub start_provider( $$$$$ ) {
|
||||
}
|
||||
|
||||
#
|
||||
# Look up a provider and return it's number. If unknown provider, 0 is returned
|
||||
# Look up a provider and return a reference to its table entry. If unknown provider, undef is returned
|
||||
#
|
||||
sub lookup_provider( $ ) {
|
||||
my $provider = $_[0];
|
||||
@@ -408,7 +408,7 @@ sub lookup_provider( $ ) {
|
||||
}
|
||||
}
|
||||
|
||||
$providerref ? $providerref->{number} : 0;
|
||||
$providerref;
|
||||
}
|
||||
|
||||
#
|
||||
@@ -666,7 +666,9 @@ sub process_a_provider( $ ) {
|
||||
if ( $duplicate ne '-' ) {
|
||||
fatal_error "The DUPLICATE column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT};
|
||||
my $p = lookup_provider( $duplicate );
|
||||
warning_message "Unknown routing table ($duplicate)" unless $p && ( $p == MAIN_TABLE || $p < BALANCE_TABLE );
|
||||
my $n = $p ? $p->{number} : 0;
|
||||
warning_message "Unknown routing table ($duplicate)" unless $n && ( $n == MAIN_TABLE || $n < BALANCE_TABLE );
|
||||
warning_message "An optional provider ($duplicate) is listed in the DUPLICATE column - enable and disable will not work correctly on that provider" if $p && $p->{optional};
|
||||
} elsif ( $copy ne '-' ) {
|
||||
fatal_error "The COPY column must be empty when USE_DEFAULT_RT=Yes" if $config{USE_DEFAULT_RT};
|
||||
fatal_error 'A non-empty COPY column requires that a routing table be specified in the DUPLICATE column' unless $copy eq 'none';
|
||||
|
@@ -230,6 +230,7 @@ use constant { INLINE_OPT => 1 ,
|
||||
NAT_OPT => 128 ,
|
||||
TERMINATING_OPT => 256 ,
|
||||
AUDIT_OPT => 512 ,
|
||||
LOGJUMP_OPT => 1024 ,
|
||||
};
|
||||
|
||||
our %options = ( inline => INLINE_OPT ,
|
||||
@@ -242,7 +243,10 @@ our %options = ( inline => INLINE_OPT ,
|
||||
nat => NAT_OPT ,
|
||||
terminating => TERMINATING_OPT ,
|
||||
audit => AUDIT_OPT ,
|
||||
logjump => LOGJUMP_OPT ,
|
||||
);
|
||||
|
||||
our %reject_options;
|
||||
################################################################################
|
||||
# Declarations moved from the Tc module in 5.0.7 #
|
||||
################################################################################
|
||||
@@ -353,8 +357,27 @@ sub initialize( $ ) {
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
@builtins = qw/dropBcast allowBcast dropNotSyn rejNotSyn allowinUPnP forwardUPnP Limit/;
|
||||
%reject_options = ( 'icmp-net-unreachable' => 1,
|
||||
'icmp-host-unreachable' => 1,
|
||||
'icmp-port-unreachable' => 1,
|
||||
'icmp-proto-unreachable' => 1,
|
||||
'icmp-net-prohibited' => 1,
|
||||
'icmp-host-prohibited' => 1,
|
||||
'icmp-admin-prohibited' => 1,
|
||||
'icmp-tcp-reset' => 2,
|
||||
);
|
||||
|
||||
} else {
|
||||
@builtins = qw/dropBcast allowBcast dropNotSyn rejNotSyn/;
|
||||
%reject_options = ( 'icmp6-no-route' => 1,
|
||||
'no-route' => 1,
|
||||
'icmp6-adm-prohibited' => 1,
|
||||
'adm-prohibited' => 1,
|
||||
'icmp6-addr-unreachable' => 1,
|
||||
'addr-unreach' => 1,
|
||||
'icmp6-port-unreachable' => 1,
|
||||
'tcp-reset' => 2,
|
||||
);
|
||||
}
|
||||
|
||||
############################################################################
|
||||
@@ -1257,8 +1280,14 @@ sub normalize_action( $$$ ) {
|
||||
|
||||
( $level, my $tag ) = split ':', $level;
|
||||
|
||||
$level = 'none' unless supplied $level;
|
||||
$tag = '' unless defined $tag;
|
||||
if ( $actions{$action}{options} & LOGJUMP_OPT ) {
|
||||
$level = 'none';
|
||||
$tag = '';
|
||||
} else {
|
||||
$level = 'none' unless supplied $level;
|
||||
$tag = '' unless defined $tag;
|
||||
}
|
||||
|
||||
$param = '' unless defined $param;
|
||||
$param = '' if $param eq '-';
|
||||
|
||||
@@ -1798,6 +1827,7 @@ sub process_action(\$\$$) {
|
||||
my ( $action, $level, $tag, undef, $param ) = split /:/, $wholeaction, ACTION_TUPLE_ELEMENTS;
|
||||
my $type = $targets{$action};
|
||||
my $actionref = $actions{$action};
|
||||
my $matches = fetch_inline_matches;
|
||||
|
||||
if ( $type & BUILTIN ) {
|
||||
$level = '' if $level =~ /none!?/;
|
||||
@@ -1819,7 +1849,7 @@ sub process_action(\$\$$) {
|
||||
|
||||
my $oldparms = push_action_params( $action, $chainref, $param, $level, $tag, $caller );
|
||||
my $options = $actionref->{options};
|
||||
my $nolog = $options & NOLOG_OPT;
|
||||
my $nolog = $options & ( NOLOG_OPT | LOGJUMP_OPT );
|
||||
|
||||
setup_audit_action( $action ) if $options & AUDIT_OPT;
|
||||
|
||||
@@ -1910,14 +1940,15 @@ sub process_action(\$\$$) {
|
||||
$dscp ,
|
||||
$state,
|
||||
$time );
|
||||
set_inline_matches( $matches );
|
||||
}
|
||||
} else {
|
||||
my ($target, $source, $dest, $proto, $ports, $sports, $origdest, $rate, $user, $mark, $connlimit, $time, $headers, $condition, $helper );
|
||||
my ($target, $source, $dest, $protos, $ports, $sports, $origdest, $rate, $users, $mark, $connlimit, $time, $headers, $condition, $helper );
|
||||
|
||||
if ( $file_format == 1 ) {
|
||||
fatal_error( "FORMAT-1 actions are no longer supported" );
|
||||
} else {
|
||||
($target, $source, $dest, $proto, $ports, $sports, $origdest, $rate, $user, $mark, $connlimit, $time, $headers, $condition, $helper )
|
||||
($target, $source, $dest, $protos, $ports, $sports, $origdest, $rate, $users, $mark, $connlimit, $time, $headers, $condition, $helper )
|
||||
= split_line2( 'action file',
|
||||
\%rulecolumns,
|
||||
$action_commands,
|
||||
@@ -1941,26 +1972,32 @@ sub process_action(\$\$$) {
|
||||
next;
|
||||
}
|
||||
|
||||
process_rule( $chainref,
|
||||
'',
|
||||
'',
|
||||
$nolog ? $target : merge_levels( join(':', @actparams{'chain','loglevel','logtag'}), $target ),
|
||||
'',
|
||||
$source,
|
||||
$dest,
|
||||
$proto,
|
||||
$ports,
|
||||
$sports,
|
||||
$origdest,
|
||||
$rate,
|
||||
$user,
|
||||
$mark,
|
||||
$connlimit,
|
||||
$time,
|
||||
$headers,
|
||||
$condition,
|
||||
$helper,
|
||||
0 );
|
||||
for my $proto ( split_list( $protos, 'Protocol' ) ) {
|
||||
for my $user ( split_list( $users, 'User/Group' ) ) {
|
||||
process_rule( $chainref,
|
||||
'',
|
||||
'',
|
||||
$nolog ? $target : merge_levels( join(':', @actparams{'chain','loglevel','logtag'}), $target ),
|
||||
'',
|
||||
$source,
|
||||
$dest,
|
||||
$proto,
|
||||
$ports,
|
||||
$sports,
|
||||
$origdest,
|
||||
$rate,
|
||||
$user,
|
||||
$mark,
|
||||
$connlimit,
|
||||
$time,
|
||||
$headers,
|
||||
$condition,
|
||||
$helper,
|
||||
0 );
|
||||
|
||||
set_inline_matches( $matches );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2055,7 +2092,7 @@ sub process_actions() {
|
||||
$action =~ s/:.*$//;
|
||||
}
|
||||
|
||||
fatal_error "Invalid Action Name ($action)" unless $action =~ /^[a-zA-Z][\w-]*$/;
|
||||
fatal_error "Invalid Action Name ($action)" unless $action =~ /^[a-zA-Z][\w-]*!?$/;
|
||||
|
||||
if ( $options ne '-' ) {
|
||||
for ( split_list( $options, 'option' ) ) {
|
||||
@@ -2156,10 +2193,16 @@ sub use_policy_action( $$ ) {
|
||||
sub process_reject_action() {
|
||||
my $rejectref = $filter_table->{reject};
|
||||
my $action = $config{REJECT_ACTION};
|
||||
#
|
||||
# This gets called very early in the compilation process so we fake the section
|
||||
#
|
||||
$section = DEFAULTACTION_SECTION;
|
||||
|
||||
if ( ( $targets{$action} || 0 ) == ACTION ) {
|
||||
add_ijump $rejectref, j => use_policy_action( $action, $rejectref->{name} );
|
||||
} else {
|
||||
progress_message2 "$doing $actions{$action}->{file} for chain reject...";
|
||||
|
||||
process_inline( $action, #Inline
|
||||
$rejectref, #Chain
|
||||
'', #Matches
|
||||
@@ -2184,6 +2227,8 @@ sub process_reject_action() {
|
||||
0, #Wildcard
|
||||
);
|
||||
}
|
||||
|
||||
$section = '';
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@@ -2198,7 +2243,8 @@ sub process_macro ($$$$$$$$$$$$$$$$$$$$$) {
|
||||
my $generated = 0;
|
||||
|
||||
|
||||
my $macrofile = $macros{$macro};
|
||||
my $macrofile = $macros{$macro};
|
||||
my $save_matches = fetch_inline_matches;
|
||||
|
||||
progress_message "..Expanding Macro $macrofile...";
|
||||
|
||||
@@ -2208,7 +2254,7 @@ sub process_macro ($$$$$$$$$$$$$$$$$$$$$) {
|
||||
|
||||
while ( read_a_line( NORMAL_READ ) ) {
|
||||
|
||||
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $morigdest, $mrate, $muser, $mmark, $mconnlimit, $mtime, $mheaders, $mcondition, $mhelper);
|
||||
my ( $mtarget, $msource, $mdest, $mprotos, $mports, $msports, $morigdest, $mrate, $musers, $mmark, $mconnlimit, $mtime, $mheaders, $mcondition, $mhelper);
|
||||
|
||||
if ( $file_format == 1 ) {
|
||||
fatal_error( "FORMAT-1 macros are no longer supported" );
|
||||
@@ -2216,12 +2262,12 @@ sub process_macro ($$$$$$$$$$$$$$$$$$$$$) {
|
||||
( $mtarget,
|
||||
$msource,
|
||||
$mdest,
|
||||
$mproto,
|
||||
$mprotos,
|
||||
$mports,
|
||||
$msports,
|
||||
$morigdest,
|
||||
$mrate,
|
||||
$muser,
|
||||
$musers,
|
||||
$mmark,
|
||||
$mconnlimit,
|
||||
$mtime,
|
||||
@@ -2282,28 +2328,33 @@ sub process_macro ($$$$$$$$$$$$$$$$$$$$$) {
|
||||
$mdest = '';
|
||||
}
|
||||
|
||||
$generated |= process_rule(
|
||||
$chainref,
|
||||
$matches,
|
||||
$matches1,
|
||||
$mtarget,
|
||||
$param,
|
||||
$msource,
|
||||
$mdest,
|
||||
merge_macro_column( $mproto, $proto ) ,
|
||||
merge_macro_column( $mports, $ports ) ,
|
||||
merge_macro_column( $msports, $sports ) ,
|
||||
merge_macro_column( $morigdest, $origdest ) ,
|
||||
merge_macro_column( $mrate, $rate ) ,
|
||||
merge_macro_column( $muser, $user ) ,
|
||||
merge_macro_column( $mmark, $mark ) ,
|
||||
merge_macro_column( $mconnlimit, $connlimit) ,
|
||||
merge_macro_column( $mtime, $time ),
|
||||
merge_macro_column( $mheaders, $headers ),
|
||||
merge_macro_column( $mcondition, $condition ),
|
||||
merge_macro_column( $mhelper, $helper ),
|
||||
$wildcard
|
||||
);
|
||||
for my $mp ( split_list( $mprotos, 'Protocol' ) ) {
|
||||
for my $mu ( split_list( $musers, 'User/Group' ) ) {
|
||||
$generated |= process_rule( $chainref,
|
||||
$matches,
|
||||
$matches1,
|
||||
$mtarget,
|
||||
$param,
|
||||
$msource,
|
||||
$mdest,
|
||||
merge_macro_column( $mp, $proto ) ,
|
||||
merge_macro_column( $mports, $ports ) ,
|
||||
merge_macro_column( $msports, $sports ) ,
|
||||
merge_macro_column( $morigdest, $origdest ) ,
|
||||
merge_macro_column( $mrate, $rate ) ,
|
||||
merge_macro_column( $mu, $user ) ,
|
||||
merge_macro_column( $mmark, $mark ) ,
|
||||
merge_macro_column( $mconnlimit, $connlimit) ,
|
||||
merge_macro_column( $mtime, $time ),
|
||||
merge_macro_column( $mheaders, $headers ),
|
||||
merge_macro_column( $mcondition, $condition ),
|
||||
merge_macro_column( $mhelper, $helper ),
|
||||
$wildcard
|
||||
);
|
||||
|
||||
set_inline_matches( $save_matches );
|
||||
}
|
||||
}
|
||||
|
||||
progress_message " Rule \"$currentline\" $done";
|
||||
}
|
||||
@@ -2333,14 +2384,15 @@ sub process_inline ($$$$$$$$$$$$$$$$$$$$$$) {
|
||||
$chainref->{name} ,
|
||||
);
|
||||
|
||||
my $actionref = $actions{$inline};
|
||||
my $inlinefile = $actionref->{file};
|
||||
my $options = $actionref->{options};
|
||||
my $nolog = $options & NOLOG_OPT;
|
||||
my $actionref = $actions{$inline};
|
||||
my $inlinefile = $actionref->{file};
|
||||
my $options = $actionref->{options};
|
||||
my $nolog = $options & NOLOG_OPT;
|
||||
my $save_matches = fetch_inline_matches;
|
||||
|
||||
setup_audit_action( $inline ) if $options & AUDIT_OPT;
|
||||
|
||||
progress_message "..Expanding inline action $inlinefile...";
|
||||
progress_message "..Expanding inline action $inlinefile..." unless $inline eq $config{REJECT_ACTION};
|
||||
|
||||
push_open $inlinefile, 2, 1, undef , 2;
|
||||
|
||||
@@ -2350,12 +2402,12 @@ sub process_inline ($$$$$$$$$$$$$$$$$$$$$$) {
|
||||
my ( $mtarget,
|
||||
$msource,
|
||||
$mdest,
|
||||
$mproto,
|
||||
$mprotos,
|
||||
$mports,
|
||||
$msports,
|
||||
$morigdest,
|
||||
$mrate,
|
||||
$muser,
|
||||
$musers,
|
||||
$mmark,
|
||||
$mconnlimit,
|
||||
$mtime,
|
||||
@@ -2420,28 +2472,33 @@ sub process_inline ($$$$$$$$$$$$$$$$$$$$$$) {
|
||||
$mdest = '';
|
||||
}
|
||||
|
||||
$generated |= process_rule(
|
||||
$chainref,
|
||||
$matches,
|
||||
$matches1,
|
||||
$mtarget,
|
||||
$param,
|
||||
$msource,
|
||||
$mdest,
|
||||
merge_macro_column( $mproto, $proto ) ,
|
||||
merge_macro_column( $mports, $ports ) ,
|
||||
merge_macro_column( $msports, $sports ) ,
|
||||
merge_macro_column( $morigdest, $origdest ) ,
|
||||
merge_macro_column( $mrate, $rate ) ,
|
||||
merge_macro_column( $muser, $user ) ,
|
||||
merge_macro_column( $mmark, $mark ) ,
|
||||
merge_macro_column( $mconnlimit, $connlimit) ,
|
||||
merge_macro_column( $mtime, $time ),
|
||||
merge_macro_column( $mheaders, $headers ),
|
||||
merge_macro_column( $mcondition, $condition ),
|
||||
merge_macro_column( $mhelper, $helper ),
|
||||
$wildcard
|
||||
);
|
||||
for my $mp ( split_list( $mprotos, 'Protocol' ) ) {
|
||||
for my $mu ( split_list( $musers, 'User/Group' ) ) {
|
||||
$generated |= process_rule( $chainref,
|
||||
$matches,
|
||||
$matches1,
|
||||
$mtarget,
|
||||
$param,
|
||||
$msource,
|
||||
$mdest,
|
||||
merge_macro_column( $mp, $proto ) ,
|
||||
merge_macro_column( $mports, $ports ) ,
|
||||
merge_macro_column( $msports, $sports ) ,
|
||||
merge_macro_column( $morigdest, $origdest ) ,
|
||||
merge_macro_column( $mrate, $rate ) ,
|
||||
merge_macro_column( $mu, $user ) ,
|
||||
merge_macro_column( $mmark, $mark ) ,
|
||||
merge_macro_column( $mconnlimit, $connlimit) ,
|
||||
merge_macro_column( $mtime, $time ),
|
||||
merge_macro_column( $mheaders, $headers ),
|
||||
merge_macro_column( $mcondition, $condition ),
|
||||
merge_macro_column( $mhelper, $helper ),
|
||||
$wildcard
|
||||
);
|
||||
|
||||
set_inline_matches( $save_matches );
|
||||
}
|
||||
}
|
||||
|
||||
progress_message " Rule \"$currentline\" $done";
|
||||
}
|
||||
@@ -2634,7 +2691,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||
$loglevel = supplied $loglevel ? join( ':', $action, $loglevel ) : $action;
|
||||
$action = 'LOG';
|
||||
} elsif ( ! ( $actiontype & (ACTION | INLINE | IPTABLES | TARPIT ) ) ) {
|
||||
fatal_error "'builtin' actions may only be used in INLINE rules" if $actiontype == USERBUILTIN;
|
||||
fatal_error "'builtin' actions may only be used in INLINE or IP[6]TABLES rules" if $actiontype == USERBUILTIN;
|
||||
fatal_error "The $basictarget TARGET does not accept a parameter" unless $param eq '' || $actiontype & OPTIONS;
|
||||
}
|
||||
}
|
||||
@@ -2708,7 +2765,22 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||
}
|
||||
} ,
|
||||
|
||||
REJECT => sub { $action = 'reject'; } ,
|
||||
REJECT => sub {
|
||||
if ( supplied( $param ) ) {
|
||||
my $option = $reject_options{$param};
|
||||
fatal_error "Invalid REJECT option ($param)" unless $option;
|
||||
if ( $option == 2 ) {
|
||||
#
|
||||
# tcp-reset
|
||||
#
|
||||
fatal_error "tcp-reset may only be used with PROTO tcp" unless ( resolve_proto( $proto ) || 0 ) == TCP;
|
||||
}
|
||||
|
||||
$action = "REJECT --reject-with $param";
|
||||
} else {
|
||||
$action = 'reject';
|
||||
}
|
||||
},
|
||||
|
||||
CONTINUE => sub { $action = 'RETURN'; } ,
|
||||
|
||||
@@ -3021,8 +3093,8 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||
|
||||
my $generated = process_inline( $basictarget,
|
||||
$chainref,
|
||||
$prerule . $rule . $raw_matches,
|
||||
$matches1,
|
||||
$prerule . $rule,
|
||||
$matches1 . $raw_matches,
|
||||
$loglevel,
|
||||
$target,
|
||||
$param,
|
||||
@@ -3197,7 +3269,12 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||
|
||||
if ( $actiontype & ACTION ) {
|
||||
$action = $actionchain;
|
||||
$loglevel = '';
|
||||
|
||||
if ( $actions{$basictarget}{options} & LOGJUMP_OPT ) {
|
||||
$log_action = $basictarget;
|
||||
} else {
|
||||
$loglevel = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ( $origdest ) {
|
||||
@@ -3662,10 +3739,6 @@ sub process_raw_rule ( ) {
|
||||
$wild ) ) {
|
||||
$generated = 1;
|
||||
}
|
||||
#
|
||||
# Clear inline matches
|
||||
#
|
||||
set_inline_matches( '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3702,6 +3775,11 @@ sub process_rules() {
|
||||
RELATED_SECTION, 'RELATED',
|
||||
INVALID_SECTION, 'INVALID',
|
||||
UNTRACKED_SECTION, 'UNTRACKED' );
|
||||
|
||||
#
|
||||
# If A_REJECT was specified in shorewall[6].conf, the A_REJECT chain may already exist.
|
||||
#
|
||||
$usedactions{normalize_action_name( 'A_REJECT' )} = $filter_table->{A_REJECT} if $filter_table->{A_REJECT};
|
||||
#
|
||||
# Create zone-forwarding chains if required
|
||||
#
|
||||
@@ -3787,6 +3865,7 @@ sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$ ) {
|
||||
$chainref->{name} );
|
||||
|
||||
my $inlinefile = $actions{$inline}{file};
|
||||
my $matches = fetch_inline_matches;
|
||||
|
||||
progress_message "..Expanding inline action $inlinefile...";
|
||||
|
||||
@@ -3881,6 +3960,8 @@ sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$ ) {
|
||||
}
|
||||
|
||||
progress_message " Rule \"$currentline\" $done";
|
||||
|
||||
set_inline_matches( $matches );
|
||||
}
|
||||
|
||||
pop_comment( $save_comment );
|
||||
@@ -4169,7 +4250,9 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$ ) {
|
||||
minparams => 0,
|
||||
maxparams => 0,
|
||||
function => sub () {
|
||||
fatal_error 'DIVERT is only allowed in the PREROUTING chain' if $designator && $designator != PREROUTING;
|
||||
fatal_error 'DIVERT is only allowed in the PREROUTING chain' if $designator &&
|
||||
$designator != PREROUTING &&
|
||||
$designator != REALPREROUTING;
|
||||
my $mark = in_hex( $globals{TPROXY_MARK} ) . '/' . in_hex( $globals{TPROXY_MARK} );
|
||||
|
||||
unless ( $divertref ) {
|
||||
|
@@ -674,7 +674,8 @@ sub validate_tc_class( ) {
|
||||
$markval = numeric_value( $mark );
|
||||
fatal_error "Invalid MARK ($markval)" unless defined $markval;
|
||||
|
||||
fatal_error "Invalid Mark ($mark)" unless $markval <= $globals{TC_MAX};
|
||||
fatal_error "MARK value too large" unless $markval <= $globals{TC_MAX};
|
||||
fatal_error "MARK value must be non-zero" unless $markval;
|
||||
|
||||
if ( $classnumber ) {
|
||||
fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber};
|
||||
|
@@ -82,6 +82,7 @@ our @EXPORT = ( qw( NOTHING
|
||||
find_interface
|
||||
known_interface
|
||||
get_physical
|
||||
get_logical
|
||||
physical_name
|
||||
have_bridges
|
||||
port_to_bridge
|
||||
@@ -102,7 +103,6 @@ our @EXPORT = ( qw( NOTHING
|
||||
find_hosts_by_option
|
||||
find_zone_hosts_by_option
|
||||
find_zones_by_option
|
||||
all_ipsets
|
||||
have_ipsec
|
||||
),
|
||||
);
|
||||
@@ -209,8 +209,6 @@ our @interfaces;
|
||||
our %interfaces;
|
||||
our %roots;
|
||||
our @bport_zones;
|
||||
our %ipsets;
|
||||
our %physical;
|
||||
our %basemap;
|
||||
our %basemap1;
|
||||
our %mapbase;
|
||||
@@ -326,8 +324,6 @@ sub initialize( $$ ) {
|
||||
%roots = ();
|
||||
%interfaces = ();
|
||||
@bport_zones = ();
|
||||
%ipsets = ();
|
||||
%physical = ();
|
||||
%basemap = ();
|
||||
%basemap1 = ();
|
||||
%mapbase = ();
|
||||
@@ -349,6 +345,7 @@ sub initialize( $$ ) {
|
||||
logmartians => BINARY_IF_OPTION,
|
||||
loopback => BINARY_IF_OPTION,
|
||||
nets => IPLIST_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_VSERVER,
|
||||
nodbl => SIMPLE_IF_OPTION,
|
||||
norfc1918 => OBSOLETE_IF_OPTION,
|
||||
nosmurfs => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||
optional => SIMPLE_IF_OPTION,
|
||||
@@ -396,6 +393,7 @@ sub initialize( $$ ) {
|
||||
loopback => BINARY_IF_OPTION,
|
||||
maclist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||
nets => IPLIST_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_VSERVER,
|
||||
nodbl => SIMPLE_IF_OPTION,
|
||||
nosmurfs => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||
optional => SIMPLE_IF_OPTION,
|
||||
optional => SIMPLE_IF_OPTION,
|
||||
@@ -1281,7 +1279,7 @@ sub process_interface( $$ ) {
|
||||
fatal_error q("nets=" may not be specified for a multi-zone interface) unless $zone;
|
||||
fatal_error "Duplicate $option option" if $netsref;
|
||||
if ( $value eq 'dynamic' ) {
|
||||
require_capability( 'IPSET_MATCH', 'Dynamic nets', '');
|
||||
require_capability( 'IPSET_V5', 'Dynamic nets', '');
|
||||
$hostoptions{dynamic} = 1;
|
||||
#
|
||||
# Defer remaining processing until we have the final physical interface name
|
||||
@@ -1311,7 +1309,7 @@ sub process_interface( $$ ) {
|
||||
fatal_error "Invalid Physical interface name ($value)" unless $value && $value !~ /%/;
|
||||
fatal_error "Virtual interfaces ($value) are not supported" if $value =~ /:\d+$/;
|
||||
|
||||
fatal_error "Duplicate physical interface name ($value)" if ( $physical{$value} && ! $port );
|
||||
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );
|
||||
|
||||
fatal_error "The type of 'physical' name ($value) doesn't match the type of interface name ($interface)" if $wildcard && ! $value =~ /\+$/;
|
||||
$physical = $value;
|
||||
@@ -1345,7 +1343,7 @@ sub process_interface( $$ ) {
|
||||
my $ipset = $family == F_IPV4 ? "${zone}" : "6_${zone}";
|
||||
$ipset = join( '_', $ipset, var_base1( $physical ) ) unless $zoneref->{options}{in_out}{dynamic_shared};
|
||||
$netsref = [ "+$ipset" ];
|
||||
$ipsets{$ipset} = 1;
|
||||
add_ipset($ipset);
|
||||
}
|
||||
|
||||
if ( $options{bridge} ) {
|
||||
@@ -1385,21 +1383,23 @@ sub process_interface( $$ ) {
|
||||
$options{tcpflags} = $hostoptionsref->{tcpflags} = 1 unless exists $options{tcpflags};
|
||||
}
|
||||
|
||||
$physical{$physical} = $interfaces{$interface} = { name => $interface ,
|
||||
bridge => $bridge ,
|
||||
filter => $filterref ,
|
||||
nets => 0 ,
|
||||
number => $nextinum ,
|
||||
root => $root ,
|
||||
broadcasts => $broadcasts ,
|
||||
options => \%options ,
|
||||
zone => '',
|
||||
physical => $physical ,
|
||||
base => var_base( $physical ),
|
||||
zones => {},
|
||||
origin => shortlineinfo( '' ),
|
||||
wildcard => $wildcard,
|
||||
};
|
||||
my $interfaceref = $interfaces{$interface} = { name => $interface ,
|
||||
bridge => $bridge ,
|
||||
filter => $filterref ,
|
||||
nets => 0 ,
|
||||
number => $nextinum ,
|
||||
root => $root ,
|
||||
broadcasts => $broadcasts ,
|
||||
options => \%options ,
|
||||
zone => '',
|
||||
physical => $physical ,
|
||||
base => var_base( $physical ),
|
||||
zones => {},
|
||||
origin => shortlineinfo( '' ),
|
||||
wildcard => $wildcard,
|
||||
};
|
||||
|
||||
$interfaces{$physical} = $interfaceref if $physical ne $interface;
|
||||
|
||||
if ( $zone ) {
|
||||
fatal_error "Unmanaged interfaces may not be associated with a zone" if $options{unmanaged};
|
||||
@@ -1570,20 +1570,23 @@ sub known_interface($)
|
||||
|
||||
my $physical = map_physical( $interface, $interfaceref );
|
||||
|
||||
return $interfaces{$interface} = { options => $interfaceref->{options} ,
|
||||
bridge => $interfaceref->{bridge} ,
|
||||
name => $i ,
|
||||
number => $interfaceref->{number} ,
|
||||
physical => $physical ,
|
||||
base => var_base( $physical ) ,
|
||||
wildcard => $interfaceref->{wildcard} ,
|
||||
zones => $interfaceref->{zones} ,
|
||||
};
|
||||
$interfaceref =
|
||||
$interfaces{$interface} =
|
||||
$interfaces{$physical} = { options => $interfaceref->{options} ,
|
||||
bridge => $interfaceref->{bridge} ,
|
||||
name => $i ,
|
||||
number => $interfaceref->{number} ,
|
||||
physical => $physical ,
|
||||
base => var_base( $physical ) ,
|
||||
wildcard => $interfaceref->{wildcard} ,
|
||||
zones => $interfaceref->{zones} ,
|
||||
};
|
||||
return $interfaceref;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$physical{$interface} || 0;
|
||||
0;
|
||||
}
|
||||
|
||||
#
|
||||
@@ -1655,12 +1658,19 @@ sub find_interface( $ ) {
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the physical interface associated with the passed logical name
|
||||
# Returns the physical interface associated with the passed interface name
|
||||
#
|
||||
sub get_physical( $ ) {
|
||||
$interfaces{ $_[0] }->{physical};
|
||||
}
|
||||
|
||||
#
|
||||
# Returns the logical interface associated with the passed interface name
|
||||
#
|
||||
sub get_logical( $ ) {
|
||||
$interfaces{ $_[0] }->{name};
|
||||
}
|
||||
|
||||
#
|
||||
# This one doesn't insist that the passed name be the name of a configured interface
|
||||
#
|
||||
@@ -2040,6 +2050,7 @@ sub process_host( ) {
|
||||
$interface = $1;
|
||||
$hosts = $2;
|
||||
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface}) && $interfaceref->{root};
|
||||
$interface = $interfaceref->{name};
|
||||
} else {
|
||||
fatal_error "Invalid HOST(S) column contents: $hosts";
|
||||
}
|
||||
@@ -2053,7 +2064,7 @@ sub process_host( ) {
|
||||
|
||||
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface}) && $interfaceref->{root};
|
||||
fatal_error "Unmanaged interfaces may not be associated with a zone" if $interfaceref->{unmanaged};
|
||||
|
||||
$interface = $interfaceref->{name};
|
||||
if ( $interfaceref->{physical} eq $loopback_interface ) {
|
||||
fatal_error "Only a loopback zone may be associated with the loopback interface ($loopback_interface)" if $type != LOOPBACK;
|
||||
} else {
|
||||
@@ -2141,7 +2152,7 @@ sub process_host( ) {
|
||||
|
||||
$hosts = "+$set";
|
||||
$optionsref->{dynamic} = 1;
|
||||
$ipsets{$set} = 1;
|
||||
add_ipset($set);
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2261,8 +2272,4 @@ sub find_zones_by_option( $$ ) {
|
||||
\@zns;
|
||||
}
|
||||
|
||||
sub all_ipsets() {
|
||||
sort keys %ipsets;
|
||||
}
|
||||
|
||||
1;
|
||||
|
@@ -1 +0,0 @@
|
||||
This is the Shorewall 4.4 stable branch of Git.
|
@@ -192,6 +192,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MAPOLDACTIONS=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
@@ -203,6 +203,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MAPOLDACTIONS=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
@@ -200,6 +200,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MAPOLDACTIONS=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
@@ -203,6 +203,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MAPOLDACTIONS=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
@@ -1,41 +1,39 @@
|
||||
#
|
||||
# Shorewall version 5 - Drop Action
|
||||
# Shorewall -- /usr/share/shorewall/action.A_Drop
|
||||
#
|
||||
# /usr/share/shorewall/action.A_Drop
|
||||
# The audited default DROP common rules
|
||||
#
|
||||
# The audited default DROP common rules
|
||||
# This action is invoked before a DROP policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# This action is invoked before a DROP policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that 'auth' requests are rejected, even if the policy is
|
||||
# DROP. Otherwise, you may experience problems establishing
|
||||
# connections with servers that use auth.
|
||||
# c) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DPORT SPORT
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
# Count packets that come through here
|
||||
#
|
||||
COUNT
|
||||
#
|
||||
# Silently DROP 'auth'
|
||||
# Special Handling for Auth
|
||||
#
|
||||
Auth(A_DROP)
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
# For IPv6 connectivity ipv6-icmp broadcasting is required so
|
||||
# AllowICMPs must be before broadcast Drop.
|
||||
#
|
||||
A_AllowICMPs - - icmp
|
||||
#
|
||||
# Don't log broadcasts
|
||||
#
|
||||
dropBcast(audit)
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
A_AllowICMPs - - icmp
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log.
|
||||
#
|
||||
|
41
Shorewall/action.A_REJECT
Normal file
41
Shorewall/action.A_REJECT
Normal file
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/action.A_REJECTWITH
|
||||
#
|
||||
# A_REJECT Action.
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# A_REJECTWITH[([<option>])] where <option> is a valid REJECT option.#
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS -
|
||||
|
||||
AUDIT(reject)
|
||||
|
||||
?if passed @1
|
||||
?if @1 =~ /tcp-reset$/
|
||||
?set reject_proto 6
|
||||
?else
|
||||
?set reject_proto ''
|
||||
?endif
|
||||
REJECT(@1) - - $reject_proto
|
||||
?else
|
||||
REJECT
|
||||
?endif
|
30
Shorewall/action.A_REJECT!
Normal file
30
Shorewall/action.A_REJECT!
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/action.A_REJECT!
|
||||
#
|
||||
# A_REJECT! Action.
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# A_REJECTWITH[([<option>])] where <option> is a valid REJECT option.#
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS -
|
||||
|
||||
A_REJECT(@1)
|
@@ -1,34 +1,35 @@
|
||||
#
|
||||
# Shorewall version 5 - Reject Action
|
||||
# Shorewall -- /usr/share/shorewall/action.A_Reject
|
||||
#
|
||||
# /usr/share/shorewall/action.A_Reject
|
||||
# The audited default REJECT action common rules
|
||||
#
|
||||
# The audited default REJECT action common rules
|
||||
# This action is invoked before a REJECT policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# This action is invoked before a REJECT policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO
|
||||
#ACTION SOURCE DEST PROTO
|
||||
#
|
||||
# Count packets that come through here
|
||||
#
|
||||
COUNT
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
# For IPv6 connectivity ipv6-icmp broadcasting is required so
|
||||
# AllowICMPs must be before broadcast Drop.
|
||||
#
|
||||
A_AllowICMPs - - icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
dropBcast(audit)
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
A_AllowICMPs - - icmp
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log (these ICMPs cannot be
|
||||
# rejected).
|
@@ -1,22 +1,24 @@
|
||||
#
|
||||
# Shorewall version 5 - Auto Blacklist Action
|
||||
# Shorewall -- /usr/share/shorewall/action.AutoBL
|
||||
#
|
||||
# Auto Blacklist Action
|
||||
#
|
||||
# Parameters are:
|
||||
#
|
||||
# Event - Name of the event to associate with this blacklist
|
||||
# Interval
|
||||
# Count - Interval and number of Packets to trigger blacklisting
|
||||
# Default is 60 seconds and 5 packets.
|
||||
# Successive - If a matching packet arrives within this many
|
||||
# seconds of the preceding one, it should be logged
|
||||
# and dealt with according to the Disposition and
|
||||
# Log Level parameters below. Default is 2 seconds.
|
||||
# Blacklist time - Number of seconds to blacklist
|
||||
# Default is 300 (5 minutes)
|
||||
# Disposition - Disposition of blacklisted packets
|
||||
# Default is DROP
|
||||
# Log Level - Level to Log Rejects
|
||||
# Default is info (6)
|
||||
# Event - Name of the event to associate with this blacklist
|
||||
# Interval
|
||||
# Count - Interval and number of Packets to trigger blacklisting
|
||||
# Default is 60 seconds and 5 packets.
|
||||
# Successive - If a matching packet arrives within this many
|
||||
# seconds of the preceding one, it should be logged
|
||||
# and dealt with according to the Disposition and
|
||||
# Log Level parameters below. Default is 2 seconds.
|
||||
# Blacklist time - Number of seconds to blacklist
|
||||
# Default is 300 (5 minutes)
|
||||
# Disposition - Disposition of blacklisted packets
|
||||
# Default is DROP
|
||||
# Log Level - Level to Log Rejects
|
||||
# Default is info (6)
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
@@ -37,7 +39,7 @@ validate_level( $level );
|
||||
1;
|
||||
?end perl
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DPORT SPORT
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
# Silently reject the client if blacklisted
|
||||
#
|
||||
|
@@ -1,13 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - Auto Blacklisting Logger Action
|
||||
# Shorewall -- /usr/share/shorewall/action.AutoBLL
|
||||
#
|
||||
# Auto Blacklisting Logger Action
|
||||
#
|
||||
# Arguments are
|
||||
#
|
||||
# Event: Name of the blacklisted event
|
||||
# Disposition: What to do with packets
|
||||
# Level: Log level and optional tag for logging.
|
||||
# Event - Name of the blacklisted event
|
||||
# Disposition - What to do with packets
|
||||
# Level - Log level and optional tag for logging
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DPORT SPORT
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
# Log the Reject
|
||||
#
|
||||
|
@@ -1,32 +1,30 @@
|
||||
#
|
||||
# Shorewall 4 - Broadcast Action
|
||||
# Shorewall -- /usr/share/shorewall/action.Broadcast
|
||||
#
|
||||
# /usr/share/shorewall/action.Broadcast
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# Broadcast[([<action>|-[,{audit|-}])]
|
||||
#
|
||||
# Broadcast[([<action>|-[,{audit|-}])]
|
||||
# Default action is DROP
|
||||
#
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
|
@@ -1,32 +1,33 @@
|
||||
#
|
||||
# Shorewall 5 - DNS Amplification Action
|
||||
# Shorewall -- /usr/share/shorewall/action.DNSAmp
|
||||
#
|
||||
# /usr/share/shorewall/action.DNSAmp
|
||||
# DNS Amplification Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# DNSAmp[([<action>])]
|
||||
# DNSAmp[([<action>])]
|
||||
#
|
||||
# Default action is DROP
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
DEFAULTS DROP
|
||||
|
||||
|
@@ -1,29 +1,29 @@
|
||||
#
|
||||
# Shorewall version 5 - Drop Action
|
||||
# Shorewall -- /usr/share/shorewall/action.Drop
|
||||
#
|
||||
# /usr/share/shorewall/action.Drop
|
||||
# The default DROP common rules
|
||||
#
|
||||
# The default DROP common rules
|
||||
# This action is invoked before a DROP policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# This action is invoked before a DROP policy is enforced. The purpose
|
||||
# of the action is:
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
# The action accepts six optional parameters:
|
||||
#
|
||||
# The action accepts five optional parameters:
|
||||
#
|
||||
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
|
||||
# actions.
|
||||
# 2 - Action to take with Auth requests. Default is to do nothing special
|
||||
# with them.
|
||||
# 3 - Action to take with SMB requests. Default is DROP or A_DROP,
|
||||
# depending on the setting of the first parameter.
|
||||
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
|
||||
# A_ACCEPT depending on the first parameter.
|
||||
# 5 - Action to take with late UDP replies (UDP source port 53). Default
|
||||
# is DROP or A_DROP depending on the first parameter.
|
||||
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
|
||||
# actions.
|
||||
# 2 - Action to take with Auth requests. Default is to do nothing special
|
||||
# with them.
|
||||
# 3 - Action to take with SMB requests. Default is DROP or A_DROP,
|
||||
# depending on the setting of the first parameter.
|
||||
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
|
||||
# A_ACCEPT depending on the first parameter.
|
||||
# 5 - Action to take with late UDP replies (UDP source port 53). Default
|
||||
# is DROP or A_DROP depending on the first parameter.
|
||||
# 6 - Action to take with UPnP packets. Default is DROP or A_DROP
|
||||
# depending on the first parameter.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
#
|
||||
@@ -31,15 +31,15 @@
|
||||
|
||||
?if passed(@1)
|
||||
?if @1 eq 'audit'
|
||||
DEFAULTS -,-,A_DROP,A_ACCEPT,A_DROP
|
||||
DEFAULTS -,-,A_DROP,A_ACCEPT,A_DROP,A_DROP
|
||||
?else
|
||||
?error The first parameter to Drop must be 'audit' or '-'
|
||||
?endif
|
||||
?else
|
||||
DEFAULTS -,-,DROP,ACCEPT,DROP
|
||||
DEFAULTS -,-,DROP,ACCEPT,DROP,DROP
|
||||
?endif
|
||||
|
||||
#TARGET SOURCE DEST PROTO DPORT SPORT
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
# Count packets that come through here
|
||||
#
|
||||
@@ -51,14 +51,17 @@ COUNT
|
||||
Auth(@2)
|
||||
?endif
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
# For IPv6 connectivity ipv6-icmp broadcasting is required so
|
||||
# AllowICMPs must be before silent broadcast Drop.
|
||||
#
|
||||
AllowICMPs(@4) - - icmp
|
||||
#
|
||||
# Don't log broadcasts
|
||||
#
|
||||
Broadcast(DROP,@1)
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
AllowICMPs(@4) - - icmp
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log.
|
||||
#
|
||||
@@ -67,7 +70,7 @@ Invalid(DROP,@1)
|
||||
# Drop Microsoft noise so that it doesn't clutter up the log.
|
||||
#
|
||||
SMB(@3)
|
||||
DropUPnP(@5)
|
||||
DropUPnP(@6)
|
||||
#
|
||||
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
||||
#
|
||||
|
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Shorewall version 5 - Drop Smurfs Action
|
||||
# Shorewall -- /usr/share/shorewall/action.DropSmurfs
|
||||
#
|
||||
# /usr/share/shorewall/action.DropSmurfs
|
||||
# Drop Smurfs Action
|
||||
#
|
||||
# Accepts a single optional parameter:
|
||||
# Accepts a single optional parameter:
|
||||
#
|
||||
# - = Do not Audit
|
||||
# audit = Audit dropped packets.
|
||||
# - = Do not Audit
|
||||
# audit = Audit dropped packets.
|
||||
#
|
||||
#################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS -
|
||||
|
||||
@@ -79,8 +79,3 @@ if ( $family == F_IPV4 ) {
|
||||
}
|
||||
|
||||
?end perl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,32 +1,32 @@
|
||||
#
|
||||
# Shorewall 5 - Established Action
|
||||
# Shorewall -- /usr/share/shorewall/action.Established
|
||||
#
|
||||
# /usr/share/shorewall/action.Established
|
||||
# Established Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Established[([<action>])]
|
||||
# Established[([<action>])]
|
||||
#
|
||||
# Default action is ACCEPT
|
||||
# Default action is ACCEPT
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS ACCEPT
|
||||
|
||||
|
@@ -1,13 +1,14 @@
|
||||
#
|
||||
# Shorewall version 5 - GlusterFS Handler for GlusterFS 3.4 and Later
|
||||
# Shorewall -- /usr/share/shorewall/action.GlusterFS
|
||||
#
|
||||
# /etc/shorewall/action.GlusterFS
|
||||
# GlusterFS Handler for GlusterFS 3.4 and Later
|
||||
#
|
||||
# Parameters:
|
||||
# Bricks: Number of bricks
|
||||
# IB: 0 or 1, indicating whether Infiniband is used or not
|
||||
#
|
||||
#########################################################################################
|
||||
# Bricks - Number of bricks
|
||||
# IB - 0 or 1, indicating whether Infiniband is used or not
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS 2,0
|
||||
|
||||
@@ -17,8 +18,8 @@ DEFAULTS 2,0
|
||||
?error Invalid value for IB (@2)
|
||||
?endif
|
||||
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||
# PORT PORT(S) DEST LIMIT GROUP
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
ACCEPT - - udp 111,2049
|
||||
ACCEPT - - tcp 38465:38467
|
||||
|
||||
@@ -31,4 +32,3 @@ ACCEPT - - tcp 24007
|
||||
?set last_port 49150 + @{1}
|
||||
|
||||
ACCEPT - - tcp 49151:$last_port
|
||||
|
||||
|
@@ -1,34 +1,38 @@
|
||||
#
|
||||
# Shorewall version 5 - Perform an Action based on a Event
|
||||
# Shorewall -- /usr/share/shorewall/action.IfEvent
|
||||
#
|
||||
# /etc/shorewall/action.IfEvent
|
||||
# Perform an Action based on a Event
|
||||
#
|
||||
# Parameters:
|
||||
# Event: Must start with a letter and be composed of letters, digits, '-', and '_'.
|
||||
# Action: Anything that can appear in the ACTION column of a rule.
|
||||
# Duration: Duration in seconds over which the event is to be tested.
|
||||
# Hit Count: Number of packets seen within the duration -- default is 1
|
||||
# Src or Dest: 'src' (default) or 'dst'. Determines if the event is associated with the source
|
||||
# address (src) or destination address (dst)
|
||||
# Command: 'check' (default) 'reset', or 'update'. If 'reset', the event will be reset before
|
||||
# the Action is taken. If 'update', the timestamp associated with the event will
|
||||
# be updated and the action taken if the time limit/hitcount are matched.
|
||||
# If '-', the action will be taken if the limit/hitcount are matched but the
|
||||
# event's timestamp will not be updated.
|
||||
#
|
||||
# If a duration is specified, then 'checkreap' and 'updatereap' may also
|
||||
# be used. These are like 'check' and 'update' respectively, but they also
|
||||
# remove any event entries for the IP address that are older than <duration>
|
||||
# seconds.
|
||||
# Disposition: Disposition for any event generated.
|
||||
# Event - Must start with a letter and be composed of letters, digits,
|
||||
# '-', and '_'.
|
||||
# Action - Anything that can appear in the ACTION column of a rule.
|
||||
# Duration - Duration in seconds over which the event is to be tested.
|
||||
# Hit Count - Number of packets seen within the duration -- default is 1
|
||||
# Src or Dest - 'src' (default) or 'dst'. Determines if the event is
|
||||
# associated with the source address (src) or destination
|
||||
# address (dst)
|
||||
# Command - 'check' (default) 'reset', or 'update'. If 'reset',
|
||||
# the event will be reset before the Action is taken.
|
||||
# If 'update', the timestamp associated with the event will
|
||||
# be updated and the action taken if the time limit/hitcount
|
||||
# are matched.
|
||||
# If '-', the action will be taken if the limit/hitcount are
|
||||
# matched but the event's timestamp will not be updated.
|
||||
#
|
||||
# If a duration is specified, then 'checkreap' and 'updatereap'
|
||||
# may also be used. These are like 'check' and 'update'
|
||||
# respectively, but they also remove any event entries for
|
||||
# the IP address that are older than <duration> seconds.
|
||||
# Disposition - Disposition for any event generated.
|
||||
#
|
||||
# For additional information, see http://www.shorewall.net/Events.html
|
||||
#
|
||||
#######################################################################################################
|
||||
###############################################################################
|
||||
# DO NOT REMOVE THE FOLLOWING LINE
|
||||
#################################################################################################################################################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||
# PORT PORT(S) DEST LIMIT GROUP
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT
|
||||
|
||||
DEFAULTS -,ACCEPT,-,1,src,check,-
|
||||
|
||||
|
@@ -1,35 +1,35 @@
|
||||
#
|
||||
# Shorewall 4 - Invalid Action
|
||||
# Shorewall -- /usr/share/shorewall/action.Invalid
|
||||
#
|
||||
# /usr/share/shorewall/action.Invalid
|
||||
# Invalid Action
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# Invalid[([<action>])]
|
||||
#
|
||||
# Invalid[([<action>])]
|
||||
# Default action is DROP
|
||||
#
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
#
|
||||
# All logic for this action is triggered by the 'audit' and 'state' options in actions.std
|
||||
# All logic for this action is triggered by the 'audit' and 'state' options
|
||||
# in actions.std
|
||||
#
|
||||
|
@@ -1,32 +1,32 @@
|
||||
#
|
||||
# Shorewall 4 - New Action
|
||||
# Shorewall -- /usr/share/shorewall/action.New
|
||||
#
|
||||
# /usr/share/shorewall/action.New
|
||||
# New Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# New[([<action>])]
|
||||
# New[([<action>])]
|
||||
#
|
||||
# Default action is ACCEPT
|
||||
# Default action is ACCEPT
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS ACCEPT
|
||||
|
||||
|
@@ -1,32 +1,32 @@
|
||||
#
|
||||
# Shorewall 4 - NotSyn Action
|
||||
# Shorewall -- /usr/share/shorewall/action.NotSyn
|
||||
#
|
||||
# /usr/share/shorewall/action.NotSyn
|
||||
# NotSyn Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# NotSyn[([<action>])]
|
||||
# NotSyn[([<action>])]
|
||||
#
|
||||
# Default action is DROP
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
|
@@ -1,32 +1,32 @@
|
||||
#
|
||||
# Shorewall 4 - RST Action
|
||||
# Shorewall -- /usr/share/shorewall/action.RST
|
||||
#
|
||||
# /usr/share/shorewall/action.RST
|
||||
# RST Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# RST[([<action>])]
|
||||
# RST[([<action>])]
|
||||
#
|
||||
# Default action is DROP
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
|
@@ -1,44 +1,44 @@
|
||||
#
|
||||
# Shorewall version 5 - Reject Action
|
||||
# Shorewall -- /usr/share/shorewall/action.Reject
|
||||
#
|
||||
# /usr/share/shorewall/action.Reject
|
||||
# The default REJECT action common rules
|
||||
#
|
||||
# The default REJECT action common rules
|
||||
# This action is invoked before a REJECT policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# This action is invoked before a REJECT policy is enforced. The purpose
|
||||
# of the action is:
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
# The action accepts six optional parameters:
|
||||
#
|
||||
# The action accepts five optional parameters:
|
||||
#
|
||||
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
|
||||
# actions.
|
||||
# 2 - Action to take with Auth requests. Default is to do nothing
|
||||
# special with them.
|
||||
# 3 - Action to take with SMB requests. Default is REJECT or A_REJECT,
|
||||
# depending on the setting of the first parameter.
|
||||
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
|
||||
# A_ACCEPT depending on the first parameter.
|
||||
# 5 - Action to take with late UDP replies (UDP source port 53). Default
|
||||
# is DROP or A_DROP depending on the first parameter.
|
||||
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
|
||||
# actions.
|
||||
# 2 - Action to take with Auth requests. Default is to do nothing
|
||||
# special with them.
|
||||
# 3 - Action to take with SMB requests. Default is REJECT or A_REJECT,
|
||||
# depending on the setting of the first parameter.
|
||||
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
|
||||
# A_ACCEPT depending on the first parameter.
|
||||
# 5 - Action to take with late UDP replies (UDP source port 53). Default
|
||||
# is DROP or A_DROP depending on the first parameter.
|
||||
# 6 - Action to take with UPnP packets. Default is DROP or A_DROP
|
||||
# depending on the first parameter.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
###############################################################################
|
||||
|
||||
?if passed(@1)
|
||||
?if @1 eq 'audit'
|
||||
DEFAULTS -,-,A_REJECT,A_ACCEPT,A_DROP
|
||||
DEFAULTS -,-,A_REJECT,A_ACCEPT,A_DROP,A_DROP
|
||||
?else
|
||||
?error The first parameter to Reject must be 'audit' or '-'
|
||||
?endif
|
||||
?else
|
||||
DEFAULTS -,-,REJECT,ACCEPT,DROP
|
||||
DEFAULTS -,-,REJECT,ACCEPT,DROP,DROP
|
||||
?endif
|
||||
|
||||
#TARGET SOURCE DEST PROTO
|
||||
#ACTION SOURCE DEST PROTO
|
||||
#
|
||||
# Count packets that come through here
|
||||
#
|
||||
@@ -50,15 +50,18 @@ COUNT
|
||||
Auth(@2)
|
||||
?endif
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
# For IPv6 connectivity ipv6-icmp broadcasting is required so
|
||||
# AllowICMPs must be before silent broadcast Drop.
|
||||
#
|
||||
AllowICMPs(@4) - - icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
Broadcast(DROP,@1)
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
AllowICMPs(@4) - - icmp
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log (these ICMPs cannot be
|
||||
# rejected).
|
||||
@@ -68,7 +71,7 @@ Invalid(DROP,@1)
|
||||
# Reject Microsoft noise so that it doesn't clutter up the log.
|
||||
#
|
||||
SMB(@3)
|
||||
DropUPnP(@5)
|
||||
DropUPnP(@6)
|
||||
#
|
||||
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
||||
#
|
||||
|
@@ -1,32 +1,32 @@
|
||||
#
|
||||
# Shorewall 4 - Related Action
|
||||
# Shorewall -- /usr/share/shorewall/action.Related
|
||||
#
|
||||
# /usr/share/shorewall/action.Related
|
||||
# Related Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Related[([<action>])]
|
||||
# Related[([<action>])]
|
||||
#
|
||||
# Default action is DROP
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP
|
||||
|
||||
|
@@ -1,22 +1,24 @@
|
||||
#
|
||||
# Shorewall version 5 - Reset an Event
|
||||
# Shorewall -- /etc/shorewall/action.ResetEvent
|
||||
#
|
||||
# /etc/shorewall/action.ResetEvent
|
||||
# Reset an Event
|
||||
#
|
||||
# Parameters:
|
||||
# Event: Must start with a letter and be composed of letters, digits, '-', and '_'.
|
||||
# Action: Action to perform after setting the event. Default is ACCEPT
|
||||
# Src or Dest: 'src' (default) or 'dst'. Determines if the event is associated with the source
|
||||
# address (src) or destination address (dst)
|
||||
# Disposition: Disposition for any rule generated.
|
||||
#
|
||||
# Event - Must start with a letter and be composed of letters, digits,
|
||||
# '-', and '_'.
|
||||
# Action - Action to perform after setting the event. Default is ACCEPT
|
||||
# Src or Dest - 'src' (default) or 'dst'. Determines if the event is
|
||||
# associated with the source address (src) or destination
|
||||
# address (dst)
|
||||
# Disposition - Disposition for any rule generated.
|
||||
#
|
||||
# For additional information, see http://www.shorewall.net/Events.html
|
||||
#
|
||||
#######################################################################################################
|
||||
# DO NOT REMOVE THE FOLLOWING LINE
|
||||
#################################################################################################################################################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||
# PORT PORT(S) DEST LIMIT GROUP
|
||||
###############################################################################
|
||||
# DO NOT REMOVE THE FOLLOWING LINE
|
||||
##############################################################################################################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||
|
||||
DEFAULTS -,ACCEPT,src,-
|
||||
|
||||
|
@@ -1,14 +1,17 @@
|
||||
#
|
||||
# Shorewall version 5 - Set an Event
|
||||
# Shorewall -- /usr/share/shorewall/action.SetEvent
|
||||
#
|
||||
# /etc/shorewall/action.SetEvent
|
||||
# Set an Event
|
||||
#
|
||||
# Parameters:
|
||||
# Event: Must start with a letter and be composed of letters, digits, '-', and '_'.
|
||||
# Action: Action to perform after setting the event. Default is ACCEPT
|
||||
# Src or Dest: 'src' (default) or 'dst'. Determines if the event is associated with the source
|
||||
# address (src) or destination address (dst)
|
||||
# Disposition: Disposition for any event generated.
|
||||
#
|
||||
# Event - Must start with a letter and be composed of letters, digits,
|
||||
# '-', and '_'.
|
||||
# Action - Action to perform after setting the event. Default is ACCEPT
|
||||
# Src or Dest - 'src' (default) or 'dst'. Determines if the event is
|
||||
# associated with the source address (src) or destination
|
||||
# address (dst)
|
||||
# Disposition - Disposition for any event generated.
|
||||
#
|
||||
# For additional information, see http://www.shorewall.net/Events.html
|
||||
#
|
||||
|
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Shorewall version 5 - Drop TCPFlags Action
|
||||
# Shorewall -- /usr/share/shorewall/action.TCPFlags
|
||||
#
|
||||
# /usr/share/shorewall/action.TCPFlags
|
||||
# Drop TCPFlags Action
|
||||
#
|
||||
# Accepts a single optional parameter:
|
||||
# Accepts a single optional parameter:
|
||||
#
|
||||
# - = Do not Audit
|
||||
# audit = Audit dropped packets.
|
||||
# - = Do not Audit
|
||||
# audit = Audit dropped packets.
|
||||
#
|
||||
#################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS -
|
||||
|
||||
|
@@ -1,32 +1,33 @@
|
||||
#
|
||||
# Shorewall 4 - Untracked Action
|
||||
# Shorewall --/usr/share/shorewall/action.Untracked
|
||||
#
|
||||
# /usr/share/shorewall/action.Untracked
|
||||
# Untracked Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Untracked[([<action>])]
|
||||
# Untracked[([<action>])]
|
||||
#
|
||||
# Default action is DROP
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP
|
||||
|
||||
#
|
||||
|
@@ -1,30 +1,28 @@
|
||||
\#
|
||||
# Shorewall 4 - allowInvalid Action
|
||||
#
|
||||
# /usr/share/shorewall/action.allowInvalid
|
||||
# Shorewall -- /usr/share/shorewall/action.allowInvalid
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# allowInvalid[([audit])]
|
||||
# allowInvalid[([audit])]
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS -
|
||||
|
||||
|
@@ -1,32 +1,30 @@
|
||||
#
|
||||
# Shorewall 5 - dropInvalid Action
|
||||
# Shorewall -- /usr/share/shorewall/action.dropInvalid
|
||||
#
|
||||
# /usr/share/shorewall/action.dropInvalid
|
||||
# dropInvalid Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# dropInvalid[([audit])]
|
||||
# dropInvalid[([audit])]
|
||||
#
|
||||
##########################################################################################
|
||||
|
||||
DEFAULTS -
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS -
|
||||
|
||||
|
@@ -1,20 +1,20 @@
|
||||
#
|
||||
# Shorewall version 5 - Mangle Action Template
|
||||
# Shorewall -- /etc/shorewall/action.mangletemplate
|
||||
#
|
||||
# /etc/shorewall/action.mangletemplate
|
||||
# Mangle Action Template
|
||||
#
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined with the mangle option in /etc/shorewall/actions.
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined with the mangle option in /etc/shorewall/actions.
|
||||
#
|
||||
# To define a new action:
|
||||
# To define a new action:
|
||||
#
|
||||
# 1. Add the <action name> to /etc/shorewall/actions with the mangle option
|
||||
# 2. Copy this file to /etc/shorewall/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
# 1. Add the <action name> to /etc/shorewall/actions with the mangle option
|
||||
# 2. Copy this file to /etc/shorewall/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
#
|
||||
# Please see http://shorewall.net/Actions.html for additional
|
||||
# information.
|
||||
# Please see http://shorewall.net/Actions.html for additional
|
||||
# information.
|
||||
#
|
||||
# Columns are the same as in /etc/shorewall/mangle.
|
||||
#
|
||||
|
@@ -1,20 +1,20 @@
|
||||
#
|
||||
# Shorewall version 5 - Action Template
|
||||
# Shorewall -- /usr/share/shorewall/action.template
|
||||
#
|
||||
# /etc/shorewall/action.template
|
||||
# Action Template
|
||||
#
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined in /etc/shorewall/actions.
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined in /etc/shorewall/actions.
|
||||
#
|
||||
# To define a new action:
|
||||
# To define a new action:
|
||||
#
|
||||
# 1. Add the <action name> to /etc/shorewall/actions
|
||||
# 2. Copy this file to /etc/shorewall/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
# 1. Add the <action name> to /etc/shorewall/actions
|
||||
# 2. Copy this file to /etc/shorewall/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
#
|
||||
# Please see http://shorewall.net/Actions.html for additional
|
||||
# information.
|
||||
# Please see http://shorewall.net/Actions.html for additional
|
||||
# information.
|
||||
#
|
||||
# Columns are the same as in /etc/shorewall/rules.
|
||||
#
|
||||
|
@@ -11,7 +11,6 @@
|
||||
?if 0
|
||||
A_ACCEPT # Audits then accepts a connection request
|
||||
A_DROP # Audits then drops a connection request
|
||||
A_REJECT # Audits then drops a connection request
|
||||
allowBcast # Silently Allow Broadcast/multicast
|
||||
dropBcast # Silently Drop Broadcast/multicast
|
||||
dropNotSyn # Silently Drop Non-syn TCP packets
|
||||
@@ -23,6 +22,8 @@ Limit # Limit the rate of connections from each indivi
|
||||
###############################################################################
|
||||
#ACTION
|
||||
A_Drop # Audited Default Action for DROP policy
|
||||
A_REJECT noinline,logjump # Audits then rejects a connection request
|
||||
A_REJECT! inline # Audits then rejects a connection request
|
||||
A_Reject # Audited Default action for REJECT policy
|
||||
allowInvalid inline # Accepts packets in the INVALID conntrack state
|
||||
AutoBL noinline # Auto-blacklist IPs that exceed thesholds
|
||||
|
@@ -194,6 +194,8 @@ MAPOLDACTIONS=No
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MODULE_SUFFIX=ko
|
||||
|
||||
MULTICAST=No
|
||||
|
@@ -419,11 +419,13 @@ mkdir -p ${DESTDIR}${CONFDIR}/$PRODUCT
|
||||
mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT
|
||||
mkdir -p ${DESTDIR}${PERLLIBDIR}/Shorewall
|
||||
mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
||||
mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated
|
||||
mkdir -p ${DESTDIR}${VARDIR}
|
||||
|
||||
chmod 755 ${DESTDIR}${CONFDIR}/$PRODUCT
|
||||
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT
|
||||
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
||||
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated
|
||||
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
|
||||
@@ -1060,15 +1062,31 @@ fi
|
||||
# Install the Action files
|
||||
#
|
||||
for f in action.* ; do
|
||||
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
||||
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
||||
case $f in
|
||||
*.deprecated)
|
||||
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*} 0644
|
||||
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*}"
|
||||
;;
|
||||
*)
|
||||
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
||||
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
cd Macros
|
||||
|
||||
for f in macro.* ; do
|
||||
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
||||
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
||||
case $f in
|
||||
*.deprecated)
|
||||
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*} 0644
|
||||
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/deprecated/${f%.*}"
|
||||
;;
|
||||
*)
|
||||
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
||||
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
@@ -333,6 +333,38 @@ get_config() {
|
||||
g_pager="| $g_pager"
|
||||
fi
|
||||
|
||||
if [ -n "$DYNAMIC_BLACKLIST" ]; then
|
||||
case $DYNAMIC_BLACKLIST in
|
||||
[Nn]o)
|
||||
DYNAMIC_BLACKLIST='';
|
||||
;;
|
||||
[Yy]es)
|
||||
;;
|
||||
ipset|ipset::*|ipset-only|ipset-only::*|ipset,src-dst|ipset-only,src-dst::*)
|
||||
g_blacklistipset=SW_DBL$g_family
|
||||
;;
|
||||
ipset:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
ipset,src-dst:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset,src-dst:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
ipset-only:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
ipset-only,src-dst:[a-zA-Z]*)
|
||||
g_blacklistipset=${DYNAMIC_BLACKLIST#ipset-only,src-dst:}
|
||||
g_blacklistipset=${g_blacklistipset%%:*}
|
||||
;;
|
||||
*)
|
||||
fatal_error "Invalid value ($DYNAMIC_BLACKLIST) for DYNAMIC_BLACKLIST"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
lib=$(find_file lib.cli-user)
|
||||
|
||||
[ -f $lib ] && . $lib
|
||||
@@ -403,7 +435,7 @@ compiler() {
|
||||
get_config Yes
|
||||
|
||||
case $COMMAND in
|
||||
*start|try|refresh)
|
||||
*start|try|refresh|reload|restart|safe-*)
|
||||
;;
|
||||
*)
|
||||
STARTUP_LOG=
|
||||
@@ -498,7 +530,6 @@ compiler() {
|
||||
start_command() {
|
||||
local finished
|
||||
finished=0
|
||||
local object
|
||||
local rc
|
||||
rc=0
|
||||
|
||||
@@ -517,7 +548,7 @@ start_command() {
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
rc=$?
|
||||
logger -p kern.err "ERROR:$g_product start failed"
|
||||
mylogger kern.err "ERROR:$g_product start failed"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -608,7 +639,7 @@ start_command() {
|
||||
esac
|
||||
|
||||
if [ -n "${g_fast}${AUTOMAKE}" ]; then
|
||||
if ! uptodate ${VARDIR}/$object; then
|
||||
if ! uptodate ${VARDIR}/firewall; then
|
||||
g_fast=
|
||||
AUTOMAKE=
|
||||
fi
|
||||
@@ -997,7 +1028,7 @@ restart_command() {
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
rc=$?
|
||||
logger -p kern.err "ERROR:$g_product ${COMMAND} failed"
|
||||
mylogger kern.err "ERROR:$g_product ${COMMAND} failed"
|
||||
fi
|
||||
else
|
||||
[ -x ${VARDIR}/firewall ] || fatal_error "No ${VARDIR}/firewall file found"
|
||||
|
@@ -130,6 +130,18 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>logjump</option></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. Performs the same function as
|
||||
<option>nolog</option> (below), with the addition that the
|
||||
jump to the actions chain is logged if a log level is
|
||||
specified on the action invocation. For inline actions, this
|
||||
option is identical to <option>nolog</option>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>mangle</option></term>
|
||||
|
||||
|
@@ -488,6 +488,15 @@ loc eth2 -</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">nodbl</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. When specified, dynamic
|
||||
blacklisting is disabled on the interface.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">nosmurfs</emphasis></term>
|
||||
|
||||
|
@@ -390,7 +390,7 @@ DIVERTHA - - tcp</programlisting>
|
||||
<para>Allows you to place your own ip[6]tables matches at the
|
||||
end of the line following a semicolon (";"). If an
|
||||
<replaceable>action</replaceable> is specified, the compiler
|
||||
procedes as if that <replaceable>action</replaceable> had been
|
||||
proceeds as if that <replaceable>action</replaceable> had been
|
||||
specified in this column. If no action is specified, then you
|
||||
may include your own jump ("-j
|
||||
<replaceable>target</replaceable>
|
||||
|
@@ -672,11 +672,37 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">REJECT</emphasis></term>
|
||||
<term><emphasis
|
||||
role="bold">REJECT[(<replaceable>option</replaceable>)]</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>disallow the request and return an icmp-unreachable or
|
||||
an RST packet.</para>
|
||||
an RST packet. If no option is passed, Shorewall selects the
|
||||
appropriate option based on the protocol of the packet.</para>
|
||||
|
||||
<para>Beginning with Shorewall 5.0.8, the type of reject may
|
||||
be specified in the <replaceable>option</replaceable>
|
||||
paramater. Valid <replaceable>option</replaceable> values
|
||||
are:</para>
|
||||
|
||||
<simplelist>
|
||||
<member><option>icmp-net-unreachable</option></member>
|
||||
|
||||
<member><option>icmp-host-unreachable</option></member>
|
||||
|
||||
<member><option>i</option><option>cmp-port-unreachable</option></member>
|
||||
|
||||
<member><option>icmp-proto-unreachable</option></member>
|
||||
|
||||
<member><option>icmp-net-prohibited</option></member>
|
||||
|
||||
<member><option>icmp-host-prohibited</option></member>
|
||||
|
||||
<member><option>icmp-admin-prohibited</option></member>
|
||||
|
||||
<member><option>icmp-tcp-reset</option> (the PROTO column
|
||||
must specify TCP)</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -1441,7 +1467,7 @@
|
||||
<para>When <option>s:</option> or <option>d:</option> is specified,
|
||||
the rate applies per source IP address or per destination IP address
|
||||
respectively. The <replaceable>name</replaceable>s may be chosen by
|
||||
the user and specifiy a hash table to be used to count matching
|
||||
the user and specify a hash table to be used to count matching
|
||||
connections. If not given, the name <emphasis
|
||||
role="bold">shorewallN</emphasis> (where N is a unique integer) is
|
||||
assumed. Where more than one rule or POLICY specifies the same name,
|
||||
|
@@ -156,20 +156,23 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">MARK</emphasis> -
|
||||
{-|<emphasis>value</emphasis>}</term>
|
||||
{-|<replaceable>value</replaceable>[:<replaceable>priority</replaceable>]}</term>
|
||||
|
||||
<listitem>
|
||||
<para>The mark <emphasis>value</emphasis> which is an integer in the
|
||||
range 1-255. You set mark values in the <ulink
|
||||
url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5)
|
||||
file, marking the traffic you want to fit in the classes defined in
|
||||
here. Must be specified as '-' if the <emphasis
|
||||
role="bold">classify</emphasis> option is given for the interface in
|
||||
<ulink
|
||||
url="/manpages/shorewall-tcdevices.html">shorewall-tcdevices</ulink>(5)
|
||||
and you are running Shorewall 4.5.5 or earlier.</para>
|
||||
here. You can use the same marks for different interfaces.</para>
|
||||
|
||||
<para>You can use the same marks for different interfaces.</para>
|
||||
<para>The <replaceable>priority</replaceable>, if specified, is an
|
||||
integer in the range 1-65535 and determines the relative order in
|
||||
which the tc mark classification filter for this class is to be
|
||||
applied to packets being sent on the
|
||||
<replaceable>interface</replaceable>. Filters are applied in
|
||||
ascending numerical order. If not supplied, the value is derived
|
||||
from the class priority (PRIORITY column value below):
|
||||
(<replaceable>class priority</replaceable> << 8) | 20.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -293,7 +296,7 @@
|
||||
<para>This is the default class for that interface where all
|
||||
traffic should go, that is not classified otherwise.</para>
|
||||
|
||||
<para></para>
|
||||
<para/>
|
||||
|
||||
<note>
|
||||
<para>You must define <emphasis
|
||||
@@ -320,7 +323,7 @@
|
||||
priority determines the order in which filter rules are
|
||||
processed during packet classification. If not specified, the
|
||||
value (<replaceable>class priority</replaceable> << 8) |
|
||||
10) is used.</para>
|
||||
15) is used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -339,7 +342,7 @@
|
||||
(":") and a <replaceable>priority</replaceable>. This priority
|
||||
determines the order in which filter rules are processed
|
||||
during packet classification. If not specified, the value
|
||||
(<replaceable>class priority</replaceable> << 8) | 10)
|
||||
(<replaceable>class priority</replaceable> << 8) | 15)
|
||||
is used.</para>
|
||||
|
||||
<programlisting> <emphasis role="bold">tos-minimize-delay</emphasis> 0x10/0x10
|
||||
@@ -372,7 +375,7 @@
|
||||
(":") and a <replaceable>priority</replaceable>. This priority
|
||||
determines the order in which filter rules are processed
|
||||
during packet classification. If not specified, the value
|
||||
(<replaceable>class priority</replaceable> << 8) | 20)
|
||||
(<replaceable>class priority</replaceable> << 8) | 10)
|
||||
is used.</para>
|
||||
|
||||
<note>
|
||||
|
@@ -761,15 +761,38 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">DYNAMIC_BLACKLIST=</emphasis>{<emphasis
|
||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
||||
role="bold">Yes</emphasis>|<emphasis
|
||||
role="bold">No</emphasis>||<emphasis
|
||||
role="bold">ipset</emphasis>[<emphasis
|
||||
role="bold">-only</emphasis>][,<emphasis
|
||||
role="bold">src-dst</emphasis>][:[<replaceable>setname</replaceable>][:<replaceable>log_level</replaceable>|:l<replaceable>og_tag</replaceable>]]]}</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.7. When set to <emphasis
|
||||
role="bold">No</emphasis> or <emphasis role="bold">no</emphasis>,
|
||||
dynamic blacklisting using the <command>shorewall drop</command>,
|
||||
<command>shorewall reject</command>, <command>shorewall
|
||||
logdrop</command> and <command>shorewall logreject</command> is
|
||||
disabled. Default is <emphasis role="bold">Yes</emphasis>.</para>
|
||||
chain-based dynamic blacklisting using the <command>shorewall6
|
||||
drop</command>, <command>shorewall6 reject</command>,
|
||||
<command>shorewall6 logdrop</command> and <command>shorewall6
|
||||
logreject</command> is disabled. Default is <emphasis
|
||||
role="bold">Yes</emphasis>. Beginning with Shorewall 5.0.8,
|
||||
ipset-based dynamic blacklisting is also supported. The name of the
|
||||
set (<replaceable>setname</replaceable>) and the level
|
||||
(<replaceable>log_level</replaceable>), if any, at which blacklisted
|
||||
traffic is to be logged may also be specified. The default set name
|
||||
is SW_DBL4 and the default log level is <option>none</option> (no
|
||||
logging). if <option>ipset-only</option> is given, then chain-based
|
||||
dynamic blacklisting is disabled just as if DYNAMIC_BLACKLISTING=No
|
||||
had been specified. Normally, only packets whose source address
|
||||
matches an entry in the ipsec are dropped. If
|
||||
<option>src-dst</option> is included, then packets whose destination
|
||||
address matches an entry in the ipset are also dropped.</para>
|
||||
|
||||
<para>When ipset-based dynamic blacklisting is enabled, the contents
|
||||
of the blacklist will be preserved over
|
||||
<command>stop</command>/<command>reboot</command>/<command>start</command>
|
||||
sequences if SAVE_IPSETS=Yes, SAVE_IPSETS=ipv4 or if
|
||||
<replaceable>setname</replaceable> is included in the list of sets
|
||||
to be saved in SAVE_IPSETS.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -824,7 +847,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
||||
packets until these packets reach the chain in which the original
|
||||
connection was accepted. So for packets going from the 'loc' zone to
|
||||
the 'net' zone, ESTABLISHED/RELATED packets are ACCEPTED in the
|
||||
'loc2net' chain.</para>
|
||||
'loc-net' or 'loc2net' chain, depending on the setting of ZONE2ZONE
|
||||
(see below).</para>
|
||||
|
||||
<para>If you set FASTACCEPT=Yes, then ESTABLISHED/RELATED packets
|
||||
are accepted early in the INPUT, FORWARD and OUTPUT chains. If you
|
||||
@@ -998,7 +1022,7 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
||||
iptables text in a rule. You may simply preface that text with a
|
||||
pair of semicolons (";;"). If alternate input is also specified in
|
||||
the rule, it should appear before the semicolons and may be
|
||||
seperated from normal column input by a single semicolon.</para>
|
||||
separated from normal column input by a single semicolon.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -1548,6 +1572,18 @@ LOG:info:,bar net fw</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">MINIUPNPD=</emphasis>[<emphasis
|
||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. If set to Yes, Shorewall will create
|
||||
a chain in the nat table named MINIUPNPD-POSTROUTING and will add
|
||||
jumps from POSTROUTING to that chain for each interface with the
|
||||
<option>upnpd</option> option specified. Default is No.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis
|
||||
role="bold">MARK_IN_FORWARD_CHAIN=</emphasis>[<emphasis
|
||||
@@ -1636,7 +1672,7 @@ LOG:info:,bar net fw</programlisting>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis
|
||||
role="bold">MODULESDIR=</emphasis>[<emphasis>pathname</emphasis>[<emphasis
|
||||
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
|
||||
role="bold">:</emphasis><emphasis>pathname</emphasis>]...]</term>
|
||||
|
||||
<listitem>
|
||||
@@ -1647,6 +1683,10 @@ LOG:info:,bar net fw</programlisting>
|
||||
where <emphasis role="bold">uname</emphasis> holds the output of
|
||||
'<command>uname -r</command>' and <emphasis
|
||||
role="bold">g_family</emphasis> holds '4'.</para>
|
||||
|
||||
<para>The option plus sign ('+') was added in Shorewall 5.0.3 and
|
||||
causes the listed pathnames to be appended to the default list
|
||||
above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -2464,9 +2504,11 @@ INLINE - - - ; -j REJECT
|
||||
<para>If specified, determines where Shorewall will log the details
|
||||
of each <emphasis role="bold">start</emphasis>, <emphasis
|
||||
role="bold">reload</emphasis>, <emphasis
|
||||
role="bold">restart</emphasis> and <emphasis
|
||||
role="bold">refresh</emphasis> command. Logging verbosity is
|
||||
determined by the setting of LOG_VERBOSITY above.</para>
|
||||
role="bold">restart</emphasis>, <emphasis
|
||||
role="bold">refresh</emphasis>, <emphasis
|
||||
role="bold">try</emphasis>, and <emphasis
|
||||
role="bold">safe-</emphasis>* command. Logging verbosity is
|
||||
determined by the setting of LOG_VERBOSITY above. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@@ -49,6 +49,19 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>blacklist</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall</command>
|
||||
|
||||
@@ -955,6 +968,25 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">blacklist</emphasis>
|
||||
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
|
||||
... ]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8 and requires
|
||||
DYNAMIC_BLACKLIST=ipset.. in <ulink
|
||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).
|
||||
Causes packets from the given host or network
|
||||
<replaceable>address</replaceable> to be dropped, based on the
|
||||
setting of BLACKLIST in <ulink
|
||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). The
|
||||
<replaceable>address</replaceable> along with any
|
||||
<replaceable>option</replaceable>s are passed to the <command>ipset
|
||||
add</command> command.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">call <replaceable>function</replaceable> [
|
||||
<replaceable>parameter</replaceable> ... ]</emphasis></term>
|
||||
@@ -2593,6 +2625,34 @@
|
||||
started.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>ENVIRONMENT</title>
|
||||
|
||||
<para>Two environmental variables are recognized by Shorewall:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>SHOREWALL_INIT_SCRIPT</term>
|
||||
|
||||
<listitem>
|
||||
<para>When set to 1, causes Std out to be redirected to the file
|
||||
specified in the STARTUP_LOG option in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>SW_LOGGERTAG</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
|
||||
value is passed to the logger utility in its -t (--tag)
|
||||
option.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>FILES</title>
|
||||
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - Essential Modules File
|
||||
# Shorewall -- /usr/share/shorewall/modules.essential
|
||||
#
|
||||
# /usr/share/shorewall/modules.essential
|
||||
# Essential Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - Extensions Modules File
|
||||
# Shorewall -- /usr/share/shorewall/modules.extensions
|
||||
#
|
||||
# /usr/share/shorewall/modules.extensions
|
||||
# Extensions Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule ipt_addrtype
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - IP Set Modules File
|
||||
# Shorewall -- /usr/share/shorewall/modules.ipset
|
||||
#
|
||||
# /usr/share/shorewall/modules.ipset
|
||||
# IP Set Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule xt_set
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - Traffic Shaping Modules File
|
||||
# Shorewall -- /usr/share/shorewall/modules.tc
|
||||
#
|
||||
# /usr/share/shorewall/modules.tc
|
||||
# Traffic Shaping Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule sch_sfq
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - Xtables Modules File
|
||||
# Shorewall -- /usr/share/shorewall/modules.xtables
|
||||
#
|
||||
# /usr/share/shorewall/modules.xtables
|
||||
# Xtables Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule xt_AUDIT
|
||||
|
@@ -1 +0,0 @@
|
||||
This is the Shorewall6-lite stable 4.4 branch of Git.
|
@@ -47,6 +47,19 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>blacklist</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
@@ -670,6 +683,25 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">blacklist</emphasis>
|
||||
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
|
||||
... ]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8 and requires
|
||||
DYNAMIC_BLACKLIST=ipset.. in <ulink
|
||||
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
|
||||
Causes packets from the given host or network
|
||||
<replaceable>address</replaceable> to be dropped, based on the
|
||||
setting of BLACKLIST in <ulink
|
||||
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
|
||||
The <replaceable>address</replaceable> along with any
|
||||
<replaceable>option</replaceable>s are passed to the <command>ipset
|
||||
add</command> command.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">call <replaceable>function</replaceable> [
|
||||
<replaceable>parameter</replaceable> ... ]</emphasis></term>
|
||||
@@ -1515,6 +1547,35 @@
|
||||
started.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>ENVIRONMENT</title>
|
||||
|
||||
<para>Two environmental variables are recognized by
|
||||
Shorewall6-lite:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>SHOREWALL_INIT_SCRIPT</term>
|
||||
|
||||
<listitem>
|
||||
<para>When set to 1, causes Std out to be redirected to the file
|
||||
specified in the STARTUP_LOG option in <ulink
|
||||
url="shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>SW_LOGGERTAG</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
|
||||
value is passed to the logger utility in its -t (--tag)
|
||||
option.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See ALSO</title>
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
This is the Shorewall6 stable 4.4 branch of Git.
|
@@ -1,13 +1,11 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Audited AllowICMPs Action
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.A_AllowICMPs
|
||||
#
|
||||
# /usr/share/shorewall6/action.A_AllowICMPs
|
||||
#
|
||||
# This action A_ACCEPTs needed ICMP types
|
||||
# This action A_ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DEST
|
||||
# PORT(S)
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
?comment Needed ICMP types (RFC4890)
|
||||
|
||||
A_ACCEPT - - ipv6-icmp destination-unreachable
|
||||
|
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Audited Drop Action
|
||||
#
|
||||
# /usr/share/shorewall6/action.ADrop
|
||||
#
|
||||
# The Audited default DROP common rules
|
||||
#
|
||||
# This action is invoked before a DROP policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that 'auth' requests are rejected, even if the policy is
|
||||
# DROP. Otherwise, you may experience problems establishing
|
||||
# connections with servers that use auth.
|
||||
# c) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
# Reject 'auth'
|
||||
#
|
||||
Auth(A_REJECT)
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
A_AllowICMPs - - ipv6-icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
dropBcast(audit)
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log.
|
||||
#
|
||||
dropInvalid(audit)
|
||||
#
|
||||
# Drop Microsoft noise so that it doesn't clutter up the log.
|
||||
#
|
||||
SMB(A_DROP)
|
||||
#
|
||||
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
||||
#
|
||||
dropNotSyn(audit) - - tcp
|
||||
#
|
||||
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
|
||||
# the log.
|
||||
#
|
||||
A_DropDNSrep
|
@@ -1,50 +0,0 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Audited Reject Action
|
||||
#
|
||||
# /usr/share/shorewall6/action.A_Reject
|
||||
#
|
||||
# The audited default REJECT action common rules
|
||||
#
|
||||
# This action is invoked before a REJECT policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO
|
||||
#
|
||||
# Don't log 'auth' -- REJECT
|
||||
#
|
||||
Auth(A_REJECT)
|
||||
#
|
||||
# Drop Multicasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
A_AllowICMPs - - ipv6-icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
dropBcast(audit)
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log (these ICMPs cannot be
|
||||
# rejected).
|
||||
#
|
||||
dropInvalid(audit)
|
||||
#
|
||||
# Reject Microsoft noise so that it doesn't clutter up the log.
|
||||
#
|
||||
SMB(A_REJECT)
|
||||
#
|
||||
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
||||
#
|
||||
dropNotSyn(audit) - - tcp
|
||||
#
|
||||
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
|
||||
# the log.
|
||||
#
|
||||
A_DropDNSrep
|
@@ -1,13 +1,10 @@
|
||||
#
|
||||
# Shorewall6 version 5 - AllowICMPs Action
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.AllowICMPs
|
||||
#
|
||||
# /usr/share/shorewall6/action.AllowICMPs
|
||||
#
|
||||
# This action ACCEPTs needed ICMP types
|
||||
# This action ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DEST
|
||||
# PORT(S)
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
DEFAULTS ACCEPT
|
||||
|
||||
|
@@ -1,32 +1,32 @@
|
||||
#
|
||||
# Shorewall 4 - Multicast/Anycast Action
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.Broadcast
|
||||
#
|
||||
# /usr/share/shorewall/action.Broadcast
|
||||
# Multicast/Anycast IPv6 Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Broadcast[([<action>|-[,{audit|-}])]
|
||||
# Broadcast[([<action>|-[,{audit|-}])]
|
||||
#
|
||||
# Default action is DROP
|
||||
# Default action is DROP
|
||||
#
|
||||
##########################################################################################
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
|
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Drop Action
|
||||
#
|
||||
# /usr/share/shorewall6/action.Drop
|
||||
#
|
||||
# The default DROP common rules
|
||||
#
|
||||
# This action is invoked before a DROP policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that 'auth' requests are rejected, even if the policy is
|
||||
# DROP. Otherwise, you may experience problems establishing
|
||||
# connections with servers that use auth.
|
||||
# c) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# The action accepts five optional parameters:
|
||||
#
|
||||
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
|
||||
# actions.
|
||||
# 2 - Action to take with Auth requests. Default is REJECT or A_REJECT,
|
||||
# depending on the setting of the first parameter.
|
||||
# 3 - Action to take with SMB requests. Default is DROP or A_DROP,
|
||||
# depending on the setting of the first parameter.
|
||||
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
|
||||
# A_ACCEPT depending on the first parameter.
|
||||
# 5 - Action to take with late UDP replies (UDP source port 53). Default
|
||||
# is DROP or A_DROP depending on the first parameter.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
?if passed($1)
|
||||
?if $1 eq 'audit'
|
||||
DEFAULTS -,A_REJECT,A_DROP,A_ACCEPT,A_DROP
|
||||
?else
|
||||
?error The first parameter to Drop must be 'audit' or '-'
|
||||
?endif
|
||||
?else
|
||||
DEFAULTS -,REJECT,DROP,ACCEPT,DROP
|
||||
?endif
|
||||
|
||||
#TARGET SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
# Reject 'auth'
|
||||
#
|
||||
?if passed($2)
|
||||
Auth($2)
|
||||
?endif
|
||||
#
|
||||
# ACCEPT critical ICMP types
|
||||
#
|
||||
AllowICMPs($4) - - ipv6-icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
Broadcast(DROP,$1)
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log.
|
||||
#
|
||||
Invalid(DROP,$1)
|
||||
#
|
||||
# Drop Microsoft noise so that it doesn't clutter up the log.
|
||||
#
|
||||
SMB($3)
|
||||
#
|
||||
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
||||
#
|
||||
NotSyn(DROP,$1) - - tcp
|
||||
#
|
||||
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
|
||||
# the log.
|
||||
#
|
||||
DropDNSrep($5)
|
@@ -1,76 +0,0 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Reject Action
|
||||
#
|
||||
# /usr/share/shorewall6/action.Reject
|
||||
#
|
||||
# The default REJECT action common rules
|
||||
#
|
||||
# This action is invoked before a REJECT policy is enforced. The purpose
|
||||
# of the action is:
|
||||
#
|
||||
# a) Avoid logging lots of useless cruft.
|
||||
# b) Ensure that certain ICMP packets that are necessary for successful
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# The action accepts five optional parameters:
|
||||
#
|
||||
# 1 - 'audit' or '-'. Default is '-' which means don't audit in builtin
|
||||
# actions.
|
||||
# 2 - Action to take with Auth requests. Default is REJECT or A_REJECT,
|
||||
# depending on the setting of the first parameter.
|
||||
# 3 - Action to take with SMB requests. Default is REJECT or A_REJECT,
|
||||
# depending on the setting of the first parameter.
|
||||
# 4 - Action to take with required ICMP packets. Default is ACCEPT or
|
||||
# A_ACCEPT depending on the first parameter.
|
||||
# 5 - Action to take with late UDP replies (UDP source port 53). Default
|
||||
# is DROP or A_DROP depending on the first parameter.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
###############################################################################
|
||||
|
||||
?if passed(@1)
|
||||
?if @1 eq 'audit'
|
||||
DEFAULTS -,A_REJECT,A_REJECT,A_ACCEPT,A_DROP
|
||||
?else
|
||||
?error The first parameter to Reject must be 'audit' or '-'
|
||||
?endif
|
||||
?else
|
||||
DEFAULTS -,REJECT,REJECT,ACCEPT,DROP
|
||||
?endif
|
||||
|
||||
#TARGET SOURCE DEST PROTO
|
||||
#
|
||||
# Don't log 'auth' -- REJECT
|
||||
#
|
||||
?if passed($2)
|
||||
Auth($2)
|
||||
?endif
|
||||
#
|
||||
# Drop Multicasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
AllowICMPs($4) - - ipv6-icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
#
|
||||
Broadcast(DROP,$1)
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log (these ICMPs cannot be
|
||||
# rejected).
|
||||
#
|
||||
Invalid(DROP,$1)
|
||||
#
|
||||
# Reject Microsoft noise so that it doesn't clutter up the log.
|
||||
#
|
||||
SMB($3)
|
||||
#
|
||||
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
||||
#
|
||||
NotSyn(DROP,$1) - - tcp
|
||||
#
|
||||
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
|
||||
# the log.
|
||||
#
|
||||
DropDNSrep($5)
|
@@ -1,20 +1,17 @@
|
||||
#
|
||||
# Shorewall version 5 - Mangle Action Template
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.mangletemplate
|
||||
#
|
||||
# /etc/shorewall6/action.mangletemplate
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined with the mangle option in /etc/shorewall/actions.
|
||||
#
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined with the mangle option in /etc/shorewall/actions.
|
||||
# To define a new action:
|
||||
#
|
||||
# To define a new action:
|
||||
# 1. Add the <action name> to /etc/shorewall6/actions with the mangle option
|
||||
# 2. Copy this file to /etc/shorewall6/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
#
|
||||
# 1. Add the <action name> to /etc/shorewall6/actions with the mangle option
|
||||
# 2. Copy this file to /etc/shorewall6/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
#
|
||||
# Please see http://shorewall.net/Actions.html for additional
|
||||
# information.
|
||||
# Please see http://shorewall.net/Actions.html for additional information.
|
||||
#
|
||||
# Columns are the same as in /etc/shorewall6/mangle.
|
||||
#
|
||||
|
@@ -1,25 +1,21 @@
|
||||
#
|
||||
# Shorewall version 5 - Action Template
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.template
|
||||
#
|
||||
# /etc/shorewall6/action.template
|
||||
# Action Template
|
||||
#
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined in /etc/shorewall/actions.
|
||||
# This file is a template for files with names of the form
|
||||
# /etc/shorewall/action.<action-name> where <action> is an
|
||||
# ACTION defined in /etc/shorewall/actions.
|
||||
#
|
||||
# To define a new action:
|
||||
# To define a new action:
|
||||
#
|
||||
# 1. Add the <action name> to /etc/shorewall/actions
|
||||
# 2. Copy this file to /etc/shorewall/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
# 1. Add the <action name> to /etc/shorewall/actions
|
||||
# 2. Copy this file to /etc/shorewall/action.<action name>
|
||||
# 3. Add the desired rules to that file.
|
||||
#
|
||||
# Please see http://shorewall.net/Actions.html for additional
|
||||
# information.
|
||||
# Please see http://shorewall.net/Actions.html for additional information.
|
||||
#
|
||||
# Columns are the same as in /etc/shorewall6/rules.
|
||||
#
|
||||
#######################################################################################################
|
||||
# DO NOT REMOVE THE FOLLOWING LINE
|
||||
#####################################################################################################################################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||
# PORT PORT(S) DEST LIMIT GROUP
|
||||
##############################################################################################################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER MARK CONNLIMIT TIME HEADERS SWITCH HELPER
|
||||
|
@@ -1,24 +1,24 @@
|
||||
#
|
||||
# Shorewall 4.4 -- /usr/share/shorewall6/lib.base
|
||||
# Shorewall -- /usr/share/shorewall6/lib.base
|
||||
#
|
||||
# (c) 2011,2014 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This library contains the code common to all Shorewall components.
|
||||
|
||||
|
@@ -365,6 +365,15 @@ loc eth2 -</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">nodbl</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. When specified, dynamic
|
||||
blacklisting is disabled on the interface.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">optional</emphasis></term>
|
||||
|
||||
|
@@ -401,7 +401,7 @@ DIVERTHA - - tcp</programlisting>
|
||||
<para>Allows you to place your own ip[6]tables matches at the
|
||||
end of the line following a semicolon (";"). If an
|
||||
<replaceable>action</replaceable> is specified, the compiler
|
||||
procedes as if that <replaceable>action</replaceable> had been
|
||||
proceeds as if that <replaceable>action</replaceable> had been
|
||||
specified in this column. If no action is specified, then you
|
||||
may include your own jump ("-j
|
||||
<replaceable>target</replaceable>
|
||||
|
@@ -673,11 +673,37 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">REJECT</emphasis></term>
|
||||
<term><emphasis
|
||||
role="bold">REJECT[(<replaceable>option</replaceable>)]</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>disallow the request and return an icmp-unreachable or
|
||||
an RST packet.</para>
|
||||
an RST packet. If no option is passed, Shorewall selects the
|
||||
appropriate option based on the protocol of the packet.</para>
|
||||
|
||||
<para>Beginning with Shorewall 5.0.8, the type of reject may
|
||||
be specified in the <replaceable>option</replaceable>
|
||||
paramater. Valid <replaceable>option</replaceable> values
|
||||
are:</para>
|
||||
|
||||
<simplelist>
|
||||
<member><option>icmp6-no-route</option></member>
|
||||
|
||||
<member><option>no-route</option></member>
|
||||
|
||||
<member><option>i</option><option>cmp6-adm-prohibited</option></member>
|
||||
|
||||
<member><option>adm-prohibited</option></member>
|
||||
|
||||
<member><option>icmp6-addr-unreachable</option></member>
|
||||
|
||||
<member><option>addr-unreach</option></member>
|
||||
|
||||
<member><option>icmp6-port-unreachable</option></member>
|
||||
|
||||
<member><option>tcp-reset</option> (the PROTO column must
|
||||
specify TCP)</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -1306,7 +1332,7 @@
|
||||
<para>When <option>s:</option> or <option>d:</option> is specified,
|
||||
the rate applies per source IP address or per destination IP address
|
||||
respectively. The <replaceable>name</replaceable>s may be chosen by
|
||||
the user and specifiy a hash table to be used to count matching
|
||||
the user and specify a hash table to be used to count matching
|
||||
connections. If not given, the name <emphasis
|
||||
role="bold">shorewallN</emphasis> (where N is a unique integer) is
|
||||
assumed. Where more than one rule or POLICY specifies the same name,
|
||||
|
@@ -152,20 +152,23 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">MARK</emphasis> -
|
||||
{-|<emphasis>value</emphasis>}</term>
|
||||
{-|<replaceable>value</replaceable>[:<replaceable>priority</replaceable>]}</term>
|
||||
|
||||
<listitem>
|
||||
<para>The mark <emphasis>value</emphasis> which is an integer in the
|
||||
range 1-255. You set mark values in the <ulink
|
||||
url="/manpages6/shorewall6-mangle.html">shorewall6-mangle</ulink>(5)
|
||||
url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(5)
|
||||
file, marking the traffic you want to fit in the classes defined in
|
||||
here. Must be specified as '-' if the <emphasis
|
||||
role="bold">classify</emphasis> option is given for the interface in
|
||||
<ulink
|
||||
url="/manpages6/shorewall6-tcdevices.html">shorewall6-tcdevices</ulink>(5)
|
||||
and you are running Shorewall 4.5 5 or earlier.</para>
|
||||
here. You can use the same marks for different interfaces.</para>
|
||||
|
||||
<para>You can use the same marks for different interfaces.</para>
|
||||
<para>The <replaceable>priority</replaceable>, if specified, is an
|
||||
integer in the range 1-65535 and determines the relative order in
|
||||
which the tc mark classification filter for this class is to be
|
||||
applied to packets being sent on the
|
||||
<replaceable>interface</replaceable>. Filters are applied in
|
||||
ascending numerical order. If not supplied, the value is derived
|
||||
from the class priority (PRIORITY column value below):
|
||||
(<replaceable>class priority</replaceable> << 8) | 20.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -314,7 +317,7 @@
|
||||
priority determines the order in which filter rules are
|
||||
processed during packet classification. If not specified, the
|
||||
value (<replaceable>class priority</replaceable> << 8) |
|
||||
10) is used.</para>
|
||||
15) is used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -366,7 +369,7 @@
|
||||
(":") and a <replaceable>priority</replaceable>. This priority
|
||||
determines the order in which filter rules are processed
|
||||
during packet classification. If not specified, the value
|
||||
(<replaceable>class priority</replaceable> << 8) | 20)
|
||||
(<replaceable>class priority</replaceable> << 8) | 10)
|
||||
is used.</para>
|
||||
|
||||
<note>
|
||||
|
@@ -623,15 +623,38 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">DYNAMIC_BLACKLIST=</emphasis>{<emphasis
|
||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
||||
role="bold">Yes</emphasis>|<emphasis
|
||||
role="bold">No</emphasis>||<emphasis
|
||||
role="bold">ipset</emphasis>[<emphasis
|
||||
role="bold">-only</emphasis>][,<emphasis
|
||||
role="bold">src-dst</emphasis>][:[<replaceable>setname</replaceable>][:<replaceable>log_level</replaceable>|:l<replaceable>og_tag</replaceable>]]]}</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.7. When set to <emphasis
|
||||
role="bold">No</emphasis> or <emphasis role="bold">no</emphasis>,
|
||||
dynamic blacklisting using the <command>shorewall6 drop</command>,
|
||||
<command>shorewall6 reject</command>, <command>shorewall6
|
||||
logdrop</command> and <command>shorewall6 logreject</command> is
|
||||
disabled. Default is <emphasis role="bold">Yes</emphasis>.</para>
|
||||
chain-based dynamic blacklisting using the <command>shorewall6
|
||||
drop</command>, <command>shorewall6 reject</command>,
|
||||
<command>shorewall6 logdrop</command> and <command>shorewall6
|
||||
logreject</command> is disabled. Default is <emphasis
|
||||
role="bold">Yes</emphasis>. Beginning with Shorewall 5.0.8,
|
||||
ipset-based dynamic blacklisting is also supported. The name of the
|
||||
set (<replaceable>setname</replaceable>) and the level
|
||||
(<replaceable>log_level</replaceable>), if any, at which blacklisted
|
||||
traffic is to be logged may also be specified. The default set name
|
||||
is SW_DBL6 and the default log level is <option>none</option> (no
|
||||
logging). if <option>ipset-only</option> is given, then chain-based
|
||||
dynamic blacklisting is disabled just as if DYNAMIC_BLACKLISTING=No
|
||||
had been specified. Normally, only packets whose source address
|
||||
matches an entry in the ipsec are dropped. If
|
||||
<option>src-dst</option> is included, then packets whose destination
|
||||
address matches an entry in the ipset are also dropped.</para>
|
||||
|
||||
<para>When ipset-based dynamic blacklisting is enabled, the contents
|
||||
of the blacklist will be preserved over
|
||||
<command>stop</command>/<command>reboot</command>/<command>start</command>
|
||||
sequences if SAVE_IPSETS=Yes or if
|
||||
<replaceable>setname</replaceable> is included in the list of sets
|
||||
to be saved in SAVE_IPSETS.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -686,7 +709,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
||||
packets until these packets reach the chain in which the original
|
||||
connection was accepted. So for packets going from the 'loc' zone to
|
||||
the 'net' zone, ESTABLISHED/RELATED packets are ACCEPTED in the
|
||||
'loc2net' chain.</para>
|
||||
'loc-net' or 'loc2net' chain, depending on the setting of ZONE2ZONE
|
||||
(see below).</para>
|
||||
|
||||
<para>If you set FASTACCEPT=Yes, then ESTABLISHED/RELATED packets
|
||||
are accepted early in the INPUT, FORWARD and OUTPUT chains. If you
|
||||
@@ -846,7 +870,7 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
||||
iptables text in a rule. You may simply preface that text with a
|
||||
pair of semicolons (";;"). If alternate input is also specified in
|
||||
the rule, it should appear before the semicolons and may be
|
||||
seperated from normal column input by a single semicolon.</para>
|
||||
separated from normal column input by a single semicolon.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -1436,7 +1460,7 @@ LOG:info:,bar net fw</programlisting>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis
|
||||
role="bold">MODULESDIR=</emphasis>[<emphasis>pathname</emphasis>[<emphasis
|
||||
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
|
||||
role="bold">:</emphasis><emphasis>pathname</emphasis>]...]</term>
|
||||
|
||||
<listitem>
|
||||
@@ -1447,6 +1471,10 @@ LOG:info:,bar net fw</programlisting>
|
||||
where <emphasis role="bold">uname</emphasis> holds the output of
|
||||
'<command>uname -r</command>' and <emphasis
|
||||
role="bold">g_family</emphasis> holds '6'.</para>
|
||||
|
||||
<para>The option plus sign ('+') was added in Shorewall 5.0.3 and
|
||||
causes the listed pathnames to be appended to the default list
|
||||
above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -2111,11 +2139,13 @@ INLINE - - - ; -j REJECT
|
||||
role="bold">STARTUP_LOG=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
||||
|
||||
<listitem>
|
||||
<para>If specified, determines where Shorewall6 will log the details
|
||||
<para>If specified, determines where Shorewall will log the details
|
||||
of each <emphasis role="bold">start</emphasis>, <emphasis
|
||||
role="bold">reload</emphasis>, <emphasis
|
||||
role="bold">restart</emphasis> and <emphasis
|
||||
role="bold">refresh</emphasis> command. Logging verbosity is
|
||||
role="bold">restart</emphasis>, <emphasis
|
||||
role="bold">refresh</emphasis>, <emphasis
|
||||
role="bold">try</emphasis>, and <emphasis
|
||||
role="bold">safe-</emphasis>* command. Logging verbosity is
|
||||
determined by the setting of LOG_VERBOSITY above.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -48,6 +48,19 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>blacklist</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6</command>
|
||||
|
||||
@@ -923,6 +936,25 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">blacklist</emphasis>
|
||||
<replaceable>address</replaceable> [ <replaceable>option</replaceable>
|
||||
... ]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8 and requires
|
||||
DYNAMIC_BLACKLIST=ipset.. in <ulink
|
||||
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
|
||||
Causes packets from the given host or network
|
||||
<replaceable>address</replaceable> to be dropped, based on the
|
||||
setting of BLACKLIST in <ulink
|
||||
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
|
||||
The <replaceable>address</replaceable> along with any
|
||||
<replaceable>option</replaceable>s are passed to the <command>ipset
|
||||
add</command> command.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">call <replaceable>function</replaceable> [
|
||||
<replaceable>parameter</replaceable> ... ]</emphasis></term>
|
||||
@@ -2469,6 +2501,34 @@
|
||||
started.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>ENVIRONMENT</title>
|
||||
|
||||
<para>Two environmental variables are recognized by Shorewall6:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>SHOREWALL_INIT_SCRIPT</term>
|
||||
|
||||
<listitem>
|
||||
<para>When set to 1, causes Std out to be redirected to the file
|
||||
specified in the STARTUP_LOG option in <ulink
|
||||
url="shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>SW_LOGGERTAG</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.0.8. When set to a non-empty value, that
|
||||
value is passed to the logger utility in its -t (--tag)
|
||||
option.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See ALSO</title>
|
||||
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Essential Modules File
|
||||
# Shorewall6 -- /usr/share/shorewall6/modules.essential
|
||||
#
|
||||
# /usr/share/shorewall6/modules.essential
|
||||
# Essential Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule nfnetlink
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Extensions Modules File
|
||||
# Shorewall6 -- /usr/share/shorewall6/modules.extension
|
||||
#
|
||||
# /usr/share/shorewall6/modules.extension
|
||||
# Extensions Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule ip6_queue
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall version 5 - IP Set Modules File
|
||||
# Shorewall6 -- /usr/share/shorewall6/modules.ipset
|
||||
#
|
||||
# /usr/share/shorewall6/modules.ipset
|
||||
# IP Set Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall6 and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall6 and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule xt_set
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Traffic Shaping Modules File
|
||||
# Shorewall6 -- /usr/share/shorewall6/modules.tc
|
||||
#
|
||||
# /usr/share/shorewall6/modules.tc
|
||||
# Traffic Shaping Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule sch_sfq
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Shorewall6 version 5 - Xtables Modules File
|
||||
# Shorewall6 -- /usr/share/shorewall6/modules.xtables
|
||||
#
|
||||
# /usr/share/shorewall6/modules.xtables
|
||||
# Xtables Modules File
|
||||
#
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
# This file loads the modules that may be needed by the firewall.
|
||||
#
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
|
||||
# dependency order. i.e., if M2 depends on M1 then you must load M1
|
||||
# before you load M2.
|
||||
#
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
# If you need to modify this file, copy it to /etc/shorewall and modify the
|
||||
# copy.
|
||||
#
|
||||
###############################################################################
|
||||
loadmodule xt_AUDIT
|
||||
|
@@ -202,23 +202,6 @@
|
||||
Shorewall with some notable exceptions:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>No NAT</term>
|
||||
|
||||
<listitem>
|
||||
<para>In Shorewall6, there is no NAT of any kind (Netfilter6 doesn't
|
||||
support any form of NAT). Most people consider this to be a giant
|
||||
step forward.</para>
|
||||
|
||||
<para>When an ISP assigns you an IPv6 address, you are actually
|
||||
assigned an IPv6 <firstterm>prefix</firstterm> (similar to a
|
||||
subnet). A 64-bit prefix defines a subnet with 4 billion hosts
|
||||
squared (the size of the IPv4 address space squared). Regardless of
|
||||
the length of your prefix, you get to assign local addresses within
|
||||
that prefix.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Default Zone Type</term>
|
||||
|
||||
|
@@ -331,7 +331,7 @@ shorewall start</programlisting>
|
||||
in /etc/shorewall6/proxyndp is required:</para>
|
||||
|
||||
<programlisting>#ADDRESS INTERFACE EXTERNAL HAVEROUTE PERSISTENT
|
||||
2001:470:b:227::44 - eth1 Yes</programlisting>
|
||||
2001:470:b:227::44 - eth1 Yes</programlisting>
|
||||
|
||||
<para>A practical application is shown in the Linux <ulink
|
||||
url="Vserver.html#NDP">Vserver article</ulink>.</para>
|
||||
|
@@ -1739,7 +1739,7 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-accounting.html">shorewall-blacklist</ulink>
|
||||
url="manpages/shorewall-blrules.html">shorewall-blrules</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
@@ -1747,6 +1747,12 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
<para><ulink url="Macros.html">Macro</ulink> files</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-mangle.html">shorewall-mangle</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-nat.html">shorewall-nat</ulink>(5)</para>
|
||||
@@ -1756,17 +1762,6 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
<para><ulink
|
||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink url="manpages/shorewall-tos.html">shorewall-tos</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>They may also appear in the ORIGDEST column of:</para>
|
||||
@@ -1830,7 +1825,7 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-accounting.html">shorewall-blacklist</ulink>
|
||||
url="manpages/shorewall-blrules.html">shorewall-blrules</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
@@ -1838,6 +1833,12 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
<para><ulink url="Macros.html">Macro</ulink> files</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-mangle.html">shorewall-mangle</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-nat.html">shorewall-nat</ulink>(5) (As a
|
||||
@@ -1846,18 +1847,13 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
||||
url="manpages/shorewall-routes.html">shorewall-routes</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink url="manpages/shorewall-tos.html">shorewall-tos</ulink>
|
||||
(5)</para>
|
||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
@@ -2227,6 +2223,20 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
|
||||
<programlisting> ERROR: Invalid value for Bricks (2000) /usr/share/shorewall/action.GlusterFS (line 15)
|
||||
from /etc/shorewall/rules (line 45)</programlisting>
|
||||
|
||||
<para>In Shorewall 5.0.8, ?WARNING and ?INFO directives were added.</para>
|
||||
|
||||
<programlisting>?WARNING <replaceable>message</replaceable>
|
||||
?INFO <replaceable>message</replaceable></programlisting>
|
||||
|
||||
<para>?WARNING message produces a standard Shorewall WARNING: message,
|
||||
while ?INFO produces a similar message which is prefaced by INFO: rather
|
||||
than WARNING:. Both write the message to STDERR. The message is also
|
||||
written to the STARTUP_LOG, if any, provided that the command is
|
||||
<command>start</command>, <command>try</command>,
|
||||
<command>restart</command>, <command>reload</command>,
|
||||
<command>refresh</command>, or one of the <command>safe</command>-*
|
||||
commands.</para>
|
||||
</section>
|
||||
|
||||
<section id="Embedded">
|
||||
|
@@ -109,8 +109,8 @@
|
||||
|
||||
<listitem>
|
||||
<para>In the event that the subnet address might change while
|
||||
Shorewall is started, you need to arrange for a <quote>shorewall
|
||||
refresh</quote> command to be executed when a new dynamic IP address
|
||||
Shorewall is started, you need to arrange for a <command>shorewall
|
||||
reload</command> command to be executed when a new dynamic IP address
|
||||
gets assigned to the interface. Check your DHCP client's
|
||||
documentation.</para>
|
||||
</listitem>
|
||||
|
@@ -85,7 +85,7 @@
|
||||
problem reporting process. It will ensure that you provide us with the
|
||||
information we need to solve your problem as quickly as possible.</para>
|
||||
|
||||
<graphic align="center" fileref="images/Troubleshoot.png" />
|
||||
<graphic align="center" fileref="images/Troubleshoot.png"/>
|
||||
|
||||
<orderedlist>
|
||||
<important>
|
||||
@@ -126,12 +126,10 @@
|
||||
|
||||
<para>If that didn't solve your problem, then please</para>
|
||||
|
||||
<programlisting><command>/sbin/shorewall trace start 2> /tmp/trace</command></programlisting>
|
||||
<programlisting><command>/sbin/shorewall trace start > /tmp/trace 2>&1</command></programlisting>
|
||||
|
||||
<para>Forward the <filename>/tmp/trace</filename> file as an
|
||||
attachment compressed with gzip or bzip2 (If you are running
|
||||
Shorewall-perl, there is no need to compress the file — it will be
|
||||
very short).</para>
|
||||
attachment compressed with gzip or bzip2.</para>
|
||||
|
||||
<para>If compilation succeeds but the compiled program fails, then
|
||||
please include the compiled program with your report. The compiled
|
||||
@@ -203,7 +201,7 @@
|
||||
message produced by Shorewall is "done.":</para>
|
||||
|
||||
<blockquote>
|
||||
<para></para>
|
||||
<para/>
|
||||
|
||||
<programlisting>…
|
||||
Activating Rules...
|
||||
|
Reference in New Issue
Block a user