Skip to content
Snippets Groups Projects
Select Git revision
  • d0b5f448c5e8fe308bf45d193bc492e6c6583b57
  • master default protected
  • rednatco-v2
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • servers
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

field.ts

Blame
  • example-sender.pl.txt 1.71 KiB
    #!/usr/bin/perl -w
    #
    # Copyright (C) 2011-2012 Cesnet z.s.p.o
    #
    # Use of this source is governed by a BSD-style license, see LICENSE file.  
    
    use strict;
    use DateTime;
    
    #-------------------------------------------------------------------------------
    # Warden 2.0. Client, Sender, Example 
    #
    # Sample script using warden-client sending functionality. This example is not
    # intended to be a standalone script. It only shows how to use warden-client
    # functionality.
    #-------------------------------------------------------------------------------
    
    #-------------------------------------------------------------------------------
    # Preparation of event attributes.
    # This should be handled by detection application.
    
    
    my $local_detected = DateTime->from_epoch(epoch => time());
    
    
    my $service 		= "ScanDetector";
    my $detected 		= "$local_detected";
    my $type 		= "portscan";
    my $source_type 	= "IP";
    my $source 		= "123.123.123.123";
    my $target_proto 	= "TCP";
    my $target_port 	= "22";
    my $attack_scale 	= "1234567890";
    my $note 		= "important note or comment";
    my $priority 		= "null";
    my $timeout 		= "20";
    
    my @event 		= ($service, $detected, $type, $source_type, $source,
    			   $target_proto, $target_port, $attack_scale, $note,
    			   $priority, $timeout );
    
    #-------------------------------------------------------------------------------
    # Use of warden-client sender.
    # This code should developer add to his/her detection application
    # (with corresponding paths appropriately changed).
    
    # Path to warden-client folder
    my $warden_path = '/opt/warden-client';
    
    # Inclusion of warden-client sender module
    require $warden_path . '/lib/WardenClientSend.pm';
    
    # Sending event to Warden server
    WardenClientSend::saveNewEvent($warden_path, \@event);
    
    exit 0;