Commit graph

311 commits

Author SHA1 Message Date
Seth Hall
ad9e2a143c Update software version parsing and comparison to account for a third numeric subversion.
- $addl is also compared numerically now if the value is actually numeric.
2013-02-06 13:59:05 -05:00
Jon Siwek
69afc4a882 Add an error for record coercions that would orphan a field.
These cases should be avoidable by fixing scripts where they occur and
they can also help catch typos that would lead to unintentional runtime
behavior.

Adding this already revealed several scripts where a field in an inlined
record was never removed after a code refactor.
2013-01-24 09:56:19 -06:00
Robin Sommer
762c034ec2 Merge remote-tracking branch 'origin/topic/bernhard/input-logging-commmon-functions'
* origin/topic/bernhard/input-logging-commmon-functions:
  add the last of Robins suggestions (separate info-struct for constructors).
  port memory leak fix from master
  harmonize function naming
  move AsciiInputOutput over to threading
  and thinking about it, ascii-io doesn't need the separator
  change constructors
  and factor stuff out the input framework too.
  factor out ascii input/output.
  std::string accessors to escape_sequence functionality
  intermediate commit - it has been over a month since I touched this...

I cleaned up the AsciiInputOutput class somewhat, including renaming
it to AsciiFormatter, renaming some of its methods, and turning the
static methods into members for consistency.

Closes #929.
2013-01-23 16:51:54 -08:00
Jon Siwek
fdd11428c1 Change reporter messages to more reliably print to stderr.
Moved this functionality to be internal instead of in the script-layer
event handlers.  The issue with the later is that bad things can happen
between the time a reporter event handler is dispatched and the time it
is executed, and if bro crashes in that time, the message may never be
seen/logged.

Addressed #930 (and revisits #836).
2013-01-18 12:46:00 -06:00
Bernhard Amann
1b0bb5063a Merge remote-tracking branch 'origin/master' into topic/bernhard/input-logging-commmon-functions
Conflicts:
	src/input/readers/Ascii.cc
2013-01-11 09:48:53 -08:00
Jon Siwek
290c2a0b4d Make const variables actually constant. Addresses #922.
Both local and global variables declared with "const" could be modified,
but now expressions that would modify them should generate an error
message at parse-time.
2012-12-13 15:05:29 -06:00
Bernhard Amann
12753f31ae Merge remote-tracking branch 'origin/master' into topic/bernhard/input-logging-commmon-functions 2012-12-13 11:22:58 -08:00
Robin Sommer
b867333c2e Merge remote-tracking branch 'origin/topic/jsiwek/gtp'
* origin/topic/jsiwek/gtp:
  Change binpac exceptions in AYIYA/GTP analyzers to do protocol_violation
  Add GTP tunnel analyzer memory leak unit test.
  Add GPRS Tunnelling Protocol (GTPv1) decapsulation.

Closes #690.
2012-12-10 14:48:18 -08:00
Robin Sommer
63d43e6545 Renaming ASCII writer filter option 'only_single_header_row' to 'tsv'.
Also clarifying usage.

Closes #912.
2012-12-03 14:40:38 -08:00
Bernhard Amann
9b2265877d and factor stuff out the input framework too. 2012-12-03 13:41:19 -08:00
Bernhard Amann
501328d61a factor out ascii input/output.
First step - factored out everything the logging classes
use ( so only output ).

Moved the script-level configuration to logging/main,
and made the individual writers just refer to it -
no idea if this is good design. It works. But I am happy
about opinions :)

Next step - add support for input...
2012-12-03 12:59:11 -08:00
Jon Siwek
cc8f20c104 Merge branch 'master' into topic/jsiwek/gtp 2012-11-29 16:11:27 -06:00
Robin Sommer
a5e237f50c The ASCII writer now supports a filter config option
'only_single_header_row' that turns the output into CSV format.

In that mode all meta data is skipped except for a single header line
with the fields names. Example:

    local my_filter: Log::Filter = [$name = "my-filter", $writer = Log::WRITER_ASCII, $config = table(["only_single_header_row"] = "T")];

Contributed by Carsten Langer.
2012-11-23 19:38:53 -08:00
Jon Siwek
e0805498c6 Fix some warnings from sphinx when building docs. 2012-11-15 16:40:18 -06:00
Robin Sommer
fb7ba82bab Merge remote-tracking branch 'origin/topic/seth/intel-framework'
* origin/topic/seth/intel-framework: (21 commits)
  Extracting URLs from message bodies over SMTP and sending them to Intel framework.
  Small comment updates in the Intel framework CIF support.
  Intelligence framework documentation first draft.
  Only the manager tries to read files with the input framework now.
  Initial support for Bro's Intel framework with the Collective Intelligence Framework.
  Initial API for Intel framework is complete.
  Fixed an issue with cluster data distribution.
  Updating some intel framework test baselines.
  Reworked cluster intelligence data distribution mechanism and fixed tests.
  Lots more intelligence checking in SMTP traffic.
  Added intelligence check for "Received" path checking and a bit of reshuffling.
  Added sources to the intel log.
  Fixing a problem with intel distribution on clusters.
  Updated intel framework test to include matching.
  Restructuring the scripts that feed data into the intel framework slightly.
  One test for cluster transparency of the intel framework.
  Fixed a cluster support bug.
  Intelligence framework checkpoint
  Major updates to fix the Intel framework API.
  Checkpoint commit.  This is all a huge mess right now. :)
  ...

Closes #914.
2012-11-01 08:21:52 -07:00
Daniel Thayer
c46029d828 Rename the alarm summary mail variable 2012-10-30 16:31:18 -05:00
Daniel Thayer
0f97f0b6e4 Merge remote-tracking branch 'origin/master' into topic/dnthayer/alarms-mail 2012-10-30 11:32:58 -05:00
Jon Siwek
9edbf3e53c Add GPRS Tunnelling Protocol (GTPv1) decapsulation.
This currently supports automatic decapsulation of GTP-U packets on
UDP port 2152.

The GTPv1 headers for such tunnels can be inspected by handling the
"gtpv1_g_pdu_packet" event, which has a parameter of type "gtpv1_hdr".

Analyzer and test cases are derived from submissions by Carsten Langer.

Addresses #690.
2012-10-19 14:02:35 -05:00
Robin Sommer
503412e472 Merge remote-tracking branch 'origin/topic/bernhard/input-end-of-data'
* origin/topic/bernhard/input-end-of-data:
  rename the update_finished event to end_of_data and make it fire in more cases.

Closes #894.
2012-10-12 09:48:58 -07:00
Bernhard Amann
a6d87fcab7 rename the update_finished event to end_of_data and make it fire in
more cases.

It will now not only fire after table-reads have been completed,
but also after the last event of a whole-file-read (or whole-db-read, etc.).

The interface also has been extended a bit to allow readers to
directly fire the event should they so choose. This allows the
event to be fired in direct table-setting/event-sending modes,
which was previously not possible.
2012-10-10 11:51:20 -07:00
Seth Hall
9ea52fe9cd Only the manager tries to read files with the input framework now. 2012-10-10 13:00:48 -04:00
Seth Hall
5aa12984ee Merge remote-tracking branch 'origin/master' into topic/seth/intel-framework 2012-10-10 11:22:34 -04:00
Seth Hall
21473b0557 Initial API for Intel framework is complete.
- More inline docs added.

- Removing some debugging code.

- New test for the intel framework data distribution mechanism.
2012-10-10 11:15:34 -04:00
Seth Hall
6538f70e2c Fixed an issue with cluster data distribution. 2012-10-10 11:13:16 -04:00
Jon Siwek
53d9832d5a Fix a problem with non-manager cluster nodes applying Notice::policy.
This could, for example, result in duplicate emails being sent (one from
manager and one from worker) if Notice::emailed_types is redef'd in
local.bro (or any script that gets loaded on all cluster nodes).

The problem was that Notice::policy is used to populate the internal
Notice::ordered_policy vector in a priority 10 bro_init handler (in
scripts/base/frameworks/notice/main.bro) and then that is what is used
when applying policy to notices.  In order for
scripts/base/frameworks/notice/cluster.bro to prevent Notice::policy
from being used on non-manager nodes, it needs to clear it in a
bro_init hander of higher priority than 10.
2012-10-04 16:45:56 -05:00
Seth Hall
bf9651b323 Reworked cluster intelligence data distribution mechanism and fixed tests.
- Intel data distribution on clusters is now pushed in whole
  by the manager when a worker connects.  Additions after that point
  are managed by the normal single-item distribution mechanism already
  built into the intelligence framework.

- The manager maintains the complete "minimal" data store that the
  workers use to do their matching so that full "minimal" data
  distribution is very easy.

- Tests are cleaned up and work.
2012-10-03 16:25:02 -04:00
Robin Sommer
6ae8ac310a Merge remote-tracking branch 'origin/topic/matthias/libcurl-fix'
* origin/topic/matthias/libcurl-fix:
  Use second granularity for ElasticSearch timeouts.
  Fix compile issues with older versions of libcurl.
2012-10-02 12:07:26 -07:00
Seth Hall
bacc99f645 Added sources to the intel log. 2012-09-28 21:17:14 -04:00
Seth Hall
03532ff051 Fixing a problem with intel distribution on clusters. 2012-09-28 16:38:34 -04:00
Seth Hall
38f0b7927c Updated intel framework test to include matching. 2012-09-28 14:52:05 -04:00
Seth Hall
2366b21787 One test for cluster transparency of the intel framework. 2012-09-28 13:25:06 -04:00
Seth Hall
bd6779b83c Fixed a cluster support bug. 2012-09-28 09:49:00 -04:00
Seth Hall
a803cae92e Intelligence framework checkpoint
- Basic API seems to works, but tests aren't updated yet.

 - Several scripts are available in policy/frameworks/intel that
   call the "seen" function to provide data into the intel
   framework to be tested.

 - Intel::policy is not done yet and needs to be discussed to
   figure out what it needs to have.

 - Running the intel framework and having it do something finally
   is really cool!
2012-09-28 07:07:02 -04:00
Matthias Vallentin
1ce76da90f Use second granularity for ElasticSearch timeouts.
Since the millisecond resolution cannot be harnessed universally and is not
supported by older version of libcurl, we will allow only specifications at the
granularity of seconds.

This commit also fixes a typing issue that causes that prevented the
ElasticSearch timeout to work in the first place: curl_easy_setopt requires a
long but was given a uint64_t.
2012-09-27 16:34:16 -07:00
Seth Hall
71c5b49bdc Major updates to fix the Intel framework API. 2012-09-27 13:39:48 -04:00
Seth Hall
50e319a417 Checkpoint commit. This is all a huge mess right now. :) 2012-09-26 10:08:48 -04:00
Seth Hall
78401262d0 Merge remote-tracking branch 'origin/master' into topic/seth/intel-framework 2012-08-30 11:36:34 -04:00
Robin Sommer
42355bf6f1 Merge remote-tracking branch 'origin/topic/bernhard/input-allow_invalid_types'
* origin/topic/bernhard/input-allow_invalid_types:
  to be sure - add a small assertion
  add an option to the input framework that allows the user to chose to not die upon encountering files/functions.

That's the last feature for 2.1!
2012-08-22 16:11:28 -07:00
Bernhard Amann
1498a3bd59 Merge remote-tracking branch 'origin/master' into topic/bernhard/input-allow_invalid_types 2012-08-22 07:30:58 -07:00
Bernhard Amann
e754590046 Merge remote-tracking branch 'origin/fastpath' into fastpath 2012-08-22 07:28:23 -07:00
Bernhard Amann
b53be21750 add an option to the input framework that allows the user
to chose to not die upon encountering files/functions.

I am not entirely sure if I like the approach I took for
this, it is a bit... hacky.
2012-08-22 06:46:45 -07:00
Bernhard Amann
ec224ada06 single-line documentation addition to main input framework script. 2012-08-21 22:17:28 -07:00
Seth Hall
0dbf2f18fa Add the Stream record to Log:active_streams to make more dynamic logging possible. 2012-08-20 13:26:17 -04:00
Robin Sommer
9cea1d3b27 Merge remote-tracking branch 'origin/topic/seth/reporter-to-stderr'
* origin/topic/seth/reporter-to-stderr:
  A couple of tests for printing reporter messages to STDERR.
  Small improvements for printing reporter messages to STDERR.
  Reporter warnings and error now print to stderr by default.

Closes #836.
2012-08-10 12:29:07 -07:00
Seth Hall
7c6b891b63 Small improvements for printing reporter messages to STDERR. 2012-08-09 13:46:58 -04:00
Seth Hall
a4af46e1f4 Functional intelligence framework.
- All 5 intelligence tests pass.
- Some initial memory optimizations done.
  - More work needs done to reduce duplicate data in memory.
- Input framework integration.
  - Define files to read in the "Bro intelligence format" in Intel::read_files.
- Cluster transparency.
- DNS Zones are a fully supported data type.
  - Queries for Intel::DOMAIN values will automatically check in DNS_ZONE intelligence.
2012-08-06 09:34:14 -04:00
Robin Sommer
32590177a0 Merge remote-tracking branch 'origin/fastpath'
Also reenabling the logs-to-elasticsearch.bro script in
test-all-policy.bro, that seems to work now.

* origin/fastpath:
  Reworked how the logs-to-elasticsearch scripts works to stop abusing the logging framework.
2012-07-27 12:55:10 -07:00
Seth Hall
596f07e505 Reworked how the logs-to-elasticsearch scripts works to stop abusing the logging framework.
- New variable in logging framework Log::active_streams to indicate
  Log:ID enums which are currently active.
2012-07-27 15:31:10 -04:00
Seth Hall
76520645bb Small (potential performance) improvement for logging framework. 2012-07-27 13:51:03 -04:00
Seth Hall
2a9993619f Script-level rotation postprocessor fix.
- This fixes a problem with writers that don't have a
  postprocessor.  Jon is still looking into the rotation
  problem in the core.
2012-07-27 13:49:49 -04:00