dkindlund / honeyclient

MITRE HoneyClient Project
http://www.honeyclient.org
GNU General Public License v2.0
8 stars 4 forks source link

Improve error handling and reporting across all packages #23

Open dkindlund opened 14 years ago

dkindlund commented 14 years ago

With the exception of:

All other modules need additional error handling and reporting.

  1. For local functions, this means:
    • Replace all print statements with a $LOG->level($msg) call, where level is debug, info, warn, error, or fatal for all respective messages
    • Once the corresponding message has been logged,
      • For fatal and error messages: use Carp::croak($msg)
    • For warnings: use Carp::carp($msg)
  2. For remote SOAP calls on SOAP servers, this means:

    • Replace all print statements with a $LOG->level($msg) call, where level is debug, info, warn, error, or fatal for all respective messages
    • Once the corresponding message has been logged,
      • For fatal messages: use Carp::croak($msg)
    • For all other messages: use die SOAP::Fault()

    '''Note''': For multi-threaded SOAP functions, where faults may occur in an asynchronous operation, you need to develop a fault queuing system, such that the next asynchronous fault gets emitted when the next client makes a SOAP request.

This method is not completely ideal; however, it guarantees all faults will be reported back to '''a''' SOAP client, one fault per subsequent SOAP request. This is acceptable, since we only expect a SOAP server to service a single SOAP client. (We'll have to revisit this issue, if we ever have a SOAP server supporting multiple SOAP clients.)

For an example on how to implement this fault queuing system, see the _emitQueuedFault() and _queueFault() functions within the HoneyClient::Manager::VM package.

'''Note''': Additional sub tickets will be opened, as this issue gets resolved on a per-package basis.

dkindlund commented 14 years ago

Author: kindlund If local error/fault handling ever gets extremely complex, then we may want to use the Object Orient Exception handling that is described in this report: http://www.perl.com/pub/a/2002/11/14/exception.html

We're not using anything this complex, for now, as SOAP::Fault provides an acceptable degree of usability for remote fault handling.

dkindlund commented 14 years ago

Author: kindlund We'll have to work on this in later versions of the code, once we stabilize the core languages used.