mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 23:53:30 +01:00
c68d4c6e27
Signed-off-by: Tom Eastep <teastep@shorewall.net>
42 lines
974 B
Plaintext
42 lines
974 B
Plaintext
#
|
|
# Shorewall version 4 - Drop TCPFlags Action
|
|
#
|
|
# /usr/share/shorewall/action.TCPFlags
|
|
#
|
|
# Accepts a single optional parameter:
|
|
#
|
|
# - = Do not Audit
|
|
# audit = Audit dropped packets.
|
|
#
|
|
#################################################################################
|
|
?FORMAT 2
|
|
|
|
DEFAULTS DROP,-
|
|
|
|
?BEGIN PERL;
|
|
use strict;
|
|
use Shorewall::Config qw(:DEFAULT F_IPV4 F_IPV6);
|
|
use Shorewall::Chains;
|
|
use Shorewall::Rules;
|
|
|
|
my ( $action, $audit ) = get_action_params( 2 );
|
|
|
|
my $chainref = get_action_chain;
|
|
|
|
if ( supplied $audit ) {
|
|
fatal_error "Invalid parameter ($audit) to action Invalid" if $audit ne 'audit';
|
|
$action = "A_$action";
|
|
}
|
|
|
|
perl_action_tcp_helper( $action, '-p tcp --tcp-flags ALL FIN,URG,PSH' );
|
|
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' );
|
|
|
|
?END PERL;
|
|
|
|
|
|
|
|
|
|
|