Commit graph

13262 commits

Author SHA1 Message Date
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
dina
5c756dcebf Modbus analyzer, current support: FC=3,4,5,6,7,16,22,23 2012-08-20 13:30:22 +02:00
Jon Siwek
f201a9f1a7 Fix portability of printing to files returned by open("/dev/stderr").
The BroFile ctor now wraps /dev/std{in,out,err} string arguments
into the actual FILE* provided by stdio.h because use of the former
directly isn't POSIX compliant and led to subtle differences that
broke unit tests on certain platforms (e.g. OS X redirection of stderr
behavior started differing from Linux).  The BroFile (un)serialization
methods already did this kind of logic, so adding it in the ctor also
should make things more consistent.

Some of the reporter-related unit tests looked like they were missing
output because of this, and the coverage test for bare-mode errors
needed tweaking to branch on whether or not libcurl was available
(since the error output differs when elasticsearch isn't there).
2012-08-17 17:27:02 -05:00
Jon Siwek
907c92e1cc Fix mime type diff canonifier to also skip mime_desc columns
In particular, the ftp.log baseline in the new ipv6 test in bro-testing
was failign on various platforms because of this.
2012-08-17 15:22:51 -05:00
Jon Siwek
508ac1c7ba Unit test tweaks/fixes.
- Some baselines for tests in "leaks" group were outdated.

- Changed a few of the cluster/communication tests to terminate
  more explicitly instead of relying on btest-bg-wait to kill
  processes.  This makes the tests finish faster in the success case
  and makes the reason for failing clearer in the that case.
2012-08-16 16:33:46 -05:00
Jon Siwek
a6f7fd9c87 Fix memory leak of serialized IDs when compiled with --enable-debug.
When using --enable-debug, values keep track of the last identifier
to which they were bound by storing a ref'd ID pointer.  This could
lead to some circular dependencies in which an ID is never reclaimed
because the Val is bound to the ID and the ID is bound to the Val, with
both holding references to each other.

There might be more cases where this feature of --enable-debug caused
a leak, but it showed up in particular when running the
core.leaks.remote unit test due to the internal
SendID("peer_description") call during the handshake between remote
processes.  Other tests showed the send_id() BIF leaked more generally.

Tracking the ID last bound to a Val through just the identifier string
instead of a ref'd ID pointer fixes the leak.
2012-08-16 15:59:26 -05:00
Robin Sommer
4da209d3b1 Installing a handler for running out of memory in "new".
Bro will now print an error message in that case rather than abort
with an uncaught exception.
2012-08-16 11:49:51 -07:00
Robin Sommer
4c3be63919 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fixed more potential problems with deadlocked ES threads and signals from libcurl.
  Fix some problems in logs-to-elasticsearch.bro
2012-08-16 11:44:16 -07:00
Seth Hall
b13196cbf1 Fixed more potential problems with deadlocked ES threads and signals from libcurl. 2012-08-16 09:24:25 -04:00
Seth Hall
fe84e7aaf8 Merge remote-tracking branch 'origin/master' into fastpath 2012-08-16 09:17:14 -04:00
Robin Sommer
ae4066dcf8 Fixing problem with type list. 2012-08-14 17:16:53 -07:00
Seth Hall
205ad78369 Fix some problems in logs-to-elasticsearch.bro 2012-08-14 15:09:38 -04:00
Soumya Basu
a41efd495d Still segfaults. No real updates. 2012-08-13 16:33:27 -07:00
Soumya Basu
bbaa35434b Added the HyperLogLog files to the repository, and the size method works as well. The add method has an error with the hashkeys thus far and no other methods outside of init and size have been tested yet. 2012-08-11 16:45:58 -07:00
Robin Sommer
eee4fbf7ad Updating submodule(s).
[nomail]
2012-08-10 13:33:57 -07:00
Robin Sommer
d1c78d0300 Updating baselines. 2012-08-10 13:25:18 -07:00
Robin Sommer
38912c182c Updating submodule(s).
[nomail]
2012-08-10 12:33:45 -07: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
Robin Sommer
2e936c7570 Merge remote-tracking branch 'origin/topic/dnthayer/more-bif-tests'
* origin/topic/dnthayer/more-bif-tests:
  Add more BIF tests
  Add tests for untested BIFs

Closes #863,
2012-08-10 12:24:53 -07:00
Robin Sommer
879b7dd6c5 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  fix little sneaky bug in input framework with an edge case.
  small bug in test script. Still worked, because the internal type checking let this through...
2012-08-10 12:23:32 -07:00
Soumya Basu
a376f2244e Initial commit. Everything compiles, but it seg faults when you try adding an element to the cardinality counter. 2012-08-09 17:11:57 -07:00
Seth Hall
cfe1402281 A couple of tests for printing reporter messages to STDERR. 2012-08-09 14:48:46 -04:00
Seth Hall
7c6b891b63 Small improvements for printing reporter messages to STDERR. 2012-08-09 13:46:58 -04:00
Daniel Thayer
bda8631f32 Add more BIF tests 2012-08-07 14:10:55 -05: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
Bernhard Amann
a2b5028b58 fix little sneaky bug in input framework with an edge case.
An assertion would trigger in the case when a predicate refuses
a new entry and another entry with the same index elements was
already in the table. (I thought that code block was unreachable
... did not think of this case).
2012-08-04 22:38:26 -07:00
Bernhard Amann
18550ab009 small bug in test script. Still worked, because the internal type checking let this through... 2012-08-04 22:24:44 -07:00
Daniel Thayer
10b671a638 Add tests for untested BIFs 2012-08-03 17:24:04 -05:00
Robin Sommer
0006644e65 Merge branch 'master' of ssh://git.bro-ids.org/bro 2012-08-03 10:59:59 -07:00
Robin Sommer
9829cf9a29 Fixing little typo with big impact. 2012-08-03 10:45:45 -07:00
Jon Siwek
3bb6d4e54e Fix configure script to exit with non-zero status on error 2012-08-01 13:58:18 -05:00
Robin Sommer
01d91602ca Updating CHANGES and VERSION. 2012-08-01 09:57:19 -07:00
Robin Sommer
e3acf3af58 Updating submodule(s).
[nomail]
2012-07-30 11:59:53 -07:00
Robin Sommer
de3eba7062 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Improve log filter compatibility with remote logging.

Closes #842.
2012-07-30 11:49:08 -07:00
Jon Siwek
7b2c3db488 Improve log filter compatibility with remote logging.
If a log filter attempts to write to a path for which a writer is
already instantiated due to remote logging, it will re-use the writer
as long as the fields of the filter and writer are compatible, else
the filter path will be auto-adjusted to not conflict with existing
writer's.  Conflicts between two local filters are still always
auto-adjusted even if field types agree (since they could still
be semantically different).

Addresses #842.
2012-07-30 13:17:49 -05:00
Robin Sommer
38c2ee6894 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add missing breaks to switch cases in ElasticSearch::HTTPReceive().
2012-07-30 09:13:49 -07:00
Jon Siwek
00d41bb549 Add missing breaks to switch cases in ElasticSearch::HTTPReceive().
Observed as reason for segfault in
testing/btest/scripts/check-test-all-policy.bro unit test when compiled
with optimizations.
2012-07-30 11:07:43 -05:00
Robin Sommer
4ba038070f Tweaking writer API for failed rotations.
There are now two FinishedRotation() methods, one that triggers
post-processing and one that doesn't. There's also insurance built in
against a writer not calling either (or both), in which case we abort
with an internal error.
2012-07-28 16:38:22 -07:00
Jon Siwek
4359bf6b42 Fix log manager hanging on waiting for pending file rotations.
This changes writer implementations to always respond to rotation
messages in their DoRotate() method, even for failure/no-op cases
with a new RotationFailedMessage.  This informs the manager to
decrement its count of pending rotations.

Addresses #860.
2012-07-28 16:23:59 -07:00
Robin Sommer
4bdac985cb Tweaking logs-to-elasticsearch.bro so that it doesn't do anything if
ES server is unset.
2012-07-28 11:21:20 -07: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
Robin Sommer
9f2abd0697 Fix input test for recent default change on fastpath. 2012-07-27 12:39:20 -07:00
Robin Sommer
767a792148 Tests updates for recent open/close log change. 2012-07-27 12:39:11 -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
Robin Sommer
c66c6d7c46 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Small (potential performance) improvement for logging framework.
  Script-level rotation postprocessor fix.
  update input framework documentation to reflect want_record change.
  Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
  make want_record=T the default for events
2012-07-27 12:26:18 -07:00
Robin Sommer
1fd0d7a607 Changing the start/end markers in logs to open/close now reflecting
wall clock.

Triggers lots of (simple) baseline updates.
2012-07-27 12:15:21 -07: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
f02ed65878 Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
Inputframework: did not contain any error handling for this case.

Logging framework: tried to catch the interpreter-exception. However the exception already was caught
by the call-function and not propagated. Instead, call returns a 0-pointer in this case, which
lead to a segmentation fault.
2012-07-26 21:51:29 -07:00