Skip to content

Instantly share code, notes, and snippets.

@jsiwek
Created August 13, 2013 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsiwek/6222106 to your computer and use it in GitHub Desktop.
Save jsiwek/6222106 to your computer and use it in GitHub Desktop.
Revision to Security Onion's method of obtaining hostname.
module SecurityOnion;
@load base/frameworks/input
export {
## Event to capture when the hostname is discovered.
global SecurityOnion::found_hostname: event(hostname: string);
## Hostname for this box.
global hostname = "";
type HostnameCmdLine: record { s: string; };
}
event SecurityOnion::hostname_line(description: Input::EventDescription, tpe: Input::Event, s: string)
{
hostname = s;
event SecurityOnion::found_hostname(hostname);
Input::remove(description$name);
}
event bro_init() &priority=5
{
Input::add_event([$source="hostname |",
$name="SO-hostname",
$reader=Input::READER_RAW,
$want_record=F,
$fields=HostnameCmdLine,
$ev=SecurityOnion::hostname_line]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment