Commit graph

3557 commits

Author SHA1 Message Date
Matthias Vallentin
f211b856c9 Catch invalid values of the false-positive rate. 2013-06-06 13:13:36 -07:00
Matthias Vallentin
012e09c5c4 Small fixes and simplifications. 2013-06-06 12:56:46 -07:00
Matthias Vallentin
d5126a1339 Fix some BiF issues. 2013-06-05 17:45:10 -07:00
Matthias Vallentin
3d97642131 Add Bloom filter BiFs. 2013-06-05 16:26:16 -07:00
Matthias Vallentin
880d02f720 Associate a Comphash with a BloomFilterVal.
We also keep track of the Bloom filter's element type inside each value. The
first use of the BiF bloomfilter_add will "typify" the Bloom filter and lock
the Bloom filter's type to the element type.
2013-06-05 16:25:48 -07:00
Matthias Vallentin
751cf61293 Add more serialization implementation. 2013-06-04 15:30:27 -07:00
Matthias Vallentin
a5572dd66f Write CounterVector implementation scaffold. 2013-06-04 14:31:39 -07:00
Matthias Vallentin
d3297dd6f3 Adhere to Bro coding style. 2013-06-04 14:00:23 -07:00
Matthias Vallentin
f708cd4a36 Work on parameter estimation and serialization. 2013-06-03 22:55:21 -07:00
Matthias Vallentin
f529df33e0 Stabilize Bloom filter interface. 2013-06-03 14:00:28 -07:00
Matthias Vallentin
d873db03ce Add draft of Bloom filter type hierarchy. 2013-05-31 18:31:14 -07:00
Matthias Vallentin
9e32eaad6d Make bitvectors serializable. 2013-05-28 20:58:01 -07:00
Matthias Vallentin
4d275522c7 Add abstraction for vector of bits.
A bitvector is a vector of bits with underlying block storage. Since C++ has no
notion of lvalues in the context of bits, we use a small wrapper class
Reference that masks the desired bit in the corresponding block.
2013-05-23 16:03:26 -07:00
Robin Sommer
e46300a724 Fixing test that would fail without ES/curl support.
It used to special-case an error message produced in the case that ES
isn't available, however with scripts/test-all-policy.bro now
explicitly disabling ES output, that doesn't seem necessary anymore.
2013-05-18 16:47:04 -07:00
Robin Sommer
1d28136d12 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  (hopefully) fix mutex lock problem.
2013-05-17 15:58:36 -07:00
Bernhard Amann
65b56479d2 (hopefully) fix mutex lock problem.
log writers were removed on shutdown while frontends still
had pointers to it.

A similar fix will be necessary for the input framework (tomorrow :) )
2013-05-17 14:08:43 -07:00
Robin Sommer
b11a397168 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  change sqlite3 default threading mode to no-mutex, disable memory statistics, finalize prepared statement before exitting logger.
2013-05-17 13:50:59 -07:00
Robin Sommer
14abcc52fa Updating submodule(s).
[nomail]
2013-05-17 13:38:29 -07:00
Bernhard Amann
bd02da8a0c change sqlite3 default threading mode to no-mutex, disable memory
statistics, finalize prepared statement before exitting logger.

This might fix the deadlock issue, at least it did not happen for
me on my tried on the test system where it happened quite regularly
before.
2013-05-17 13:38:26 -07:00
Robin Sommer
4a235f7bbb Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix uninitialized DPM member.
2013-05-17 13:38:01 -07:00
Jon Siwek
945aa8a550 Fix uninitialized DPM member.
Was seeing crashes due to this primarily on Ubuntu 12.04 when
generating reST docs.
2013-05-17 14:13:47 -05:00
Robin Sommer
1b20ae1b6e Merge remote-tracking branch 'origin/topic/seth/dns-dual-trans-id-fix'
Closes #1008.

* origin/topic/seth/dns-dual-trans-id-fix:
  Fix the issue with transaction ID reuse in a single DNS connection.
2013-05-17 08:06:42 -07:00
Robin Sommer
31f94b8f37 Updating submodule(s).
[nomail]
2013-05-17 07:48:06 -07:00
Robin Sommer
85e3eb4c57 Fixing Broxygen generation.
Needs to have BROMAGIC set to find the magic database.
2013-05-17 07:44:01 -07:00
Seth Hall
ae9a02140e Fix the issue with transaction ID reuse in a single DNS connection.
- Each transaction ID within a connection is now maintained as
   a queue of DNS::Info logging records.

 - New function added to the queue.bro script to support
   peeking at the new gettable item in the queue without removing it.
2013-05-17 10:35:08 -04:00
Robin Sommer
5ff7621328 Fix for 'fchmod undeclared here' on FreeBSD.
This is from http://www.sqlite.org/cgi/src/tktview/de87b8dc7b367965c13d16becfd6996bbcd4be80

Doesn't seem applied yet, and may not be the best solution anyways.
2013-05-15 19:13:51 -07:00
Robin Sommer
bdc43fc8dd CMake policy fix to avoid errors with older version.
Looks like we could avoid this by raising the minimum cmake version to 2.6.4.
2013-05-15 19:06:38 -07:00
Robin Sommer
b9b691e31b CMake cosmetics. 2013-05-15 18:25:50 -07:00
Robin Sommer
d41edfafcf Updating submodule(s).
[nomail]
2013-05-15 18:20:33 -07:00
Robin Sommer
2d8c8435bf Disabling ES output in check-test-all-policy.bro to avoid warning
about ES server not being available.

I'm not quite sure why the warning has started to be appear now, but
it looks like it should have been there already.
2013-05-15 18:17:03 -07:00
Robin Sommer
36e56c725b Updating test baselines. 2013-05-15 17:29:53 -07:00
Robin Sommer
4b86730ef2 Reintroducing the logging::Manager's Terminate() method.
It doesn't do anything else than simply forwarding to FlushBuffers().

This is just for consistency in terminate_bro() where components get
their Terminate() called so that the main code doesn't need to know
anything more specific about what particular action to take at
shutdown.
2013-05-15 17:19:52 -07:00
Robin Sommer
639a6410c6 Merge remote-tracking branch 'origin/topic/bernhard/thread-cleanup'
* origin/topic/bernhard/thread-cleanup:
  and just to be really sure - always make threads go through OnWaitForStop
  hopefully finally fix last interesting race-condition
  it is apparently getting a bit late for changes at important code...
  spoke to soon (forgot to comment in line again).
  Change thread shutdown again to also work with input framework.
  Changing semantics of thread stop methods.
  Support for cleaning up threads that have terminated.
2013-05-15 17:16:41 -07:00
Robin Sommer
f76446fb4e Merge remote-tracking branch 'origin/topic/bernhard/metrics-samples'
Closes #1003.

* origin/topic/bernhard/metrics-samples:
  finishing touches, make test more robust, rename function in last again
  change names of data structures after talking with seth
  make last plugin nicer and samplify sqli detector
  add tests for sampler
  reservoir sampler. untested.
2013-05-15 16:11:27 -07:00
Robin Sommer
358528732c Merge branch 'topic/robin/sqlite-merge'
Closes #997.

* topic/robin/sqlite-merge: (25 commits)
  Fix to make sqlite test consistent, and updating coverage baselines
  Avoid a CMake warning about 3rdparty looking like a number.
  Fixing linker error.
  and there is no has-reader.
  make sqlite3 executable required and add test-cases for errors
  Renaming src/external -> src/3rdparty
  fix a few small rough edges (mostly comments that do no longer apply)
  fix bug in input-manager regarding enums that a writer reads without 0-terminating the string
  actually make sqlite work again (tests passed because the writer was not actually defined because of the define.)
  add sqlite distribution.
  fix warnings, update baselines, handle rotation
  add sqlite tests and fix small vector/set escaping bugs
  fix small bug with vectors and sets.
  make work with newer AsciiFormatter.
  start adding a different text for empty records for the sqlite writer.
  no, you will never guess from where I copied this file...
  make sqlite support more or less work for logging and input
  make sqlite-writer more stable.
  make it compile with new version of AsciiInputOutput
  and adapt to AsciiInputOutput - seems to work...
  ...

Conflicts:
	scripts/base/frameworks/input/__load__.bro
	src/CMakeLists.txt
	src/input.bif
	src/input/Manager.cc
	src/main.cc
	src/types.bif
	testing/btest/Baseline/coverage.bare-load-baseline/canonified_loaded_scripts.log
	testing/btest/Baseline/coverage.default-load-baseline/canonified_loaded_scripts.log
2013-05-15 16:03:19 -07:00
Bernhard Amann
f389cafc3b Merge remote-tracking branch 'origin/master' into topic/bernhard/thread-cleanup
Conflicts:
	src/main.cc
2013-05-15 16:00:49 -07:00
Robin Sommer
4fe0e22128 Fix to make sqlite test consistent, and updating coverage baselines 2013-05-15 15:56:53 -07:00
Bernhard Amann
7bf456c11a and just to be really sure - always make threads go through OnWaitForStop 2013-05-15 15:55:38 -07:00
Bernhard Amann
37566e73d8 hopefully finally fix last interesting race-condition 2013-05-15 15:36:34 -07:00
Robin Sommer
4a134872d5 Avoid a CMake warning about 3rdparty looking like a number. 2013-05-15 15:35:38 -07:00
Robin Sommer
d7df8cec24 Fixing linker error.
On Linux we need -ldl to find dlclose(), which SQLite needs. CMake has
macro for that fortunately.
2013-05-15 15:30:37 -07:00
Robin Sommer
f4fc9dd947 Merge remote-tracking branch 'origin/topic/bernhard/sqlite' into topic/robin/sqlite-merge
* origin/topic/bernhard/sqlite:
  and there is no has-reader.
  make sqlite3 executable required and add test-cases for errors
2013-05-15 15:24:02 -07:00
Robin Sommer
e050648621 Merge branch 'topic/robin/file-analysis-merge'
Closes #982.

* topic/robin/file-analysis-merge: (64 commits)
  A few more small tweaks.
  Various smalle tweaks in preparation for merging.
  FileAnalysis: load custom mime magic database just once.
  Improve a libmagic-related error message.
  FileAnalysis: add is_orig field to fa_file & Info.
  FileAnalysis: inlined doc fixes.
  FileAnalysis: optimizate connection set updating.
  FileAnalysis: optimize file handle construction.
  FileAnalysis: workarounds for older libmagics.
  FileAnalysis: add custom libmagic database.
  FileAnalysis: change terminology s/action/analyzer
  FileAnalysis: libmagic tweaks.
  FileAnalysis: add bif for setting timeout interval
  FileAnalysis: add more params to some events.
  FileAnalysis: insert explicit event queue flush points.
  FileAnalysis: remove some file events.
  FileAnalysis: finish switching hooks to events.
  FileAnalysis: checkpoint in middle of big reorganization.
  FileAnalysis: fix file type canonification for file_analysis.log
  Revert "FileAnalysis: optimize get_file_handle event queueing."
  ...

Conflicts:
	NEWS
2013-05-15 15:14:21 -07:00
Bernhard Amann
ab6d5b08a8 finishing touches, make test more robust, rename function in last again 2013-05-15 11:33:25 -07:00
Bernhard Amann
80962ad74b change names of data structures after talking with seth 2013-05-15 09:44:43 -07:00
Bernhard Amann
b0c4dcdfed make last plugin nicer and samplify sqli detector 2013-05-15 01:09:52 -07:00
Bernhard Amann
808639fc5f it is apparently getting a bit late for changes at important code... 2013-05-15 00:56:27 -07:00
Bernhard Amann
b947394990 spoke to soon (forgot to comment in line again).
Now it should work. However - this commit changes a basic assumption
of the threading queue. This basic assumption is, that nothing can
be read out of the out-queue of a dead thread. I think that reading
out of the queue of a dead thread makes perfect sense (when the thread
shuts down, pushes the rest of its work on the queue and says bye,
and wants the main thread to pick it up afterwards) - however, I
guess one can be of a differing opinion here.

In any case, it makes stuff a bit easier to understand - in my opinion.
It took me a while to find out why the messages disappear in thin
air and never arrive in the main thread ;)
2013-05-15 00:49:57 -07:00
Bernhard Amann
39f1b9e01f Change thread shutdown again to also work with input framework.
Seems to work, tests pass, but not really verified.

Major change 1:
finished flag in MsgThread was replaced by 2 flags:
child_finished and main_finished.

child_finished is set by child_thread and means that the processing
loop is stopped immediately (no longer needed, no new input messages
will be processed, if loop continues running there is an ugly delay
on shutdown). (This took me a while to realize...)

main_finished is set by a message that is sent back by the child
to the main thread when Finished() is called (and child_finished
is set). when main_finished is set, processing of output messages
stops. But all messages that the child thread pushed in the queue
before calling Finish() are still processed.

Change 2:
Logging terminate call was replaced by a smaller call that just
flushes out the cache held by the main thread. This call
has to be done before thread shutdown is called - otherwhise
the threads will be shut down before all messages are pushed
on them. (This also took me a while to realize...).

Change 3:
Input framework actually calls it stop methods correctly (everything
was prepared, function call was missing)
2013-05-14 23:45:55 -07:00
Bernhard Amann
2b009939f5 and there is no has-reader. 2013-05-14 22:12:23 -07:00