Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
1dd31635
Commit
1dd31635
authored
10 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
WardenClientSend.pm sloucen do WardenClient.pm
parent
afc5a3c6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/warden-client/lib/WardenClientSend.pm
+0
-99
0 additions, 99 deletions
src/warden-client/lib/WardenClientSend.pm
with
0 additions
and
99 deletions
src/warden-client/lib/WardenClientSend.pm
deleted
100755 → 0
+
0
−
99
View file @
afc5a3c6
#!/usr/bin/perl -w
#
# WardenClientSend.pm
#
# Copyright (C) 2011-2013 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
my
$event
;
eval
{
# create SOAP data object
$event
=
SOAP::
Data
->
name
(
event
=>
\
SOAP::
Data
->
value
(
SOAP::
Data
->
name
(
SERVICE
=>
$service
),
SOAP::
Data
->
name
(
DETECTED
=>
$detected
),
SOAP::
Data
->
name
(
TYPE
=>
$type
),
SOAP::
Data
->
name
(
SOURCE_TYPE
=>
$source_type
),
SOAP::
Data
->
name
(
SOURCE
=>
$source
),
SOAP::
Data
->
name
(
TARGET_PROTO
=>
$target_proto
),
SOAP::
Data
->
name
(
TARGET_PORT
=>
$target_port
),
SOAP::
Data
->
name
(
ATTACK_SCALE
=>
$attack_scale
),
SOAP::
Data
->
name
(
NOTE
=>
$note
),
SOAP::
Data
->
name
(
PRIORITY
=>
$priority
),
SOAP::
Data
->
name
(
TIMEOUT
=>
$timeout
)
)
);
}
# end of eval
or
WardenClientCommon::
errMsg
('
Unknown error when creating SOAP data object,
'
.
$@
);
# c2s() returns undef on fail.
$result
=
WardenClientCommon::
c2s
(
$
WardenClientConf::
URI
,
$
WardenClientConf::
SSL_KEY_FILE
,
$
WardenClientConf::
SSL_CERT_FILE
,
$
WardenClientConf::
SSL_CA_FILE
,
"
saveNewEvent
",
$event
);
defined
$result
?
return
1
:
return
0
;
}
# End of saveNewEvent
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment