}
### calculate the range over _both_ tcp and udp
- for my $proto qw(tcp udp) {
+ for my $proto (qw(tcp udp)) {
next unless defined $scan{$src}{$dst}{$proto};
next unless defined $scan{$src}{$dst}{$proto}{'abs_sp'};
if ($s_port > $scan{$src}{$dst}{$proto}{'abs_sp'}) {
&sys_log('shutting down psad daemons');
### must kill psadwatchd first since if not, it might try to restart
### any of the other two daemons.
- for my $pidname qw(psadwatchd kmsgsd psad) {
+ for my $pidname (qw(psadwatchd kmsgsd psad)) {
my $pidfile = $pidfiles{$pidname};
if (-e $pidfile) {
my $pid = &is_running($pidfile);
$search =~ s/^not//;
}
- for my $count_type qw/countabs countuniq
+ for my $count_type (qw/countabs countuniq
countday counthouruniq countminuniq countdayuniq
- counthour countmin countday count/ {
+ counthour countmin countday count/) {
if ($search =~ /,$count_type$/ or $search =~ /^$count_type/) {
}
}
} else {
- @tokens = qw(
+ @tokens = (qw(
timestamp
src
dst
intf
chain
log_prefix
- );
+ ));
}
return \@tokens, \@match_criteria;
sub status() {
my $rv = 0; ### assume psad is not running and test...
- for my $pidname qw(psadwatchd kmsgsd psad) {
+ for my $pidname (qw(psadwatchd kmsgsd psad)) {
my $pidfile = $pidfiles{$pidname};
if (-e $pidfile) {
my $pid = &is_running($pidfile);
my %uniq_dsts = ();
my $printed = 0;
- for my $dl qw/5 4 3 2 1/ {
+ for my $dl (qw/5 4 3 2 1/) {
SRC: for my $src (sort keys %scan) {
next SRC unless $scan_dl{$src} == $dl;
my $dl = $scan_dl{$src};
}
my $ip6_short_len = 0;
- for my $dl qw/5 4 3 2 1/ {
+ for my $dl (qw/5 4 3 2 1/) {
next unless defined $pre_sort_dl{$dl};
for my $src (sort keys %{$pre_sort_dl{$dl}}) {
}
}
- for my $dl qw/5 4 3 2 1/ {
+ for my $dl (qw/5 4 3 2 1/) {
next unless defined $pre_sort_dl{$dl};
for my $src (sort keys %{$pre_sort_dl{$dl}}) {
sub hup() {
my $rv = 0;
- for my $pidname qw(psadwatchd psad kmsgsd) {
+ for my $pidname (qw(psadwatchd psad kmsgsd)) {
my $pidfile = $pidfiles{$pidname};
my $pid = &is_running($pidfile);
if ($pid) {
}
sub make_psad_dirs() {
- for my $dir qw(
+ for my $dir (qw(
/var/lib
/var/run
- ) {
+ )) {
next if -d $dir;
mkdir $dir, 0755 or die "[*] Could not mkdir $dir: $!";
}
- for my $dir qw(
+ for my $dir (qw(
PSAD_DIR
PSAD_RUN_DIR
PSAD_FIFO_DIR
PSAD_CONF_DIR
CONF_ARCHIVE_DIR
PSAD_ERR_DIR
- ) {
+ )) {
next if -d $config{$dir};
mkdir $config{$dir}, 0500 or
die "[*] Could not mkdir $config{$dir}: $!";
"on $config{'HOSTNAME'}!",
'', $config{'EMAIL_ADDRESSES'},
$cmds{'mail'});
- for my $pidname qw(psadwatchd kmsgsd) {
+ for my $pidname (qw(psadwatchd kmsgsd)) {
my $pidfile = $pidfiles{$pidname};
my $pid = &is_running($pidfile);
if ($pid) {
}
}
- my @path = qw(
+ my @path = (qw(
/bin
/sbin
/usr/bin
/usr/sbin
/usr/local/bin
/usr/local/sbin
- );
+ ));
CMD: for my $cmd (keys %cmds) {
next CMD if defined $exceptions_hr->{$cmd};
}
sub required_vars() {
- my @required_vars = qw(
+ my @required_vars = (qw(
EMAIL_ADDRESSES CHECK_INTERVAL FW_DATA_FILE FW_ERROR_LOG
HOME_NET SNORT_SID_STR ENABLE_AUTO_IDS IGNORE_CONNTRACK_BUG_PKTS
SCAN_TIMEOUT DANGER_LEVEL1 DANGER_LEVEL2 DANGER_LEVEL3
ETC_RSYSLOG_CONF IFCFGTYPE ENABLE_WHOIS_FORCE_ASCII
ENABLE_WHOIS_FORCE_SRC_IP ENABLE_IPV6_DETECTION
PERSISTENCE_CTR_THRESHOLD MAX_SCAN_IP_PAIRS
- );
+ ));
&defined_vars(\@required_vars);
return;
}