2011-10-03 03:41:58 +02:00
|
|
|
#
|
2015-07-28 19:59:11 +02:00
|
|
|
# Shorewall version 5 - Drop TCPFlags Action
|
2011-10-03 03:41:58 +02:00
|
|
|
#
|
2012-11-01 15:20:50 +01:00
|
|
|
# /usr/share/shorewall/action.TCPFlags
|
2011-10-03 03:41:58 +02:00
|
|
|
#
|
2011-10-05 18:32:26 +02:00
|
|
|
# Accepts a single optional parameter:
|
2011-10-03 03:41:58 +02:00
|
|
|
#
|
|
|
|
# - = Do not Audit
|
2011-10-05 18:32:26 +02:00
|
|
|
# audit = Audit dropped packets.
|
2011-10-03 03:41:58 +02:00
|
|
|
#
|
|
|
|
#################################################################################
|
|
|
|
|
2013-02-09 00:39:04 +01:00
|
|
|
DEFAULTS -
|
2011-10-03 03:41:58 +02:00
|
|
|
|
2013-06-20 19:39:39 +02:00
|
|
|
?begin perl;
|
2011-10-05 18:32:26 +02:00
|
|
|
use strict;
|
2011-10-03 03:41:58 +02:00
|
|
|
use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6);
|
|
|
|
use Shorewall::Chains;
|
2013-02-02 00:55:39 +01:00
|
|
|
use Shorewall::Rules;
|
2011-10-03 03:41:58 +02:00
|
|
|
|
2013-02-09 00:39:04 +01:00
|
|
|
my $action = 'DROP';
|
2011-10-03 03:41:58 +02:00
|
|
|
|
2013-02-09 00:39:04 +01:00
|
|
|
my ( $audit ) = get_action_params( 1 );
|
2012-11-29 00:03:08 +01:00
|
|
|
|
2013-02-02 00:55:39 +01:00
|
|
|
if ( supplied $audit ) {
|
2013-02-02 18:32:57 +01:00
|
|
|
fatal_error "Invalid parameter ($audit) to action TCPFlags" if $audit ne 'audit';
|
2013-02-09 00:39:04 +01:00
|
|
|
$action = "A_DROP";
|
2013-02-02 00:55:39 +01:00
|
|
|
}
|
2011-10-03 03:41:58 +02:00
|
|
|
|
2013-02-02 00:55:39 +01:00
|
|
|
perl_action_tcp_helper( $action, '-p tcp --tcp-flags ALL FIN,URG,PSH' );
|
2013-02-09 00:39:04 +01:00
|
|
|
perl_action_tcp_helper( $action, '-p tcp --tcp-flags ALL NONE' );
|
2013-02-02 00:55:39 +01:00
|
|
|
perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,RST SYN,RST' );
|
|
|
|
perl_action_tcp_helper( $action, '-p tcp --tcp-flags SYN,FIN SYN,FIN' );
|
|
|
|
perl_action_tcp_helper( $action, '-p tcp --syn --sport 0' );
|
2011-10-03 03:41:58 +02:00
|
|
|
|
2013-06-20 19:39:39 +02:00
|
|
|
?end perl;
|
2011-10-03 03:41:58 +02:00
|
|
|
|
|
|
|
|
2012-04-24 23:52:57 +02:00
|
|
|
|
2011-10-03 03:41:58 +02:00
|
|
|
|
|
|
|
|