Commit graph

1565 commits

Author SHA1 Message Date
Jon Siwek
f24a67d662 Move event arg. record coercion check; now only done for recv'd remote events 2011-06-27 17:11:14 -05:00
Jon Siwek
1c30ce7e23 Merge branch 'master' into topic/jsiwek/pybroccoli-fixes 2011-06-27 16:00:50 -05:00
Seth Hall
dddfc1009a Merge branch 'topic/policy-scripts-new' of ssh://git.bro-ids.org/bro into topic/policy-scripts-new 2011-06-27 15:47:37 -04:00
Seth Hall
de21409921 Renaming a poorly named notice. 2011-06-27 15:46:50 -04:00
Jon Siwek
73fa60f769 Resolving a conflict in scan.l.
Caused by changes made while working on the way loaded scripts are tracked
(commit 9de6e9170c to master branch) that
didn't take into account an unmerged commit on the policy-scripts-new branch
(56a946568a).

(re-added warning comments that were removed in the former commit since they
still seem relevant now)
2011-06-27 13:08:30 -05:00
Seth Hall
9efb27b6c6 Notice framework updates.
- Fixed problem where notices were logged even if they
  didn't have the ACTION_FILE action applied.
- New PolicyItem element, $halt.  It's used for halting
  the policy processing if a predicate returns T.
  This replaces the ACTION_STOP action.
- Initial hacky email extension mechanism.
- Removed the IDMEF line.  When that added back later
  it will likely be done more modularly.
2011-06-27 13:16:04 -04:00
Seth Hall
16b9a0e025 Fixed bug I just introduced to known-services. 2011-06-27 12:59:23 -04:00
Seth Hall
0337107a95 Known services now only logs for "normal" connections. 2011-06-27 12:46:05 -04:00
Seth Hall
4c51794874 Fix the name of the DPD log. 2011-06-27 12:44:56 -04:00
Seth Hall
4364f572df Updating the netstats script to match the new internal code. 2011-06-27 01:08:42 -04:00
Seth Hall
bdbfa2642c Removed expected_connection_timeout variable.
- expected_connection_timeout is unused and gone now.
2011-06-27 00:58:36 -04:00
Seth Hall
ab182e792e Merge remote branch 'origin/master' into topic/policy-scripts-new 2011-06-27 00:45:56 -04:00
Robin Sommer
3ddba11e87 Changing logging's default naming scheme.
We now take the enum ID name rather than the module. Closes #483.
2011-06-26 16:45:44 -07:00
Seth Hall
c070cb31da Merge remote branch 'origin/master' into topic/policy-scripts-new
Conflicts:
	policy/bro.init
	testing/btest/language/rare-events.bro
2011-06-25 23:49:20 -04:00
Robin Sommer
ed8301a4df Updating CHANGES. 2011-06-25 20:04:35 -07:00
Robin Sommer
704cc45165 Updating submodule(s). 2011-06-25 18:22:45 -07:00
Robin Sommer
a7ced3228b Removing language.rare-events test which is no longer meaningful.
It relied on the now removed netstats_update event.
2011-06-25 18:10:40 -07:00
Robin Sommer
6b9d23abb2 Applying DNS TTL patch from #368.
I've restructured/cleaned up the original patch by thomas.other a bit.
2011-06-25 17:44:56 -07:00
Robin Sommer
ded395007f Merge remote branch 'origin/topic/jsiwek/script-load-cleanup'
* origin/topic/jsiwek/script-load-cleanup:
  Cleaning up the script loading implementation.
  Fix baseline for core.conn-id (now core.conn-uid) test.
2011-06-25 17:11:54 -07:00
Robin Sommer
6d2a89f1f8 Merge remote branch 'origin/topic/seth/net-stats-bif'
* origin/topic/seth/net-stats-bif:
  Removing a stray print statement.
  Changed netstats (packet loss) handling to script-land.

Nice idea to pass the old data into a regular scheduled event!

Conflicts:
	src/event.bif
2011-06-25 17:05:15 -07:00
Robin Sommer
85f7d2e809 Merge remote branch 'origin/fastpath'
* origin/fastpath:
  Raise internal error when failing to read contents of state file with -x option

I've changed this to use error() instead of internal_error(). The
latter should only be used for logic errors that indicate a bug in
Bro. In this case, the message flags a problem that's more likely to
be external.
2011-06-25 16:44:56 -07:00
Robin Sommer
93894eed9b Overhauling the internal reporting of messages to the user.
The Logger class is now in charge of reporting all errors, warnings,
informational messages, weirds, and syslogs. All other components
route their messages through the global bro_logger singleton.

The Logger class comes with these reporting methods:

    void Message(const char* fmt, ...);
    void Warning(const char* fmt, ...);
    void Error(const char* fmt, ...);
    void FatalError(const char* fmt, ...); // Terminate Bro.
    void Weird(const char* name);
    [ .. some more Weird() variants ... ]
    void Syslog(const char* fmt, ...);
    void InternalWarning(const char* fmt, ...);
    void InternalError(const char* fmt, ...); // Terminates Bro.

See Logger.h for more information on these.

Generally, the reporting now works as follows:

    - All non-fatal message are reported in one of two ways:

        (1) At startup (i.e., before we start processing packets),
            they are logged to stderr.

        (2) During processing, they turn into events:

            event log_message%(msg: string, location: string%);
            event log_warning%(msg: string, location: string%);
            event log_error%(msg: string, location: string%);

            The script level can then handle them as desired.

            If we don't have an event handler, we fall back to
            reporting on stderr.

    - All fatal errors are logged to stderr and Bro terminates
      immediately.

    - Syslog(msg) directly syslogs, but doesn't do anything else.

The three main types of messages can also be generated on the
scripting layer via new Log::* bifs:

    Log::error(msg: string);
    Log::warning(msg: string);
    Log::message(msg: string);

These pass through the bro_logger as well and thus are handled in the
same way. Their output includes location information.

More changes:

    - Removed the alarm statement and the alarm_hook event.

    - Adapted lots of locations to use the bro_logger, including some
      of the messages that were previously either just written to
      stdout, or even funneled through the alarm mechanism.

    - No distinction anymore between Error() and RunTime(). There's
      now only one class of errors; the line was quite blurred already
      anyway.

    - util.h: all the error()/warn()/message()/run_time()/pinpoint()
      functions are gone. Use the bro_logger instead now.

    - Script errors are formatted a bit differently due to the
      changes. What I've seen so far looks ok to me, but let me know
      if there's something odd.

Notes:

    - The default handlers for the new log_* events are just dummy
      implementations for now since we need to integrate all this into
      the new scripts anyway.

    - I'm not too happy with the names of the Logger class and its
      instance bro_logger. We now have a LogMgr as well, which makes
      this all a bit confusing. But I didn't have a good idea for
      better names so I stuck with them for now.

      Perhaps we should merge Logger and LogMgr?
2011-06-25 16:40:54 -07:00
Seth Hall
663b0eed7b Merge branch 'topic/policy-scripts-new' of ssh://git.bro-ids.org/bro into topic/policy-scripts-new
Conflicts:
	policy/frameworks/notice/base.bro
2011-06-25 01:18:59 -04:00
Seth Hall
04aa03e4ab New default notice actions for emailing network admins.
- When ACTION_EMAIL_ADMIN_ORIG or ACTION_EMAIL_ADMIN_RESP
  is applied to a notice,
  the email addresses associated with the address
  are collected from the new local_admins table
  and the email is sent to all discovered email addresses.
- The site.bro script is now in the Site module.
- Some other small cleanup.
2011-06-25 01:17:09 -04:00
Seth Hall
71d6488637 New default notice action for emailing network admins.
- When ACTION_EMAIL_ADMIN is applied to a notice,
  the email addresses associated with the address
  are collected from the new local_admins table
  and the email is sent to all discovered email addresses.
- The site.bro script is now in the Site module.
- Some other small cleanup.
2011-06-25 00:57:02 -04:00
Seth Hall
09e242f98f weird.bro moved into notice framework.
- That might not be the right place to put it though.
2011-06-24 16:40:05 -04:00
Seth Hall
e19e050121 Removed a redundant and out of place mozilla CA list. 2011-06-24 16:30:36 -04:00
Seth Hall
124ae1bc41 Renamed the stream for the notice log. 2011-06-24 16:14:59 -04:00
Seth Hall
3fce0f89f2 Small consistency tweaks for the communications framework. 2011-06-24 16:14:26 -04:00
Seth Hall
77948482b6 Finishing the inactivity script. 2011-06-24 16:13:45 -04:00
Seth Hall
cb3d312d5a Intel framework test passes now. 2011-06-24 16:10:13 -04:00
Seth Hall
0b918eb140 Reorganized some of the tests for consistency. 2011-06-24 15:40:56 -04:00
Jon Siwek
adeec23201 Merge branch 'topic/policy-scripts-new' of git://git.bro-ids.org/bro into topic/policy-scripts-new 2011-06-24 13:36:49 -05:00
Jon Siwek
4f33dcf59e Updating software version parsing test.
Tweaked parsing code a bit catch a couple that were failing.
2011-06-24 13:27:35 -05:00
Seth Hall
a4ca7fef05 Merge branch 'topic/policy-scripts-new' of ssh://git.bro-ids.org/bro into topic/policy-scripts-new 2011-06-24 13:35:58 -04:00
Seth Hall
c5f683ee47 Notices actions are now accumulative.
- New log file for auditing the notice policy to
  see at a specific point in time what the fully
  ordered (by priority) notice policy was.
- New notice action "ACTION_STOP" to stop processing
  the notice policy.  This is essentially how the old
  IGNORE action can be done with the accumulative
  notices actions.  It just needs to be set as the
  $result at an at an appropriately high priority.
- No longer using the "match" statement as it didn't
  provide the flexibility to implement accumulative
  notice actions.  The functionality is now implemented
  completely in script-land.
- Beginning removal of action-filters script.
  Still need to come up with a way to implement
  some of the functionality of that script.
- Small documentation updates.
2011-06-24 13:35:48 -04:00
Seth Hall
da635c0c2c Bringing the inactivity script back. 2011-06-24 13:17:17 -04:00
Jon Siwek
ecaae75e65 Reorganize where HTTP pipelining test lives. 2011-06-24 11:25:16 -05:00
Jon Siwek
b7b3e9c5a2 Tweak known-hosts test to explicitly do local asset tracking 2011-06-24 11:22:18 -05:00
Jon Siwek
e180761eb4 Update/improve known-services test. 2011-06-24 11:18:25 -05:00
Jon Siwek
555e42fdd2 First attempt to adapt istate.events unit test to new policy scripts.
The http.log that both sides produce is the same, but the
http-related events that each serializes into events.bst
don't look equivalent when read back and cause the test to fail.
2011-06-23 11:00:03 -05:00
Jon Siwek
dc4dc7c56a Update/improve known-hosts unit test. 2011-06-22 16:50:42 -05:00
Jon Siwek
143427e35e Raise internal error when failing to read contents of state file with -x option
Instead of just exiting w/ code 0
2011-06-22 14:43:23 -05:00
Seth Hall
814f140b1a Small communication framework fixes. 2011-06-22 13:53:47 -04:00
Seth Hall
bbc1e603a9 Turn syslog off by default. 2011-06-22 13:53:09 -04:00
Jon Siwek
ea1f819b3e Update core.vlan-mpls test to use new policy scripts. 2011-06-20 16:06:44 -05:00
Jon Siwek
fc66d88a04 Updating the packet filter tests to use new policy scripts. 2011-06-20 15:56:16 -05:00
Jon Siwek
ef79ab3562 Update baseline for core.load-pkg test
I removed the diff'ing against which scripts Bro outputs as loaded
because that's going to be sensitive to changes in which scripts
get loaded by default.  What really matters is the output that shows
that Bro was able to load the script via a directory's __load__.bro
2011-06-20 14:10:02 -05:00
Jon Siwek
2bb36a7d10 Fix language.rare-events test to use new policy scripts.
DroppedPackets now goes in notice.log by default so that log is the
new baseline.
2011-06-20 13:55:44 -05:00
Jon Siwek
c1638d7172 Fix logging remote tests to use new policy script organization. 2011-06-20 13:49:30 -05:00