Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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;

In reply to Basic frequency analysis of Checkpoint FW-1 rulesets by grinder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-18 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found