Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Basic frequency analysis of Checkpoint FW-1 rulesets

by grinder (Bishop)
on Feb 24, 2005 at 10:03 UTC ( #434000=snippet: print w/ replies, xml ) Need Help??

Description:

You can purchase a module from Checkpoint that will let you see how many times rules in your ruleset are triggered. The idea being that you could reorder things, or check for rules that are never matched.

If you don't want to buy the module and will settle for exporting the logfile and running the following snippet, you can get a list of rules triggered ordered by descending frequency.

The logfile is slightly odd, CSV without the commas, e.g.:

"26459" "29Feb2005" "5:34:59" "VPN-1 & FireWall-1" "eth6" "169.154.147.193" "Log" "Decrypt" "2967" "10.11.12.13" "10.20.30.40" "udp" "11" "2967" "" ""

In the above, "11" indicates that this packet was accepted by rule 11.

#! /usr/bin/perl -w

use strict;
my @header = ($_ = <>) =~ /"([^"]+)" ?/g;

my %rule;
while( <> ) {
    $rule{ (/"([^"]+)" ?/g)[12] }++;
}

print "$rule{$_}\t$_\n" for sort {$rule{$b} <=> $rule{$a}} keys %rule;

Comment on Basic frequency analysis of Checkpoint FW-1 rulesets
Download Code

Back to Snippets Section

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://434000]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-01 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (15 votes), past polls