Commit graph

11634 commits

Author SHA1 Message Date
Robin Sommer
5dc630f722 Working on TODOs.
- Introducing analyzer::<protocol> namespaces.
- Moving protocol-specific events out of events.bif into analyzer/protocol/<protocol>/events.bif
- Moving ARP over (even though it's not an actual analyzer).
- Moving NetFlow over (even though it's not an actual analyzer).
- Moving MIME over (even though it's not an actual analyzer).
2013-04-18 21:01:15 -07:00
Jon Siwek
cd2a6aa33a FileAnalysis: workarounds for older libmagics.
Some of the unit tests revealed different versions of libmagic could
give different mime types for the same input file and magic database.

One way that could happen is because of the use of hardcoded/builtin
token (word) comparisons for ascii files -- MAGIC_NO_CHECK_TOKENS flag
will prevent that from being used (and it's obsoleted in newer
libmagics).

The other problem looked like a bug fixed as of 5.05 where
a match in the magic database that doesn't have a verbose description
but does have a mime type won't actually return that mime type due to
the the missing description.  The one case where that kept popping up
was in 5.04 not beign able to identify application/x-dosexec, so I added
a description to the top-level match for that to workaround the issue.
2013-04-18 18:09:48 -05:00
Robin Sommer
dfc4cb0881 Moving all analyzers over to new structure.
This is a checkpoint, it works but there's more cleanup to do. TODOs in
src/analyzer/protocols/TODO.
2013-04-16 20:52:03 -07:00
Robin Sommer
56edef1646 Removing left-overs from BinPAC http analyzer. 2013-04-16 14:47:17 -07:00
Robin Sommer
a191eed7db Adding separate Plugin.cc for HTTP analyzer for consistency. 2013-04-16 14:43:52 -07:00
Robin Sommer
7a95f5322c Moving src/protocols to src/analyzer/protocols.
This is for consistency with where readers/writers are located: inside
the subdirectories of the corresponding code.
2013-04-16 14:29:11 -07:00
Robin Sommer
e6eddbd918 Missing dependency. 2013-04-16 14:28:23 -07:00
Robin Sommer
aeddca6523 More API documentation. 2013-04-16 14:28:23 -07:00
Bernhard Amann
dc18a6d6e3 Merge remote-tracking branch 'origin/topic/seth/metrics-merge' into topic/bernhard/hyperloglog-with-measurement
and fix up the hll scripts for it.

Conflicts:
	scripts/base/frameworks/sumstats/plugins/__load__.bro
	testing/btest/scripts/base/frameworks/measurement/basic.bro
2013-04-16 05:25:10 -07:00
Bernhard Amann
70c020e412 well, with this commit synchronizing the data structure should work..
...if we had consistent hashing.
2013-04-16 05:16:32 -07:00
Seth Hall
1cac89e4f8 SumStats test checkpoint. 2013-04-16 00:54:41 -04:00
Scott Runnels
d7d33db8ec Initial commit to include the Notice Framework in the User Manual. 2013-04-15 23:26:04 -04:00
Seth Hall
437815454d SumStats tests pass. 2013-04-15 15:28:11 -04:00
Seth Hall
fbe967e16a Checkpoint for SumStats rename. 2013-04-15 15:12:28 -04:00
Jon Siwek
037d582b0e FileAnalysis: add custom libmagic database.
- It's derived from the magic database of libmagic 5.14, but with most
  everything not related to mime types removed.

- The custom database is always used by default for mime detection, but
  the more verbose file type detection will fall back on the default
  libmagic installation's database.  The result is: mime type strings
  are now guaranteed to be consistent across platforms, but the verbose
  file type descriptions are not.

- The custom database gets installed in $prefix/share/bro/magic, and
  should even be extensible if files with new patterns are added inside
  the directory.

- The search path for the mime magic database can be controlled via
  BROMAGIC environment variable.

- Remove mime_desc field from ftp.log.

- Stop using the mime/file type canonifier with unit tests.

- libmagic >= 5.04 is now a requirement.
2013-04-12 11:58:19 -05:00
Seth Hall
8165d6077d Fix another occasional reporter error. 2013-04-12 11:20:45 -04:00
Seth Hall
e93fd69cf2 Small updates to hopefully correct reporter errors leading to lost memory. 2013-04-12 09:28:38 -04:00
Jon Siwek
b8c98b8bf7 FileAnalysis: change terminology s/action/analyzer 2013-04-11 14:53:54 -05:00
Jon Siwek
e81f2ae7b0 FileAnalysis: libmagic tweaks.
Remove verbose file type detection and automatically strip out charset
from mime type.
2013-04-11 13:11:46 -05:00
Jon Siwek
2fba37e277 FileAnalysis: add bif for setting timeout interval 2013-04-11 12:08:46 -05:00
Jon Siwek
e2fbee9054 FileAnalysis: add more params to some events. 2013-04-11 11:24:18 -05:00
Seth Hall
a615601269 Trying to fix a state maintenance issue. 2013-04-11 09:42:46 -04:00
Seth Hall
e0df278de6 Merge remote-tracking branch 'origin/topic/jsiwek/faf-experimental' into topic/seth/file-analysis-exe-analyzer
Conflicts:
	src/file_analysis.bif
2013-04-10 22:59:11 -04:00
Seth Hall
8beb75d985 Checkpoint. 2013-04-10 22:57:54 -04:00
Jon Siwek
2747e839fb FileAnalysis: insert explicit event queue flush points.
And added an event called "event_queue_flush_point" to mark where that
occured in the event stream.  The FAF now uses an explicit event queue
flush instead of buffering input in order to wait for a file handle to
be returned from script-layer.
2013-04-10 16:48:10 -05:00
Bernhard Amann
3820651eaf Merge branch 'topic/bernhard/hyperloglog' into topic/bernhard/hyperloglog-with-measurement 2013-04-10 16:06:08 -04:00
Bernhard Amann
5291bb29f2 and also serialize the other things we need 2013-04-10 16:05:24 -04:00
Jon Siwek
d9321e2203 FileAnalysis: remove some file events.
The file_new event now takes over the function of file_type, file_bof,
and file_bof_buffer.
2013-04-10 14:34:23 -05:00
Bernhard Amann
3644dcdd22 Merge branch 'topic/bernhard/hyperloglog' into topic/bernhard/hyperloglog-with-measurement 2013-04-10 13:48:00 -04:00
Bernhard Amann
240d667e30 ok, this bug was hard to find.
hyperloglog.h was missing guards and randomly deleting memory at
addresses equal to variable contents.

I am not entirely sure why that did not crash before...
2013-04-10 13:45:21 -04:00
Bernhard Amann
b5522fc4b7 Merge branch 'topic/bernhard/hyperloglog' into topic/bernhard/hyperloglog-with-measurement 2013-04-10 13:16:03 -04:00
Bernhard Amann
a37ffab0ea serialization compiles.
Not entirely sure if it works too...
2013-04-10 13:15:31 -04:00
Jon Siwek
a2d9b47bcd FileAnalysis: finish switching hooks to events. 2013-04-10 11:13:43 -05:00
Bernhard Amann
f10ed9e29a change plugin after feedback of seth 2013-04-10 10:45:45 -04:00
Robin Sommer
eb94c6becd Fixing ref counting bug. 2013-04-09 17:38:01 -07:00
Robin Sommer
2002787c6e A set of interface changes in preparation for merging into BinPAC++
branch.
2013-04-09 17:16:27 -07:00
Robin Sommer
52cd02173d Removing event groups. 2013-04-09 16:49:47 -07:00
Jon Siwek
641154f8e8 FileAnalysis: checkpoint in middle of big reorganization.
- FileAnalysis::Info is now just a record used for logging, the fa_file
  record type is defined in init-bare.bro as the analogue to a
  connection record.

- Starting to transfer policy hook triggers and analyzer results to
  events.
2013-04-09 15:49:58 -05:00
Bernhard Amann
07d44f3aa0 Merge remote-tracking branch 'origin/topic/seth/metrics-merge' into topic/bernhard/hyperloglog-with-measurement 2013-04-08 10:56:18 +02:00
Bernhard Amann
09b5d23deb Merge branch 'topic/bernhard/hyperloglog' into topic/bernhard/hyperloglog-with-measurement 2013-04-08 10:55:15 +02:00
Bernhard Amann
bcd610fd50 Forgot a file. Again. Like always. Basically. 2013-04-08 10:55:00 +02:00
Bernhard Amann
ac0e211c6c do away with old file. 2013-04-08 10:01:55 +02:00
Bernhard Amann
7eee2f0d17 measurement framework with hll unique 2013-04-08 10:00:34 +02:00
Bernhard Amann
25c0ffc3ab Merge branch 'topic/bernhard/hyperloglog' into topic/bernhard/hyperloglog-with-measurement 2013-04-08 09:45:10 +02:00
Bernhard Amann
7f5e2b1301 and test results. are those stable accross platforms? Or do we have to do some kind of rounding? 2013-04-08 09:44:24 +02:00
Bernhard Amann
53d6f3aae7 rework cardinality interface to use opaque.
I like it better...
2013-04-07 23:05:14 +02:00
Bernhard Amann
c08d285497 Merge remote-tracking branch 'origin/topic/robin/thread-cleanup' into topic/bernhard/thread-cleanup 2013-04-07 20:45:05 +02:00
Bernhard Amann
2cc1f82425 Merge remote-tracking branch 'origin/master' into topic/bernhard/thread-cleanup 2013-04-07 20:43:47 +02:00
Robin Sommer
1a30a57816 Porting syslog analyzer as another example.
The diff to this commit shows what "porting" involves ...

This also adds a small test for syslog.
2013-04-05 13:13:30 -07:00
Robin Sommer
d5865c67cb Removing some debugging output. 2013-04-05 12:40:09 -07:00