line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Armadito::Agent::Antivirus::Eset; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3323697
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
61
|
|
5
|
1
|
|
|
1
|
|
3
|
use base 'Armadito::Agent::Antivirus'; |
|
1
|
|
|
|
|
27
|
|
|
1
|
|
|
|
|
455
|
|
6
|
1
|
|
|
1
|
|
428
|
use Try::Tiny; |
|
1
|
|
|
|
|
1194
|
|
|
1
|
|
|
|
|
49
|
|
7
|
1
|
|
|
1
|
|
510
|
use IPC::System::Simple qw(capture); |
|
1
|
|
|
|
|
9503
|
|
|
1
|
|
|
|
|
197
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
1
|
|
my ( $class, %params ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(%params); |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
$self->{name} = "Eset"; |
15
|
0
|
|
|
|
|
|
$self->{scancli_path} = $self->getScanCliPath(); |
16
|
0
|
|
|
|
|
|
$self->{version} = $self->getVersion(); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub getJobj { |
22
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return { |
25
|
|
|
|
|
|
|
name => $self->{name}, |
26
|
|
|
|
|
|
|
version => $self->{version}, |
27
|
|
|
|
|
|
|
os_info => $self->{os_info}, |
28
|
|
|
|
|
|
|
scancli_path => $self->{scancli_path} |
29
|
0
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub getVersion { |
33
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my $output = capture( $self->{scancli_path} . " --version" ); |
36
|
0
|
|
|
|
|
|
$self->{logger}->info($output); |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
if ( $output =~ m/\)\s+([0-9\.]+)$/ms ) { |
39
|
0
|
|
|
|
|
|
return $1; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return "unknown"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub getScanCliPath { |
46
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return "/opt/eset/esets/sbin/esets_scan"; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Armadito::Agent::Eset - ESET Antivirus' class. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is a base class for all stuff specific to ESET Antivirus. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 FUNCTIONS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 new ( $self, %params ) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Instanciate module. Set task's default logger. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 getJobj ( $self ) |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Return unblessed object for json encapsulation. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 getVersion ( $self ) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Return Antivirus' Version. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 getScanCliPath ( $self ) |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Return Antivirus' CLI binary scan path. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|