Commit graph

296 commits

Author SHA1 Message Date
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
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
Bernhard Amann
a3798070da update input framework documentation to reflect want_record change. 2012-07-27 07:33:04 -07:00
Bernhard Amann
76ea182387 make want_record=T the default for events 2012-07-26 21:13:49 -07:00
Jon Siwek
63e8bf72ed Change path conflicts between log filters to be auto-corrected.
This change makes it so when differing logging filters on the same
stream attempt to write to the same writer/path combination, the path
of the filter doing the later write will be automatically adjusted so
that it does not conflict with the other.  The path is adjusted by
appending "-N", where N is the smallest integer greater or equal to 2
required to resolve the path name conflict.

Addresses #842.
2012-07-26 16:55:49 -05:00
Daniel Thayer
c3aba199f6 Fix build warnings 2012-07-25 17:40:21 -05:00
Robin Sommer
eef8b7d1c4 Merge remote-tracking branch 'remotes/origin/topic/seth/elasticsearch' into topic/robin/master-test
I've only tested that it compiles, not whether it still works. The
fact that we don't have any tests for this makes me uneasy ...

* remotes/origin/topic/seth/elasticsearch: (35 commits)
  Some documentation updates for elasticsearch plugin.
  Temporarily removing the ES timeout because it works with signals and is incompatible with Bro threads.
  Changed ES index names to localtime and added a meta index.
  New script for easily duplicating logs to ElasticSearch.
  Some better elasticsearch reliability.
  Fixed small elasticsearch problem in configure output.
  Re-adding the needed call to FinishedRotation in the ES writer plugin.
  Tiny updates.
  Bringing elasticsearch branch up to date with master.
  Adding a define to make the stdint C macros available.
  Adding an extra header.
  Fixed a bug with messed up time value passing to elasticsearch.
  Small updates and a little standardization for config.h.in naming.
  Bug fixes.
  Bug fix and feature.
  Forgot to call the parent method for DoHeartBeat.
  Changed the escaping method.
  Flush logs to ES daemon as Bro is shutting down.
  Reduce the batch size to 1000 and add a maximum time interval for batches.
  Reworked bulk operation string construction to use ODesc and added json escaping.
  ...
2012-07-20 07:43:05 -07:00
Seth Hall
db3d89d290 Some documentation updates for elasticsearch plugin. 2012-07-20 08:51:39 -04:00
Robin Sommer
f73eb3b086 Reworking thread termination logic.
Turns out the finish methods weren't called correctly, caused by a
mess up with method names which all sounded too similar and the wrong
one ended up being called. I've reworked this by changing the
thread/writer/reader interfaces, which actually also simplifies them
by getting rid of the requirement for writer backends to call their
parent methods (i.e., less opportunity for errors).

This commit also includes the following (because I noticed the problem
above when working on some of these):

     - The ASCII log writer now includes "#start <timestamp>" and
      "#end <timestamp> lines in the each file. The latter supersedes
      Bernhard's "EOF" patch.

      This required a number of tests updates. The standard canonifier
      removes the timestamps, but some tests compare files directly,
      which doesn't work if they aren't printing out the same
      timestamps (like the comm tests).

     - The above required yet another change to the writer API to
       network_time to methods.

     - Renamed ASCII logger "header" options to "meta".

     - Fixes #763 "Escape # when first character in log file line".

All btests pass for me on Linux FC15. Will try MacOS next.
2012-07-19 21:21:53 -07:00
Seth Hall
1fa182c169 Some better elasticsearch reliability.
- Added a configurable option for timing out ES HTTP requests.

 - Stop sending reporter messages after one message for one failure.
2012-07-18 00:00:31 -04:00
Seth Hall
485e473561 Merge remote-tracking branch 'origin/master' into topic/seth/elasticsearch 2012-07-17 13:57:59 -04:00
Robin Sommer
86f6f36f70 Merge remote-tracking branch 'vlad/info_record_fixes'
* vlad/info_record_fixes:
  Fix some Info:Record field documentation.

Closes #851. Many thanks!
2012-07-13 16:20:49 -07:00
Vlad Grigorescu
f43576cff3 Fix some Info:Record field documentation. 2012-07-13 14:04:24 -04:00
Daniel Thayer
56b4209597 Merge remote-tracking branch 'origin/master' into topic/dnthayer/alarms-mail 2012-07-12 12:20:16 -05:00
Seth Hall
5607e86ad3 Reporter warnings and error now print to stderr by default.
- Changed the geoip warnings to Info.
2012-07-12 12:55:34 -04:00
Seth Hall
84e91b8b8d Bringing elasticsearch branch up to date with master. 2012-07-09 16:38:05 -04:00
Seth Hall
601d1cf37e Merge remote-tracking branch 'origin/master' into topic/seth/elasticsearch
Conflicts:
	aux/binpac
	aux/bro-aux
	aux/broccoli
	aux/broctl
	scripts/base/frameworks/logging/__load__.bro
	src/logging.bif
2012-07-06 12:01:16 -04:00