-
-
09 Mar 2010 06:58:50 UTC
- Distribution: POE-Filter-Snort
- Module version: 0.031
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (0)
- Testers (470 / 1 / 0)
- Kwalitee
Bus factor: 2- 26.26% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (4.09KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- POE
- Test::More
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
POE::Filter::Snort - a POE stream filter that parses Snort logs into hashes
SYNOPSIS
#!/usr/bin/env perl use warnings; use strict; use POE qw(Filter::Snort Wheel::FollowTail); POE::Session->create( inline_states => { _start => \&start_log, got_rec => \&display_record, }, ); POE::Kernel->run(); exit; sub start_log { $_[HEAP]->{watcher} = POE::Wheel::FollowTail->new( Filename => "/var/log/snort/alert", Filter => POE::Filter::Snort->new(), InputEvent => "got_rec", ); } sub display_record { my $rec = $_[ARG0]; print "Got a snort record:\n"; print "\tComment: $rec->{comment}\n" if exists $rec->{comment}; print "\tClass : $rec->{class}\n" if exists $rec->{class}; print "\tPrio : $rec->{priority}\n" if exists $rec->{priority}; if (exists $rec->{src_ip}) { if (exists $rec->{src_port}) { print "\tSource : $rec->{src_ip} $rec->{src_port}\n"; print "\tDest : $rec->{dst_ip} $rec->{dst_port}\n"; } else { print "\tSource : $rec->{src_ip}\n"; print "\tDest : $rec->{dst_ip}\n"; } foreach my $xref (@{$rec->{xref}}) { print "\tXref : $xref\n"; } } }
DESCRIPTION
POE::Filter::Snort parses streams containing Snort alerts. Each alert is returned as a hash containing the following fields: comment, class, priority, src_ip, dst_ip, src_port, dst_port, xref, raw.
Most fields are optional. For example, some snort alerts don't contain a source and destination IP address. Those that do aren't always accompanied by a source and destination port.
The xref field refers to an array of URLs describing the alert in more detail. It will always exist, but it may be empty if no URLs appear in snort's configuration file.
The raw field is an arrayref containing each original line of the snort alert.
SEE ALSO
Snort - "the de facto standard for intrusion detection/prevention" http://www.snort.org/
BUG TRACKER
https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=POE-Filter-Snort
REPOSITORY
http://github.com/rcaputo/poe-filter-snort http://gitorious.org/poe-filter-snort
OTHER RESOURCES
http://search.cpan.org/dist/POE-Filter-Snort/
COPYRIGHT
Copyright 2005-2010, Rocco Caputo. All rights are reserved.
POE::Filter::Snort is free software; you may use, redistribute, and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install POE::Filter::Snort, copy and paste the appropriate command in to your terminal.
cpanm POE::Filter::Snort
perl -MCPAN -e shell install POE::Filter::Snort
For more information on module installation, please visit the detailed CPAN module installation guide.