Commit graph

687 commits

Author SHA1 Message Date
Robin Sommer
b3155b7b4b Moving make target update-doc-sources from top-level Makefile to btest
Makefile.
2012-07-02 16:14:24 -07:00
Robin Sommer
5ede1418fc Updating baselines. 2012-07-02 16:12:21 -07:00
Robin Sommer
8afcedad59 Merge remote-tracking branch 'origin/topic/bernhard/reader-info'
* origin/topic/bernhard/reader-info:

Conflicts:
	src/logging/WriterBackend.cc
	src/logging/WriterBackend.h
	src/logging/WriterFrontend.cc
	testing/btest/Baseline/scripts.base.frameworks.input.event/out
	testing/btest/Baseline/scripts.base.frameworks.input.executeraw/out
	testing/btest/Baseline/scripts.base.frameworks.input.raw/out
	testing/btest/Baseline/scripts.base.frameworks.input.rereadraw/out
	testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out
2012-07-02 15:38:38 -07:00
Bernhard Amann
86826770ab Merge remote-tracking branch 'origin/fastpath' into topic/bernhard/reader-info
Conflicts:
	src/logging/WriterBackend.cc
	src/logging/WriterBackend.h
	src/logging/WriterFrontend.cc
	testing/btest/Baseline/scripts.base.frameworks.input.event/out
	testing/btest/Baseline/scripts.base.frameworks.input.executeraw/out
	testing/btest/Baseline/scripts.base.frameworks.input.raw/out
	testing/btest/Baseline/scripts.base.frameworks.input.rereadraw/out
	testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out
2012-07-02 15:33:12 -07:00
Robin Sommer
06d2fd52bd Merge remote-tracking branch 'origin/topic/bernhard/reader-info'
* origin/topic/bernhard/reader-info:
  fix small bug - now configuration actually is passed.
  add mode to readerinfo - no need to have it separately everywhere anymore.
  introduce reader-info struct analogous to writer-info.
  Introduce support for a table of key/value pairs with further configuration options, with the same userinterface as in the logging interface.
  make writer-info work when debugging is enabled

Conflicts:
	testing/btest/Baseline/scripts.base.frameworks.input.event/out
	testing/btest/Baseline/scripts.base.frameworks.input.executeraw/out
	testing/btest/Baseline/scripts.base.frameworks.input.raw/out
	testing/btest/Baseline/scripts.base.frameworks.input.rereadraw/out
	testing/btest/Baseline/scripts.base.frameworks.input.tableevent/out

Closes #841.
2012-07-02 15:33:08 -07:00
Robin Sommer
90763bb2f2 Merge branch 'robin/topic/writer-info'
* robin/topic/writer-info:
  Extending the log writer DoInit() API.
  Reworking log writer API to make it easier to pass additional information to a writer's initialization method.

Conflicts:
	src/logging/WriterBackend.cc
	src/logging/WriterBackend.h
	src/logging/WriterFrontend.cc
2012-07-02 15:20:37 -07:00
Robin Sommer
de6e5c951a Merge remote-tracking branch 'origin/topic/jsiwek/icmp6-ndp-options'
* origin/topic/jsiwek/icmp6-ndp-options:
  Extract ICMPv6 NDP options and include in ICMP events (addresses #833).

Closes #833.
2012-07-02 15:00:00 -07:00
Jon Siwek
34ead91f99 Fix inconsistencies in random number generation.
The srand()/rand() interface was being intermixed with the
srandom()/random() one.  The later is now used throughout.

Changed the srand() and rand() BIFs to work deterministically if Bro
was given a seed file (addresses #825).  They also now wrap the
system's srandom() and random() instead of srand() and rand() as per
the above.
2012-06-29 16:24:31 -05:00
Jon Siwek
0e48fda6ff Updating input framework unit tests.
Generally tried to make them more reliable and execute quicker.
They all now load the listen script as a trick to make sure input
sources are fully read, but also terminate() at appropriate times
so that they don't take more time than needed.  They're also all
serialized with the 'comm' group so listening on a port doesn't
interfere with the communication tests.
2012-06-29 12:50:57 -05:00
Bernhard Amann
f820ee9f5c Introduce support for a table of key/value pairs with further configuration options,
with the same userinterface as in the logging interface.

Not really tested, but tests still work.
2012-06-28 16:16:48 -07:00
Jon Siwek
1bbd63970a Small tweak to make test complete quicker. 2012-06-28 15:16:33 -05:00
Jon Siwek
21a0e74d68 Drain events before terminating log/thread managers.
Using the default scripts, the events from RemoteSerializer::LogStats()
were attempting to use the logging framework after logging/threading
had been terminated which never worked right and sometimes caused
crashes with "fatal error: cannot lock mutex".

Also made communication log baseline test pass more reliably.
2012-06-28 12:42:32 -05:00
Jon Siwek
9ae9b2aa4d Extract ICMPv6 NDP options and include in ICMP events (addresses #833).
This adds a new parameter of type "icmp6_nd_options" to the ICMPv6
neighbor discovery events (icmp_redirect, icmp_router_solicitation,
icmp_router_advertisement, icmp_neighbor_solicitation,
icmp_neighbor_advertisement) which includes data extracted from
all neighbor discovery options (RFC 4861) that are present in the
ICMPv6 message.
2012-06-26 17:10:00 -05:00
Robin Sommer
19eea409c3 Extending the log writer DoInit() API.
We now pass in a Info struct that contains:

    - the path name (as before)
    - the rotation interval
    - the log_rotate_base_time in seconds
    - a table of key/value pairs with further configuration options.

To fill the table, log filters have a new field "config: table[string]
of strings". This gives a way to pass arbitrary values from
script-land to writers. Interpretation is left up to the writer.

Also splits calc_next_rotate() into two functions, one of which is
thread-safe and can be used with the log_rotate_base_time value from
DoInit().

Includes also updates to the None writer:

    - It gets its own script writers/none.bro.

    - New bool option LogNone::debug to enable debug output. It then
      prints out all the values passed to DoInit(). That's used by a
      btest test to ensure the new DoInit() values are right.

    - Fixed a bug that prevented Bro from terminating..

(scripts.base.frameworks.logging.rotate-custom currently fails.
Haven't yet investigated why.)
2012-06-21 17:42:33 -07:00
Robin Sommer
0ca0119f2a Merge remote-tracking branch 'origin/topic/jsiwek/interpreter-exception-fix'
* origin/topic/jsiwek/interpreter-exception-fix:
  Fix exceptions thrown in event handlers preventing others from running.
2012-06-21 10:15:12 -07:00
Robin Sommer
54670817fa Merge remote-tracking branch 'origin/topic/seth/tunnels-merge'
* origin/topic/seth/tunnels-merge:
  Fixed some problems with the SOCKS analyzer and tests.

Conflicts:
	scripts/base/protocols/socks/main.bro
	src/socks-analyzer.pac
2012-06-20 21:05:04 -07:00
Seth Hall
6b8b4dab71 Fixed some problems with the SOCKS analyzer and tests. 2012-06-20 22:57:46 -04:00
Robin Sommer
5f75850577 Updating baselines. 2012-06-20 15:13:39 -07:00
Robin Sommer
6cda00c75e Merge remote-tracking branch 'origin/topic/seth/tunnels-merge'
* origin/topic/seth/tunnels-merge:
  SOCKS DPD fixes.
  Fix a bug in the SOCKS analyzer.
  SOCKS and tunnel test updates.
  Updates for the SOCKS analyzer.
  Very small updates to the tunnels framework.
2012-06-20 14:33:18 -07:00
Seth Hall
a60153060d SOCKS and tunnel test updates. 2012-06-20 14:19:49 -04:00
Seth Hall
896f252a31 Updates for the SOCKS analyzer.
- Now supports SOCKSv5 in the analyzer and the DPD sigs.

- Reworked the core events.

- Tests.

- A SOCKS log!
2012-06-20 13:58:25 -04:00
Robin Sommer
b99f4decf2 Merge remote-tracking branch 'origin/topic/jsiwek/tunnels-merge'
* origin/topic/jsiwek/tunnels-merge:
  Make Teredo bubble packet parsing more lenient.
2012-06-19 13:23:58 -07:00
Robin Sommer
b096168318 Merge branch 'topic/robin/tunnels-merge'
* topic/robin/tunnels-merge: (51 commits)
  Updating baselines and NEWS.
  Remove &synchronized from Tunnel::active table.
  Refactor of interal tunnel analysis code.
  Add state management of NetSessions's IP tunnel map.
  Add "encap_hdr_size" option back in.
  Script-layer tunnel interface cleanup.
  Fix performance problem checking packet encapsulation. (addresses #830)
  Adding a SOCKS test case.
  Updating DataSeries baselines.
  Moving my todos over to the tracker ticket.
  Extend weird names that occur in core packet processing during decapsulation.
  Add Teredo analysis option to reduce false positive decapsulation.
  Just some cleanup/documentation of new tunnel-handling code.
  Memory leak fixes
  Add a config.h definition for IPPROTO_IPV4.
  Add AYIYA tunnel decapsulation unit test.
  Add Teredo-specific events.
  Refactor some of the NetSessions routines that recurse on IP packets.
  Add independent options to toggle the different decapsulation methods
  Add more sanity checks before recursing on encapsulated IP packets.
  ...

Conflicts:
	src/event.bif
2012-06-19 13:21:31 -07:00
Jon Siwek
83f385b2b0 Make Teredo bubble packet parsing more lenient.
Teredo bubble packets (IPv6 w/ No Next Header and zero Payload Length)
with data extending past the inner IPv6 header (the outer IPv4 header's
Total Length and UDP header's Length indicate this) now only raises
a "Teredo_payload_len_mismatch" weird instead of causing a
ProtocolViolation().

This also fixes a crash in NetSessions::ParseIPPacket() that occurred
when the packet length didn't match the payload length field.
2012-06-19 12:59:38 -05:00
Robin Sommer
cf593f13e0 Updating baselines and NEWS. 2012-06-18 15:58:52 -07:00
Jon Siwek
f3b3e73eba Script-layer tunnel interface cleanup.
- Clarify "tunnel_changed" event documentation.

- Make expiration of "Tunnel::active" elements configuration via
  "Tunnel::expiration_interval".

- Remove redundant registration of a connection's tunnels in
  tunnel/main.bro's "tunnel_changed" handler.

- Rename "parents" field of "Conn::Info" to "tunnel_parents"
  to give more context.
2012-06-18 12:29:49 -05:00
Jon Siwek
146cb47d6a Fix performance problem checking packet encapsulation. (addresses #830)
Connections were creating a new encapsulation object for nearly
every packet even if no tunnels were ever involved with the Connection.
2012-06-18 11:11:07 -05:00
Robin Sommer
c7c3ff7af9 Adding a SOCKS test case.
However, I'm not sure the output is right.
2012-06-15 16:01:59 -07:00
Robin Sommer
464732bfce Merge remote-tracking branch 'origin/topic/bernhard/input-threads-merge'
* origin/topic/bernhard/input-threads-merge:
  disable streaming reads from executed commands.
  automatically delete disabled input streams
  small documentation fixes
  Documentation
2012-06-15 15:39:58 -07:00
Bernhard Amann
34de9a0903 Merge remote-tracking branch 'origin/master' into topic/bernhard/input-threads-merge 2012-06-15 15:28:35 -07:00
Robin Sommer
d727b4f68a Updating DataSeries baselines. 2012-06-15 15:05:42 -07:00
Jon Siwek
350c93c136 Remove an old, unused diff canonifier. 2012-06-15 11:22:15 -05:00
Robin Sommer
1acb9fd91d Checkpointing the merge. Not done yet.
Merge remote-tracking branch 'origin/topic/tunnels' into topic/robin/tunnels-merge

* origin/topic/tunnels: (41 commits)
  Extend weird names that occur in core packet processing during decapsulation.
  Add Teredo analysis option to reduce false positive decapsulation.
  Just some cleanup/documentation of new tunnel-handling code.
  Memory leak fixes
  Add a config.h definition for IPPROTO_IPV4.
  Add AYIYA tunnel decapsulation unit test.
  Add Teredo-specific events.
  Refactor some of the NetSessions routines that recurse on IP packets.
  Add independent options to toggle the different decapsulation methods
  Add more sanity checks before recursing on encapsulated IP packets.
  Suppress Teredo weirds unless decapsulation was successful once before.
  Tunnel support performance optimization.
  Add Teredo tunnel decapsulation.
  Fix for IP tunnel UID persistence.
  Fix AYIYA analyzer tag.
  Add summary documentation to tunnels/main.bro.
  Make tunnels always identifiable by UID, tunnel.log now gets populated.
  Some improvements to the AYIYA analyzer.
  Remove Tunnel::decapsulate_ip option.
  Remove invalid IP-in-IP encapsulated protocol value.
  ...
2012-06-11 17:24:18 -07:00
Jon Siwek
c5d3ea009d Fix exceptions thrown in event handlers preventing others from running.
If some expression in an event handler body causes an
InterpreterException internally, then the rest of that body doesn't
get executed, but also the bodies of any other handlers were not
executed.
2012-06-11 15:35:09 -05:00
Daniel Thayer
18e61fcdfc Fix val_size BIF tests and improve docs
Improve documentation of "order" BIF, and made the "val_size" tests
more portable.
2012-06-08 15:25:49 -05:00
Bernhard Amann
3e3ceda1a7 disable streaming reads from executed commands.
This lead to hanging bro's because pclose apparently can wait for eternity
if things go wrong. And there probably are a couple of other problems with this approach.
2012-06-07 14:36:03 -07:00
Jon Siwek
9d2a21c490 Extend weird names that occur in core packet processing during decapsulation.
Appending a "_in_tunnel" to the weird name might help clarify that
the weird is happening with a packet that is attempting to be processed
as a result of decapsulation.
2012-06-07 13:03:13 -05:00
Jon Siwek
6f346c8406 Add Teredo analysis option to reduce false positive decapsulation.
The Tunnel::yielding_teredo_decapsulation (on by default) makes it so
the Teredo analyzer doesn't attempt to decapsulate payloads when
there's already a sibling analyzer that thinks it's parsing the right
protocol.  Sometimes, UDP payloads just happen to look like they are
validly Teredo-encapsulated and doing further analysis on the
decapsulated packet can quickly turn into a weird; this change helps
reduce such weirds.
2012-06-07 13:01:10 -05:00
Jon Siwek
9ddb70b109 Merge branch 'master' into topic/tunnels
Conflicts:
	scripts/base/init-bare.bro
2012-06-06 14:53:57 -05:00
Jon Siwek
beacf581d3 Just some cleanup/documentation of new tunnel-handling code. 2012-06-06 14:40:11 -05:00
Robin Sommer
45f5900547 Merge remote-tracking branch 'origin/topic/jsiwek/load-sigs'
* origin/topic/jsiwek/load-sigs:
  Add @load-sigs directive for loading signature files (addresses #551).

Closes #551.
2012-06-06 11:49:39 -07:00
Robin Sommer
73cefcc11c Merge remote-tracking branch 'origin/topic/dnthayer/bif-tests'
* origin/topic/dnthayer/bif-tests:
  Improve "fmt" BIF documentation comment
  Improve tests of the type_name BIF
  Improve test cases for "order" BIF
  Fix documentation of sort BIF and add more tests
  Fix documentation for system_env BIF
  Deprecate the parse_dotted_addr BIF (use to_addr instead)
  Improve tests for to_port and type_name BIFs
  Improve tests for sort, order, and system_env BIFs
  Fix the join_string_vec BIF and add more tests
  Add more tests for previously-untested BIFs
  Add more tests for previously-untested BIFs
  Add more tests for previously-untested BIFs
  Add more tests for previously-untested BIFs
  Add tests for previously-untested strings BIFs
2012-06-06 11:42:16 -07:00
Jon Siwek
7599ac8f31 Memory leak fixes for bad usages of VectorVal ctor.
Many usages of the VectorVal ctor didn't account for the fact that
it automatically Ref's the VectorType argument and end up leaking it.
2012-06-06 11:50:15 -05:00
Jon Siwek
0bdbeb89e2 Memory leak fixes 2012-06-06 10:41:36 -05:00
Jon Siwek
727b7783f9 Add AYIYA tunnel decapsulation unit test. 2012-06-05 15:17:27 -05:00
Jon Siwek
854c625275 Add Teredo-specific events.
These are called "teredo_packet", "teredo_authentication",
"teredo_origin_indication", and "teredo_bubble" and may be raised
on a per-packet basis depending on Teredo encapsulation method.
2012-06-05 15:07:56 -05:00
Daniel Thayer
6e5eb187dd Improve "fmt" BIF documentation comment
Also update test cases for fmt.
2012-06-01 18:11:46 -05:00
Daniel Thayer
6292083b74 Improve tests of the type_name BIF 2012-06-01 16:23:40 -05:00
Daniel Thayer
2b0db01874 Improve test cases for "order" BIF
Also fixed some comments and error messages in the "order" BIF.
2012-06-01 15:50:49 -05:00
Daniel Thayer
2eddaffc90 Fix documentation of sort BIF and add more tests 2012-06-01 14:24:42 -05:00