Skip to content
Snippets Groups Projects
Select Git revision
  • fb78bd2dd93a8ab3df808eeabd9ca4456927abbc
  • 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

validate-schema.ts

Blame
  • WardenClientSend.pm 3.18 KiB
    #!/usr/bin/perl -w
    #
    # WardenClientSend.pm
    #
    # Copyright (C) 2011-2012 Cesnet z.s.p.o
    #
    # Use of this source is governed by a BSD-style license, see LICENSE file.  
    
    package WardenClientSend;
    
    use strict;
    use SOAP::Lite;
    use IO::Socket::SSL qw(debug1);
    use SOAP::Transport::HTTP;
    use Sys::Syslog;
    
    our $VERSION = "2.2";
    
    #-------------------------------------------------------------------------------
    # saveNewEvent - send new event from detection scripts to warden server
    #-------------------------------------------------------------------------------
    sub saveNewEvent
    {
      my $result;
    
        my $warden_path = shift;
        my $event_ref = shift;
    
        my $etcdir = $warden_path . "/etc/";
        my $libdir = $warden_path . "/lib/";
    
        require $libdir . "WardenClientConf.pm";
        require $libdir . "WardenClientCommon.pm";  
    
        # read the config file
        my $conf_file = $etcdir . "warden-client.conf";
        WardenClientConf::loadConf($conf_file);
    
        # prepare variables of event 
        my @event        = @{$event_ref};
        my $service      = $event[0];
        my $detected     = $event[1];
        my $type         = $event[2];
        my $source_type  = $event[3];
        my $source       = $event[4];
        my $target_proto = $event[5];
        my $target_port  = $event[6];
        my $attack_scale = $event[7];
        my $note         = $event[8];
        my $priority     = $event[9];
        my $timeout      = $event[10];
    
        # Issue #596 - Should be removed in Warden client 3.0.
        # Checking for obsolete attributes priority or timeout. If not default or 'undef' values are found, print out warning.
    
        # check if obsolete event attribute Priority is used
        if ((defined $priority) && ($priority >= 1)) {
          # print warning
          WardenClientCommon::errMsg('Event attribute "Priority" is now obsolete and will be removed in Warden client 3.0', 'warn');
        }
    
        # check if obsolete event attribute Timeout is used
        if ((defined $timeout) && ($timeout >= 0)) {
          # print warning
          WardenClientCommon::errMsg('Event attribute "Timeout" is now obsolete and will be removed in Warden client 3.0', 'warn');
        }
       
        # end of Issue #596