2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Shorewall version 4 - Drop Action
|
|
|
|
#
|
|
|
|
# /usr/share/shorewall/action.Drop
|
|
|
|
#
|
2010-07-14 15:27:27 +02:00
|
|
|
# The default DROP common rules
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2011-06-11 23:58:54 +02:00
|
|
|
# The action accepts three 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.
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
|
|
|
#
|
|
|
|
###############################################################################
|
2011-06-11 17:34:37 +02:00
|
|
|
FORMAT 2
|
2011-06-11 23:58:54 +02:00
|
|
|
#
|
|
|
|
# The following magic provides different defaults for $2 and $3, when $1 is
|
|
|
|
# 'audit'.
|
|
|
|
#
|
2011-06-11 17:34:37 +02:00
|
|
|
BEGIN PERL
|
|
|
|
use Shorewall::Config;
|
|
|
|
|
2011-06-22 15:53:15 +02:00
|
|
|
my ($p1, $p2, $p3 ) = get_action_params(1, 2, 3);
|
2011-06-11 17:34:37 +02:00
|
|
|
|
|
|
|
if ( defined $p1 && $p1 eq 'audit' ) {
|
2011-06-11 23:58:54 +02:00
|
|
|
set_action_param( 2, 'A_REJECT') unless defined $p2;
|
|
|
|
set_action_param( 3, 'A_DROP') unless defined $p3;
|
2011-06-11 17:34:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
END PERL
|
|
|
|
|
2011-06-11 23:58:54 +02:00
|
|
|
DEFAULTS -,REJECT,DROP
|
2011-06-11 17:34:37 +02:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#TARGET SOURCE DEST PROTO DPORT SPORT
|
|
|
|
#
|
2009-01-28 20:49:12 +01:00
|
|
|
# Count packets that come through here
|
|
|
|
#
|
|
|
|
COUNT
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Reject 'auth'
|
|
|
|
#
|
2011-06-11 23:58:54 +02:00
|
|
|
Auth($2)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Don't log broadcasts
|
|
|
|
#
|
2011-06-11 17:34:37 +02:00
|
|
|
dropBcast($1)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# ACCEPT critical ICMP types
|
|
|
|
#
|
2011-06-11 17:34:37 +02:00
|
|
|
AllowICMPs($1) - - icmp
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
|
|
|
# and just confuse people when they appear in the log.
|
|
|
|
#
|
2011-06-11 17:34:37 +02:00
|
|
|
dropInvalid($1)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Drop Microsoft noise so that it doesn't clutter up the log.
|
|
|
|
#
|
2011-06-11 23:58:54 +02:00
|
|
|
SMB($3)
|
2011-06-11 17:34:37 +02:00
|
|
|
DropUPnP($1)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Drop 'newnotsyn' traffic so that it doesn't get logged.
|
|
|
|
#
|
2011-06-11 17:34:37 +02:00
|
|
|
dropNotSyn($1) - - tcp
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Drop late-arriving DNS replies. These are just a nuisance and clutter up
|
|
|
|
# the log.
|
|
|
|
#
|
2011-06-11 17:34:37 +02:00
|
|
|
DropDNSrep($1)
|