Commit graph

385 commits

Author SHA1 Message Date
Jon Siwek
24f3eb7fc2 Fix test failure due to some platforms joining stderr/stdout differently. 2011-10-17 13:53:10 -05:00
Jon Siwek
556b88e322 Tweaking notice suppression disable and notice policy order tests.
They should be less sensitive to script-layer changes now.
2011-10-14 10:47:32 -05:00
Robin Sommer
bd9c937236 Fixing DNS memory leaks.
Some of the changes only clean up at termination to make perftools
happt, but there were some "real" leaks as well.

This fixes all DNS leaks I could reproducem, including most likely
what's reported in #534. Closing #534.

I'm also adding a new btest subdir core/leaks with tests requiring
perftools support. These don't compare against base lines but abort
whenever perftools reports a leak (with stack information to track it
down). Right now, these are passing.
2011-10-09 17:00:57 -07:00
Seth Hall
0803df2e14 Changed communication option from listen_encrypted to listen_ssl.
- Robin pointed out that SSL is providing authentication
  as well as encryption so listen_ssl is a more
  proper variable name.
2011-10-07 23:57:08 -04:00
Seth Hall
6d67f7830d Added to the likely_server_ports set for protocols with analyzers.
- Updated some tests since Bro is getting the direction
  correct now.

- Updated BPF filter test since I added a few ports to IRC
  as well.
2011-10-07 13:44:28 -04:00
Seth Hall
da9b8cc283 Modification to the Communication framework API.
- Simplified the communication API and made it easier to change
  to encrypted connections by not having separate variables to
  define encrypted and unencrypted ports.

- Now, to enable listening without configuring nodes just
  load the frameworks/communication/listen script.

- If encrypted listening is desired set the following:
	redef Communication::listen_encrypted=T;

- Accompanying test updates.
2011-10-07 13:29:26 -04:00
Robin Sommer
1ae94aae33 Baseline updates for conn compressor change. 2011-10-07 08:39:44 -07:00
Robin Sommer
9af6c183d2 Updating baselines for recent commits. 2011-10-06 19:04:26 -07:00
Robin Sommer
ea3dffa83c Fixing non-portable regexp match in test.
Also adding site/ to scripts excluded from bare mode check.
2011-10-06 19:04:03 -07:00
Jon Siwek
1cc675e30f Make CompHash computation/recovery for functions deterministic
Functions are now assigned a unique integer on construction which
CompositeHash can base hashes on.  Recovery then just involves
looking up the function pointer associated with that unique number.
2011-10-06 14:29:03 -05:00
Robin Sommer
fe77d385e0 Merge remote-tracking branch 'origin/topic/jsiwek/broctl-tweaks'
* origin/topic/jsiwek/broctl-tweaks:
  Consolidating some node-specific functionality from scripts in broctl repo.
2011-10-05 16:54:39 -07:00
Jon Siwek
88e089864b Consolidating some node-specific functionality from scripts in broctl repo. 2011-10-05 16:33:40 -05:00
Jon Siwek
357341c887 Changing some external testing scripts.
- The absolute path canonifier was overzealously canonifying relevant
  log fields, so it's no longer generally applied to diffing all
  baselines.  I don't think there's any logs that require local
  filesystem path names that aren't already tested by a unit test,
  but if any show up in the future, they can be canonified on a
  case-by-case basis.

- Removed some logs from being diff'd in the diff-all script
  because they're either already covered by a unit test
  (load_scripts.log) or because of difficulty/maintainenance
  tradeoff (prof.log).

Baselines for the external bro-testing repo still need updating.
2011-10-04 10:51:41 -05:00
Jon Siwek
8099640bc3 Fix the way HTTP tests were checking for weirds 2011-09-30 08:21:33 -05:00
Jon Siwek
71dc6b6de3 Fixing unit tests. 2011-09-30 07:53:23 -05:00
Seth Hall
012d8cfc5f Fix for shutdown bug in http scripts.
- The bug was introduced with the recent 1xx update.

- I updated some tests that seemed be written wrong.
2011-09-29 21:25:00 -04:00
Seth Hall
36dbaa5b92 Loaded scripts is indented with spaces now and makes more sense to look at.
- Updated a test to make it pass again.
2011-09-29 15:53:54 -04:00
Robin Sommer
4d6a90ce89 Merge remote-tracking branch 'origin/topic/jsiwek/http-1xx-replies'
* origin/topic/jsiwek/http-1xx-replies:
  Change logging of HTTP 1xx responses to occur in their own columns.
  Fix handling of HTTP 1xx response codes (addresses #411).
2011-09-28 17:10:40 -07:00
Robin Sommer
a84a422240 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Various unit test cleanup.
2011-09-28 16:54:23 -07:00
Jon Siwek
7af3977a50 Change logging of HTTP 1xx responses to occur in their own columns.
Instead of as entirely new log lines (addresses #411).
2011-09-27 14:15:23 -05:00
Jon Siwek
a71ab223c4 Various unit test cleanup.
Updated README and collected coverage-related tests in a common dir.

There are still coverage failures resulting from either the following
scripts not being @load'd in the default bro mode:

base/frameworks/time-machine/notice.bro
base/protocols/http/partial-content.bro
base/protocols/rpc/main.bro

Or the following result in errors when @load'd:

policy/protocols/conn/scan.bro
policy/hot.conn.bro

If these are all scripts-in-progress, can we move them all to live
outside the main scripts/ directory until they're ready?
2011-09-27 12:41:30 -05:00
Jon Siwek
64e821624b Fix handling of HTTP 1xx response codes (addresses #411).
Changed the parser to not treat 1xx response codes as a final answer
to an unanswered request -- a later response is still expected.

The scripting layer will also not finish a request-reply pair when
seeing 1xx's, instead it logs both the 1xx and final response messages
with associated information of the current request as they're seen.
2011-09-26 17:37:29 -05:00
Robin Sommer
03ffce66fe Merge branch 'master' of ssh://git.bro-ids.org/bro 2011-09-25 14:15:52 -07:00
Seth Hall
827dcea586 Updating some test baselines.
- I see 5 broken tests currently.
2011-09-25 08:09:37 -04:00
Robin Sommer
d289db34db Communication fix and extension.
- Removing unnecessary log flushing. Closes #498.

- Adding new BiF disconnect() that shuts a connection to a peer down.

- terminate_connection() now first flushes any still buffered log
  messages.
2011-09-24 21:23:25 -07:00
Robin Sommer
a2edff9385 Updating baselines. 2011-09-22 19:52:11 -07:00
Robin Sommer
c9b9bab473 Merge remote-tracking branch 'origin/topic/seth/notice-suppression'
* origin/topic/seth/notice-suppression:
  Updated a notice related baseline and added a necessary @load line.
  Notice suppression clean up and notice/cluster integrtion fixes.
  Updates for notice suppression to use the &create_expire attribute
  Small, mostly cosmetic updates and fixing a test.
  Fix crash on exit (addresses #607).
  Duplicate notice suppression.

Closes #623.
2011-09-22 19:20:34 -07:00
Jon Siwek
d2118200ea Fixing unit tests and some minor bugs. 2011-09-22 12:42:16 -05:00
Seth Hall
d18fdef2d4 Merge remote-tracking branch 'origin/master' into topic/seth/notice-suppression 2011-09-21 02:26:19 -04:00
Seth Hall
664500226e Updated a notice related baseline and added a necessary @load line. 2011-09-20 12:19:22 -04:00
Seth Hall
412cdb16a0 Notice suppression clean up and notice/cluster integrtion fixes.
- Worker raised notices are printed a single time by the manager now.

- Cluster/notices integration cleaned up.

- New tests for cluster/notice integration.

- Notice suppression fixes and tests.
2011-09-19 12:05:13 -04:00
Seth Hall
acbfb6a425 Updates for notice suppression to use the &create_expire attribute
- The table tracking notice suppressions is now done with a table
  attribute instead of "manually" with scheduled events.

- The $suppress_for field can be set within PolicyItem's now too to
  affect the suppression interval through the notice policy.
2011-09-19 10:32:07 -04:00
Robin Sommer
c2e432c5fa Merge remote-tracking branch 'origin/topic/jsiwek/path-func-record-demote'
* origin/topic/jsiwek/path-func-record-demote:
  Fix filter path_func to allow record argument as a subset of stream's columns.

Conflicts:
	src/LogMgr.cc

Closes #600.
2011-09-15 16:45:41 -07:00
Robin Sommer
62581ede31 Merge remote-tracking branch 'origin/topic/jsiwek/filter-rotation'
* origin/topic/jsiwek/filter-rotation:
  Remove Log::rotation_control (addresses #572).
  Add an optional Log::RotationControl to Log::Filter records.

Closes #572.
2011-09-15 16:28:13 -07:00
Robin Sommer
8d10a76eba Merge remote-tracking branch 'origin/topic/jsiwek/index-opt-record'
* origin/topic/jsiwek/index-opt-record:
  Fix indexing for record types with optional fields

Closes #378.
2011-09-15 16:08:59 -07:00
Robin Sommer
9ee8a9f806 Testing/external scripts no longer compute MD5 checksums for SMTP
entities.

Before, whether they did depended on libmagic. To do that,
smpt/entities.bro gets a new option `never_calc_md5`.

Also restructuring the tests a bit so that load a common
testing-setup.bro scripts that can set a global configuration.
2011-09-15 15:42:10 -07:00
Robin Sommer
4bc18bd3f2 External tests no longer include the full content of mismatching files
in the diagnostics output.
2011-09-15 15:17:31 -07:00
Robin Sommer
ad313a8412 Updating test baselines for recent HTTP output changes. 2011-09-15 15:04:14 -07:00
Seth Hall
8006f26db2 Merge remote-tracking branch 'origin/master' into topic/seth/notice-suppression 2011-09-15 00:27:57 -04:00
Robin Sommer
6ffde1abc2 Updating baselines and testing helper script. 2011-09-12 12:12:47 -07:00
Seth Hall
e0af4f6e8d Small, mostly cosmetic updates and fixing a test.
- The test needed to append the second notice the event queue so that
  the notice would be suppressed correctly.

- Setting $suppress_for manually in apply_policy since it doesn't pick
  up the &default when directly creating the record inside the NOTICE call.
2011-09-12 15:08:25 -04:00
Robin Sommer
83783c5ca7 Bugfix for log writer.
It didn't escape binary stuff in some situations.

Closes #585.
2011-09-11 21:33:09 -07:00
Seth Hall
2d85ab9818 Duplicate notice suppression.
- Duplicate notices are discovered with the new Notice::Info
  field $identifier.  It's a string that is left up to the
  notice implementor to define which would indicate a
  fundamentally duplicate notice.  The field is optional and
  if it's not included it's not possible for notice
  suppression to take place.

- Duplicate notices are suppressed by default for the interval
  defined by the Notice::default_suppression_interval variable
  (1 hour by default).

- A new notice action was defined ACTION_NO_SUPPRESS to prevent
  suppression for a specific notice instance.  A convenience set
  named not_suppressed_types was also created to not suppress
  entire notice types.

- A new field was added to the PolicyItem type to modify the length
  of time a notice should be suppressed if the predicate matches.
  The field is named $suppress_for.  This name makes the code more
  readable like this: $suppress_for = 1day

- New events were created to give visibility into the notice
  framework's suppression activity.
  - event Notice::begin_suppression(n: Notice::Info)
  - event Notice::suppressed(n: Notice::Info)
  - event Notice::end_suppression(n: Notice::Info)

- The suppression.bro script doesn't have a baseline because
  it is causing a segfault in Bro.  This one test is the
  reason that this is being integrated into a branch instead
  of master.
2011-09-11 08:44:48 -04:00
Jon Siwek
7ff2a3e115 Fix filter path_func to allow record argument as a subset of stream's columns.
This required adding the ability for RecordVal::CoerceTo functions to
optionally allow orphaning fields.  The default is to not allow it, but
now before writing to a log, the value of the stream's columns is coerced
down, if necessary, before passing it on to the filter's path_func.

Addresses #600.
2011-09-09 14:57:22 -05:00
Robin Sommer
5e1ec1c50e Fix for proxy usage. 2011-09-09 11:56:44 -07:00
Robin Sommer
cb2cb117d0 Excluding log fields of name mime_type for comparision.
This is because libmagic can return different results depending on
installation.

Note, this still doesn't fix all problems: smtp-entities sets md5
depending on the mime-type returned by libmagic ...
2011-09-09 11:41:03 -07:00
Jon Siwek
eb3c5ee1a4 Fix indexing for record types with optional fields
Addresses #378
2011-09-09 13:06:45 -05:00
Robin Sommer
3a3f58d5df Bugfix for trace updater. 2011-09-08 19:21:52 -07:00
Robin Sommer
7a989c476d Test infrastructure fixes.
- A new helper script to btest-diff a bunch of files simulatiously.

- Fixes to btest.cfg.

- A few further script updates.
2011-09-08 18:50:51 -07:00
Robin Sommer
07dd8eb952 Merge branch 'master' of ssh://git.bro-ids.org/bro 2011-09-08 15:04:38 -07:00