Skip to content
Snippets Groups Projects
README 18.3 KiB
Newer Older
+----------------------------+
| README - Warden Client 2.1 |
+----------------------------+
Tomáš Plesník's avatar
Tomáš Plesník committed

Content

 A. Overall Information
 B. Installation Dependencies
 C. Installation
 D. Update
 E. Uninstallation
 F. Configuration
 G. Registration
 H. Integration with Local Applications
 I. Functions, Arguments and Calls
Tomáš Plesník's avatar
Tomáš Plesník committed

Tomáš Plesník's avatar
Tomáš Plesník committed
--------------------------------------------------------------------------------
A. Overall Information

 1. About Warden Client
 
    Warden is a client-based architecture service designed to share detected
    security events (issues) among CSIRT and CERT teams in a simple and fast
    way.
Tomáš Plesník's avatar
Tomáš Plesník committed
    
Jan Soukal's avatar
Jan Soukal committed
    This package offers a client capable of both reporting events to server and 
    retreiving batch of new events from server. It consists of several Perl 
    modules/libraries which should be included into detection applications.
Tomáš Plesník's avatar
Tomáš Plesník committed
 
 2. Version
  
Tomáš Plesník's avatar
Tomáš Plesník committed
    
Tomáš Plesník's avatar
Tomáš Plesník committed
 
    warden-client/
      doc/
Tomáš Plesník's avatar
Tomáš Plesník committed
        example-sender.pl.txt
        example-receiver.pl.txt
	INSTALL
	LICENSE
	README
	README.cesnet
Tomáš Plesník's avatar
Tomáš Plesník committed
      etc/
        warden-client.conf
	package_version
Tomáš Plesník's avatar
Tomáš Plesník committed
      lib/
Tomáš Plesník's avatar
Tomáš Plesník committed
        WardenClientSend.pm
        WardenClientCommon.pm
Tomáš Plesník's avatar
Tomáš Plesník committed

Tomáš Plesník's avatar
Tomáš Plesník committed
--------------------------------------------------------------------------------
B. Installation Dependencies
  
    Perl                  >= 5.10.1  
    SOAP::Lite            >= 0.712
    IO::Socket::SSL       >= 1.74
    SOAP::Transport::HTTP >= 0.712
    FindBin               >= 1.50
    DateTime              >= 0.61
Tomáš Plesník's avatar
Tomáš Plesník committed
--------------------------------------------------------------------------------
C. Installation (First installation of the Warden client package)
Tomáš Plesník's avatar
Tomáš Plesník committed

 1. Check SHA1 checksum of corresponding Warden client package archive

    $ sha1sum -c warden-client-2.1.tar.gz.sig
Tomáš Plesník's avatar
Tomáš Plesník committed

 2. Untar it

    $ tar xzvf warden-client-2.1.tar.gz
Tomáš Plesník's avatar
Tomáš Plesník committed

 3. Run install.sh 
  
    Default destination directory is /opt/warden-client/
    
    For more information about install.sh options run install.sh -h

    You must be root for running this script.

 4. Installation Privileges

Jan Soukal's avatar
Jan Soukal committed
    The Warden client is designed to be run under standard privileges. It should 
    be a part of other applications that are run under usual user privileges.
    However, the Warden client uses SSL certificates for security purposes which
    are often not accessible by standard users.
Tomáš Plesník's avatar
Tomáš Plesník committed

    Install script does check the accessibility of SSL certificates to
Jan Soukal's avatar
Jan Soukal committed
    provided user. If these files are restricted, the install script will raise
    a warning. However this will not stop the install process. Either privileges
    to read them must be changed or Warden client must be run under root.
Tomáš Plesník's avatar
Tomáš Plesník committed

    Of course, after installation of Warden client, SSL certificates may also be
Jan Soukal's avatar
Jan Soukal committed
    copied to another location accessible by the user and corresponding paths
    changed in warden-client/etc/warden-client.conf.
Tomáš Plesník's avatar
Tomáš Plesník committed

 5. Configuration file

    After successful installation process you are advised to check configuration
    file warden-client/etc/warden-client.conf. For more information see section
    below F. Configuration.
    Usage: install.sh [-d <directory>] [-u <user>] [-k <ssl_key_file>]
                      [-c <ssl_cert_file>] [-a <ssl_ca_file>] [-hV]
	-d <directory>            installation directory (default: /opt)
	-u <user>                 owner of warden client package (user for
				                    running detection scripts)
	-k <ssl_key_file>         SSL certificate key file path
	-c <ssl_cert_file>        SSL certificate file path
	-a <ssl_ca_file>          CA certificate file path
	-h                        print this help
	-V                        print script version number and exit
	
    Example: # ./install.sh -d /opt -u detector -k /etc/ssl/private/client.key
    			    -c /etc/ssl/certs/client.pem -a /etc/ssl/certs"

--------------------------------------------------------------------------------
D. Update (Update of previously installed the Warden client package)
Jan Soukal's avatar
Jan Soukal committed
 1. Check SHA1 checksum of corresponding the Warden client package archive
    $ sha1sum -c warden-client-2.0.tar.gz.sig
    $ tar xzvf warden-client-2.0.tar.gz

 3. Run update.sh 
  
    Default destination directory is /opt/warden-client/
    
    For more information about update.sh options run update.sh -h

    You must be root for running this script.

 4. Configuration file

    After successful update process you are advised to check configuration
    file warden-client/etc/warden-client.conf. For more information see section

 5. Usage of update.sh

    Usage: update.sh [-d <directory>] [-hV]
        -d <directory>            destination directory (default: /opt)
        -h                        print this help
        -V                        print script version number and exit

    Example: # ./update.sh -d /opt

    Note: You must be root for running this script.


--------------------------------------------------------------------------------
 1. Run uninstall.sh 
  
    The script is located in warden-client package directory. 
    
Jan Soukal's avatar
Jan Soukal committed
    Default uninstallation directory is /opt/warden-client/.
Jan Soukal's avatar
Jan Soukal committed
    For more information about uninstall.sh options, run uninstall.sh -h.

    You must be root for running this script.

 2. Usage of uninstall.sh

    Usage: uninstall.sh [-d <directory>] [-hV]
        -d <directory>            uninstallation directory (default: /opt)
        -h                        print this help
        -V                        print script version number and exit

    Example: # ./uninstall.sh -d /opt

    Note: You must be root for running this script.
Jan Soukal's avatar
Jan Soukal committed


--------------------------------------------------------------------------------
Tomáš Plesník's avatar
Tomáš Plesník committed
    
    SOAP protocol is used for handling communication between server and clients.
Jan Soukal's avatar
Jan Soukal committed
    Therefore, correct URI of the Warden server must be set.
Tomáš Plesník's avatar
Tomáš Plesník committed

    Authentication of clients and server is performed using client and server
    SSL certificates. Both clients and server must have valid certificate.

    Configuration file contains following parameters:

Jan Soukal's avatar
Jan Soukal committed
    URI 	  - URI of the Warden server
          	    e.g. 'https://mywarden.server.com:443/Warden'
Tomáš Plesník's avatar
Tomáš Plesník committed

    SSL_KEY_FILE  - path to a host key file,
    	    	    e.g. '/opt/warden-client/etc/mywarden.server.com.key'
Tomáš Plesník's avatar
Tomáš Plesník committed

    SSL_CERT_FILE - path to a host certificate file,
     		    e.g. '/opt/warden-client/etc/mywarden.server.com.pem'
Tomáš Plesník's avatar
Tomáš Plesník committed

    SSL_CA_FILE   - path to a CA file
                    e.g. '/etc/ssl/certs/tcs-ca-bundle.pem' 

    Client receives events in batches. Maximum number of events received in one
    batch can is set in MAX_RCV_EVENTS_LIMIT. Note that this option only
    affects clients that receives events from the Warden server (e.g., uses
    lib/WardenClientReceive.pm module).

    MAX_RCV_EVENTS_LIMIT - maximum number of events in one batch    
                         - default set to 6000, which generates app. 250 MB
                           of memory consumption.
                         - only affects "receiving" clients
Jan Soukal's avatar
Jan Soukal committed
    
    Note: server is queried for the MAX_RCV_EVENTS_LIMIT number of events, 
    however server can have its own internal maximum size of batch. Contact
    your Warden server administrator if you need to know Warden server batch 
    limits.
    Option CONNECTION_TIMEOUT was added to prevent some troubles when receiving
    large batches of new data. Default value is 60 seconds.

    CONNECTION_TIMEOUT - interval in seconds to timeout connection with Warden
                         server. If your client timeouts, consider using higher
                         timeout number. Also, in case of receiving clients, you
                         can optimize the MAX_RCV_EVENTS_LIMIT value.

    Since Warden client 2.1 there is also possibility to log status and other
    information either to STDERR of Syslog.

    LOG_STDERR           - if set to 1 (default), all status information and
                           possible error will be printed to STDERR
                         - to disable, set LOG_STDERR to 0

    LOG_SYSLOG           - if set to 1, all status information and possible
                           errors will be reported to Syslog
                         - default is 0, which means that reporting to Syslog
                           is disabled
    
    LOG_SYSLOG_FACILITY  - facility to use when logging via Syslog
                         - deafult is "local7"

    LOG_VERBOSE          - when set to 1, also debug information (such as stack
                           dump) will be printed when logging.
                         - default is 0, which means that verbose mode is
                           disabled
--------------------------------------------------------------------------------
G. Registration

    Any client attempting to communicate with the Warden server must be
    registered on this server. Unknown (not registered) clients are not allowed
    to exchange any data with server.
  
    Registration of your client is provided by the Warden server administrator.
    Usually via e-mail.
  
    Clients also need to have valid client SSL certificates to prove their
    identity to the Warden server. 
  
    Each client is defined by its hostname, service name, type of client, type
    of requested events, receiving of own events, description tags and CIDR
    this client is allowed to communicate from.
  
    Hostname  hostname of client to be registered

    Service name              Text string. Unique name of the service the client
                              is integrated in.
                              E.g. 'ScanDetector_1.0'. This is mandatory for
                              'Sender' client. Default value null is used for
                              'Receiver' client.

    Type of client            Either 'Sender' or 'Receiver'.

    Type of requested events  Type of events the client only accepts from
                              the Warden server. This is mandatory only for
                              'Receiver' client. Default value null is used
                              for 'Sender' client. Brief information about
                              event types is provided in section I. Functions
                              arguments and calls.

    Receiving of own events   Enables receiving of events sent from your
                              organization domain = yes/no (organizations are
                              separated based on the top-level and
                              second-level domain). This is mandatory only
                              for 'Receiver' client.

    Description tags          Tags are case insensitive alphanumeric strings
                              designed to allow event receivers to filter
                              according to event source. For example, 
                              receiver can decide to use only events 
                              originating from honeypots or filter out events
                              generated manually by users. This is mandatory
                              for 'Sender' client.

    CIDR                      CIDR stands for IP (sub)net the client is going
                              to communicate from (see examples below!). Any
                              communications between the client and the Warden
                              server must be performed from IP address from
                              a range stated in CIDR.
                              Examples: '123.123.0.0/16', '123.123.123.123/32'

  
    For complete information about client attributes and/or event types you will
    have to contact particular Warden server administrator/provider.


Tomáš Plesník's avatar
Tomáš Plesník committed
--------------------------------------------------------------------------------       
H. Integration with Local Applications
Tomáš Plesník's avatar
Tomáš Plesník committed
 
 (Note: Clients need to be registered on server to be able to communicate with
        server properly. See section G. Registration for more information about
Tomáš Plesník's avatar
Tomáš Plesník committed
        client registration.)
 
Jan Soukal's avatar
Jan Soukal committed
 1. Client sender (this type of client reports events to the Warden server)
Tomáš Plesník's avatar
Tomáš Plesník committed
  
Jan Soukal's avatar
Jan Soukal committed
    Client is included as a Perl module (WardenClientSend.pm) into Perl code of 
    local detection application.   
Tomáš Plesník's avatar
Tomáš Plesník committed
   
    See warden-client/doc/example-sender.pl.txt for example how to use
Jan Soukal's avatar
Jan Soukal committed
    the Warden client sender.
Tomáš Plesník's avatar
Tomáš Plesník committed
    
    Brief information about syntax of sending functions and functionality is
    provided in section I. Functions, Arguments and Calls.
Tomáš Plesník's avatar
Tomáš Plesník committed
 
Jan Soukal's avatar
Jan Soukal committed
 2. Client receiver (this type of clients downloads events from the Warden 
    server)
Tomáš Plesník's avatar
Tomáš Plesník committed
 
Jan Soukal's avatar
Jan Soukal committed
    Client is included as a Perl module (WardenClientReceive.pm)
    into Perl code of local 'reaction' application or may be used as core of
Tomáš Plesník's avatar
Tomáš Plesník committed
    standalone local application.
      
    See warden-client/doc/example-receiver.pl.txt for example how to use
Jan Soukal's avatar
Jan Soukal committed
    the Warden client receiver.   
Tomáš Plesník's avatar
Tomáš Plesník committed
    
Jan Soukal's avatar
Jan Soukal committed
    Brief information about syntax of receiving functions is provided in 
    section I. Functions, Arguments and Calls. 
Tomáš Plesník's avatar
Tomáš Plesník committed


--------------------------------------------------------------------------------
Tomáš Plesník's avatar
Tomáš Plesník committed

 1. WardenClientSend::saveNewEvent
 
Jan Soukal's avatar
Jan Soukal committed
    A function to report one event to the Warden server. See example 'Sender'
Tomáš Plesník's avatar
Tomáš Plesník committed
    client in warden-client/doc/example-sender.pl.txt
    
    Function call (Perl):
    
    # Path to warden-client folder
    $warden_path = '/opt/warden-client';
    
Jan Soukal's avatar
Jan Soukal committed
    # Inclusion of the Warden client sender module
Tomáš Plesník's avatar
Tomáš Plesník committed
    require $warden_path . '/lib/WardenClientSend.pm';
    
Jan Soukal's avatar
Jan Soukal committed
    # Sending event to the Warden server
Tomáš Plesník's avatar
Tomáš Plesník committed
    WardenClientSend::saveNewEvent($warden_path, \@event);
    
Jan Soukal's avatar
Jan Soukal committed
    Event array is defined as (Perl):
Tomáš Plesník's avatar
Tomáš Plesník committed
    
    @event = ($service, $detected, $type, $source_type, $source, $target_proto,
              $target_port, $attack_scale, $note, $priority, $timeout );
Tomáš Plesník's avatar
Tomáš Plesník committed
    Event array attributes with example value and explanation on the right
    (Perl):

    # SERVICE - VARCHAR (64)
    # Name of a service detecting this event. Service must be the same with this
    # provided in 'Sender' client registration. See more about this issue in
    # section G. Registration.    
Tomáš Plesník's avatar
Tomáš Plesník committed
    $service      = "ScanDetector";

    # DETECTED - TIMESTAMP in UTC, ISO 8601
    # Date and time when was event detected.
    $detected     = "2011-07-16T19:20:30.45";
    
    # TYPE - VARCHAR (64)
    # Type of reported event. Currently supported values are:
    # darkspace   - access into honeypot segment
    # portscan    - scannig of TCP/UDP ports
    # bruteforce  - bruteforce/dictionary attack against authentication
    #               service(s)
pharook's avatar
pharook committed
    # probe       - other connection attempts (for example ICMP) or
    #               unrecognized/undecided portscan or bruteforce
Tomáš Plesník's avatar
Tomáš Plesník committed
    # spam        - unsolicited e-mail that does not have phishing-like
    #               character
    # phishing    - e-mail attempting to gather sensitive data
    # botnet_c_c  - command and control center of botnet
    # dos         - (distributed) denial of service attack
    # malware     - virus sample
    # copyright   - copyright infringement issue
    # webattack   - attack against web application
    # other       - anything that does not match any of previous categories
    $type         = "portscan";
    
    # SOURCE_TYPE - VARCHAR 64
    # Type of source of reported attack/issue. Currently supported values are:
Tomáš Plesník's avatar
Tomáš Plesník committed
    $source_type  = "IP";
    
    # SOURCE - VARCHAR 256
    # Identification of an attack source/origin according to source_type.
Tomáš Plesník's avatar
Tomáš Plesník committed
    $source       = "123.123.123.123";
    
    # TARGET_PROTO - VARCHAR 16
    # Protocol type of reported attack/issue target. Supported are all L3 and L4
Tomáš Plesník's avatar
Tomáš Plesník committed
    $target_proto = "TCP";
    
    # TARGET_PORT - INT 2
    # Port number of reported attack/issue target or 'undef'.
Tomáš Plesník's avatar
Tomáš Plesník committed
    $target_port  = "22";
    
    # ATTACK_SCALE - INT 4
    # Definition of attack scale, e.g., number of affected targets. 'undef' is also
Tomáš Plesník's avatar
Tomáš Plesník committed
    # possible when attack scale is not known or clear enough.
    $attack_scale = "1234567890";
    
    # NOTE - TEXT
    # Some important(!) note, comment or 'undef'. Also, it may contain virus
Tomáš Plesník's avatar
Tomáš Plesník committed
    # sample, phishing e-mail with headers and other accordingly to event type.
    $note         = "this threat is dangerous";
    
    # PRIORITY - INT 1
    # Note: Currently obsolete (although still supported). Will be removed in
    #       warden-client 3.0! 
    # Subjective definition of incident severity. Values 0-255 are
    # possible where 0 is the lowest priority or 'undef'.
Tomáš Plesník's avatar
Tomáš Plesník committed
    
    # TIMEOUT - INT 2
    # Note: Currently obsolete (although still supported). Will be removed in
    #       warden-client 3.0!
    # Subjective time (in minutes) or 'undef'. After this time event might be
Tomáš Plesník's avatar
Tomáš Plesník committed
    # considered timeouted.
    $timeout      = "20";

    The return value of function SaveNewEvent is 1 when an event was
    successfully received by the Warden server. Otherwise, the return value
    is 0.

Tomáš Plesník's avatar
Tomáš Plesník committed
 2.  WardenClientReceive::getNewEvents

Jan Soukal's avatar
Jan Soukal committed
    A function to download batch of events from the Warden server. Received
Tomáš Plesník's avatar
Tomáš Plesník committed
    events are stored in @events array. See example 'Receiver' client in
    warden-client/doc/example-receiver.pl.txt
    
    Function call (perl):
    
    # Path to warden-client directory
    my $warden_path = '/opt/warden-client';

    # Inclusion of warden-client receiving functionality
    require $warden_path . '/lib/WardenClientReceive.pm';

    # Definition of requested event type. Type must be the same with this
    # provided in 'Receiver' client registration. See more about this issue in
    # section G. Registration. See more about event types in section
    # I. 1. WardenClientSend::saveNewEvent
Tomáš Plesník's avatar
Tomáš Plesník committed
    $requested_type = "botnet_c_c";

Jan Soukal's avatar
Jan Soukal committed
    # Download batch of new events from the Warden server
Tomáš Plesník's avatar
Tomáš Plesník committed
    @new_events = WardenClientReceive::getNewEvents($warden_path,
                                                    $requested_type);
                                                    
Jan Soukal's avatar
Jan Soukal committed
    Structure of each received event in the event array equals to those 
    explained in section I. 1. WardenClientSend::saveNewEvent. It has one 
    additional attribute ID - unique id of this particular event (BIGINT).
Tomáš Plesník's avatar
Tomáš Plesník committed

    Amount of events received in each batch equals to MAX_RCV_EVENTS_LIMIT
    value set in warden-client/etc/warden-client.conf. For more information see
    section F. Configuration.

Tomáš Plesník's avatar
Tomáš Plesník committed
--------------------------------------------------------------------------------

Copyright (C) 2011-2012 Cesnet z.s.p.o