Commit graph

1002 commits

Author SHA1 Message Date
Seth Hall
956c23eb66 Merge remote-tracking branch 'origin/master' into topic/seth/metrics-merge 2012-11-28 14:57:42 -05: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
Seth Hall
5b81cfe7e2 Implemented a nearly generic Queue in scriptland. 2012-11-19 23:42:19 -05:00
Seth Hall
e99e090b85 Merge remote-tracking branch 'origin/master' into topic/seth/metrics-merge 2012-11-16 02:49:36 -05:00
Seth Hall
d9195076b1 Metrics framework checkpoint.
- New scan.bro merged in and reworked a bit.

 - Updated metrics API.  Now possible to calculate much more.
2012-11-16 02:37:52 -05:00
Jon Siwek
fd5eb23fa6 Remove byte count parameter from modbus events carrying register arrays
Instead of these events being generated for invalid byte count values
(they should always be even, not odd), a protocol_violation is raised.

    modbus_read_holding_registers_response
    modbus_read_input_registers_response
    modbus_write_multiple_registers_request
    modbus_read_write_multiple_registers_request
    modbus_read_write_multiple_registers_response
    modbus_read_fifo_queue_respons
2012-11-13 12:09:14 -06:00
Jon Siwek
c911d03c30 Adjust modbus register array parsing.
For modbus message types that include variable amount of register values
(uint16[]), setting a &length attribute without an explicit array size
could trigger a parsing assertion since it allows for the "element" data
pointer to travel past the "end of data" (e.g. when &length is odd).
This is changed to now give both an array size and &length to earlier
terminate the parsing of elements before the assert is checked and
so a single out-of-bound check can be done for the entire array
(leaving off &length causes an out-of-bound check for each element).

Added another parameter to modbus events that carry register arrays to
the script-layer which indicates the associated byte count from the
message (allowing for invalid values to be detected):

    modbus_read_holding_registers_response
    modbus_read_input_registers_response
    modbus_write_multiple_registers_request
    modbus_read_write_multiple_registers_request
    modbus_read_write_multiple_registers_response
    modbus_read_fifo_queue_response
2012-11-12 16:40:16 -06:00
Jon Siwek
defed7b6f3 Adjustments to modbus test cases.
- Added a test for binpac exception handling -- the generated code
  should use "binpac::Exception" and not "Exception" for exception
  handling logic to avoid accidental overshadowing by
  the analyzer-specific type "binpac::ModbusTCP::Exception", which
  could lead to interesting asserts being triggered in binpac.

- Update baseline for the event coverage test -- seems that more
  events get generated with working exception handling in the generated
  binpac parser code.

- Coverage baseline was giving wrong number of events covered.
2012-11-12 11:51:42 -06:00
Robin Sommer
dae9c946b6 Another attempt at getting this test portable.
Keeping my fingers crossed ... (and I'm still planing to move this
over to the external tests later).
2012-11-07 20:48:08 -08:00
Robin Sommer
e92ea67959 Fixing modbus test on MacOS.
Hopefully ...
2012-11-07 17:09:25 -08:00
Robin Sommer
d75ee59953 Attempting to fix modbus test portability.
Adding the external canonifier, let's if that helps. Maybe the test
would be better located in the external suite anyways ...
2012-11-06 07:22:21 -08:00
Robin Sommer
6c70b11cea Fixing/extending modbus tests. 2012-11-05 17:10:28 -08:00
Robin Sommer
a40b00d4ab Merge branch 'topic/robin/intel-framework-merge'
* topic/robin/intel-framework-merge: (22 commits)
  Fixing tests after intel-framework merge.
  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.
  ...

Closes #914.
2012-11-05 16:00:38 -08:00
Robin Sommer
86ce564107 Merge remote-tracking branch 'remotes/origin/topic/seth/modbus-merge'
* remotes/origin/topic/seth/modbus-merge:
  Small modbus documentation update and tiny refactoring.
  Final touches to modbus analyzer for now.
  Major revisions to Modbus analyzer support (not quite done yet).
  put some make-up on Modbus analyser
  Modbus analyser, added support: FC=20,21
  Modbus analyzer,added support: FC=1,2,15,24
  Modbus analyzer, current support: FC=3,4,5,6,7,16,22,23

Closes #915.
2012-11-05 15:26:57 -08: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
Seth Hall
1200d04f81 Merge branch 'master' into topic/seth/metrics-merge 2012-10-22 10:06:02 -04:00
Robin Sommer
5e12a53ae5 Merge remote-tracking branch 'origin/topic/jsiwek/gridftp'
* origin/topic/jsiwek/gridftp:
  Add memory leak unit test for GridFTP.
  Enable GridFTP detection by default.  Track/log SSL client certs.
  Add analyzer for GSI mechanism of GSSAPI FTP AUTH method.
  Add an example of a GridFTP data channel detection script.
2012-10-12 10:43:16 -07: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
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
Jon Siwek
e34f6d9e3b Enable GridFTP detection by default. Track/log SSL client certs.
In the *service* field of connection records, GridFTP control channels
are labeled as "gridftp" and data channels as "gridftp-data".

Added *client_subject* and *client_issuer_subject* as &log'd fields to
SSL::Info record.  Also added *client_cert* and *client_cert_chain*
fields to track client cert chain.
2012-10-08 11:38:29 -05:00
Seth Hall
db62369508 Fix for DNS log problem when a DNS response is seen with 0 RRs. 2012-10-05 13:48:49 -04: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
Jon Siwek
2ac6fab5fc Merge branch 'master' into topic/jsiwek/gridftp 2012-10-02 16:39:34 -05:00
Seth Hall
6750b0f7b9 Merge remote-tracking branch 'origin/master' into topic/seth/metrics-updates
Conflicts:
	testing/btest/Baseline/scripts.base.frameworks.metrics.basic-cluster/manager-1.metrics.log
	testing/btest/Baseline/scripts.base.frameworks.metrics.basic/metrics.log
	testing/btest/Baseline/scripts.base.frameworks.metrics.cluster-intermediate-update/manager-1.notice.log
	testing/btest/Baseline/scripts.base.frameworks.metrics.notice/notice.log
	testing/btest/scripts/base/frameworks/metrics/basic-cluster.bro
2012-10-01 16:23:06 -04:00
Bernhard Amann
4cbf4e3caf Small but important fix for the input framework. BroStrings were constructed
without a final \0 - which means that strings read by the input framework are
unusable by basically all internal functions (like to_count).

the basic test now also checks this.

Thanks at Sheharbano for noticing this.
2012-10-01 13:04:40 -07:00
Jon Siwek
68aead024a Add an example of a GridFTP data channel detection script.
It relies on the heuristics of GridFTP data channels commonly default to
SSL mutual authentication with a NULL bulk cipher and that they usually
transfer large datasets (default threshold of script is 1 GB).  The
script also defaults to skip_further_processing() after detection to try
to save cycles analyzing the large, benign connection.

Also added a script in base/protocols/conn/polling that generalizes the
process of polling a connection for interesting features.  The GridFTP
data channel detection script depends on it to monitor bytes
transferred.
2012-10-01 12:32:24 -05: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
51249d0984 Merge remote-tracking branch 'origin/master' into topic/seth/intel-framework 2012-09-28 09:27:52 -04:00
Jon Siwek
292bf61ae8 Unit test reliability adjustment.
Sometimes manager node was shutting everything down before others had
a chance to generate output.  It now waits for all nodes to fully
connect with each other.
2012-09-13 12:59:40 -05:00
Jon Siwek
bd84ff2c20 Adjusting some unit tests that do cluster communication.
Added explicit synchronization and termination points to make the
tests more reliable and exit earlier in most cases.
2012-09-07 16:25:07 -05:00
Jon Siwek
a10093b620 Add sleeps to configuration_update test for better reliability.
Not the greatest solution, but makes the 3 bro processes more likely to
run sequentially so that the controller2 process doesn't happen to be
scheduled before the controller process.  In that case, the controllee
gets the shutdown request before the configuration update.  FreeBSD
especially seemed to schedule them the unintended way frequently.
2012-09-05 16:20:34 -05: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
cbb31cedc3 Merge remote-tracking branch 'origin/topic/dina/modbus' into topic/robin/modbus-merge
* origin/topic/dina/modbus:
  put some make-up on Modbus analyser
  Modbus analyser, added support: FC=20,21
  Modbus analyzer,added support: FC=1,2,15,24
  Modbus analyzer, current support: FC=3,4,5,6,7,16,22,23

I cleaned up the code a bit, mainly layout style.

I did not include the *.bro scripts for now, but a test script
../testing/btest/scripts/base/protocols/modbus/events.bro that prints
out the value for each event.

Merged the Modbus traces from the ics repository into a single trace
as input for the test. They currently trigger 20 of the 34 events.

Addresses #870.
2012-08-29 17:58:41 -07:00
Robin Sommer
20c71cac51 Merge remote-tracking branch 'remotes/origin/topic/bernhard/input-warn-on-invalid-numbers'
* remotes/origin/topic/bernhard/input-warn-on-invalid-numbers:
  ...and another small change to error handling -> now errors in single lines do not kill processing, but simply ignore the line, log it, and continue.
  Ok, this one was a little bit sneaky.
  ok, this one might really be a bit too big for 2.1
2012-08-27 12:43:36 -07:00
Robin Sommer
48c6bdf467 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  fix handline of sets only containing a zero-length string.

Conflicts:
	src/input/readers/Ascii.cc
2012-08-27 12:27:24 -07:00
Bernhard Amann
56fa56ffa9 ...and another small change to error handling -> now errors in single lines
do not kill processing, but simply ignore the line, log it, and continue.
2012-08-27 11:38:20 -07:00
Bernhard Amann
a4ca5b0d82 fix handline of sets only containing a zero-length string.
Thank you Robin...
2012-08-27 09:50:51 -07:00
Robin Sommer
352d4bd5e2 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Ok, this one is not really necessary for 2.1 and more of a nice-to-have
  another small bug found while searching for something else...
  Fix two little bugs:
  sorry. the patch for the set_separator.
  make set_separators different from , work for input framework.
  Bug found bei Keith & Seth: input framework was not handling counts and ints out of 32-bit-range correctly.
2012-08-27 09:31:17 -07:00
Bernhard Amann
f133e8808a ok, this one might really be a bit too big for 2.1
Give all kinds of errors when encountering invalid numbers (like out-of-range-warnings, etc).
2012-08-26 22:00:37 -07:00
Bernhard Amann
7e46936728 Ok, this one is not really necessary for 2.1 and more of a nice-to-have
Before this patch, empty values were not hashed at all. Which had the unfortunate side-effect
that e.g. the lines

TEST	-
and
-	TEST

have the same hash values. On re-reads that means that the change will
be ignored.

This is probably pretty academic, but this patch changes it and adds a testcase.

Output of the reread test changes due to re-ordering of the output (probably
due to the fact that the internal hash values are changed and thus transferred
in a different order)
2012-08-26 20:49:21 -07:00
Bernhard Amann
a9e6d9ae81 Fix two little bugs:
Escaped ,'s in sets and vectors were unescaped before tokenization

Handling of zero-length-strings as last element in a set was broken (sets ending with a ,).

Hashing of lines just containing zero-length-strings was broken (now a \0 is appended to each
string before it is hashed - giving us a hash of something for a line just consisting of \0s.
This also allows to differentiate between vectors with varying numbers of zero-length-strings).
2012-08-26 19:17:21 -07:00
Bernhard Amann
977c1d7c5a make set_separators different from , work for input framework.
1-line-patch + test.
2012-08-26 17:52:07 -07:00
Bernhard Amann
124c985d7a Bug found bei Keith & Seth: input framework was not handling counts and ints out of 32-bit-range correctly.
Note - another bugfix will be coming later (problem reading sets containing zero-length-strings & un-escaping-bug in sets)
2012-08-26 14:49:37 -07: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
Jon Siwek
655a73bc13 Change to metrics/basic-cluster unit test for reliability.
If the metrics break interval happened to occur between first and second
worker starting up and getting connected to the cluster, the test
would fail because the second worker didn't get a chance to connect and
send data.  The test now waits for the cluster setup to complete
before workers send metrics data.
2012-08-22 16:46:47 -05: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