line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cikl::Models::Event; |
2
|
1
|
|
|
1
|
|
60660
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
993
|
use Mouse; |
|
1
|
|
|
|
|
35704
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
399
|
use Mouse::Util::TypeConstraints; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
709
|
use Cikl::DataTypes::LowerCaseStr; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
595
|
use Cikl::DataTypes::Integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
8
|
1
|
|
|
1
|
|
436
|
use Cikl::DataTypes::PortList; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
9
|
1
|
|
|
1
|
|
547
|
use Cikl::Models::AddressRole; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
10
|
1
|
|
|
1
|
|
447
|
use Cikl::AddressBuilder qw/create_address/; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
114
|
|
11
|
1
|
|
|
1
|
|
10
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has 'group' => ( |
14
|
|
|
|
|
|
|
is => 'rw', |
15
|
|
|
|
|
|
|
isa => 'Cikl::DataTypes::LowerCaseStr', |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'assessment' => ( |
20
|
|
|
|
|
|
|
is => 'rw', |
21
|
|
|
|
|
|
|
isa => 'Cikl::DataTypes::LowerCaseStr', |
22
|
|
|
|
|
|
|
required => 1, |
23
|
|
|
|
|
|
|
coerce => 1 |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has 'description' => ( |
27
|
|
|
|
|
|
|
is => 'rw', |
28
|
|
|
|
|
|
|
isa => 'Cikl::DataTypes::LowerCaseStr', |
29
|
|
|
|
|
|
|
default => sub { 'unknown' }, |
30
|
|
|
|
|
|
|
coerce => 1 |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has 'address' => ( |
34
|
|
|
|
|
|
|
is => 'rw', |
35
|
|
|
|
|
|
|
does => 'Cikl::Models::AddressRole' |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
has 'detecttime' => ( |
39
|
|
|
|
|
|
|
is => 'rw', |
40
|
|
|
|
|
|
|
isa => "Cikl::DataTypes::Integer", |
41
|
|
|
|
|
|
|
coerce => 1 |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has 'reporttime' => ( |
45
|
|
|
|
|
|
|
is => 'rw', |
46
|
|
|
|
|
|
|
isa => "Cikl::DataTypes::Integer", |
47
|
|
|
|
|
|
|
coerce => 1 |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
has 'alternativeid' => (is => 'rw'); |
51
|
|
|
|
|
|
|
has 'alternativeid_restriction' => (is => 'rw'); |
52
|
|
|
|
|
|
|
has 'confidence' => ( |
53
|
|
|
|
|
|
|
is => 'rw', |
54
|
|
|
|
|
|
|
isa => 'Cikl::DataTypes::Integer', |
55
|
|
|
|
|
|
|
coerce => 1 |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
has 'hash' => (is => 'rw'); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
has 'malware_md5' => (is => 'rw'); |
60
|
|
|
|
|
|
|
has 'malware_sha1' => (is => 'rw'); |
61
|
|
|
|
|
|
|
has 'md5' => (is => 'rw'); |
62
|
|
|
|
|
|
|
has 'sha1' => (is => 'rw'); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has 'portlist' => ( |
65
|
|
|
|
|
|
|
is => 'rw', |
66
|
|
|
|
|
|
|
isa => 'Cikl::DataTypes::PortList' |
67
|
|
|
|
|
|
|
); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
has 'protocol' => (is => 'rw'); |
70
|
|
|
|
|
|
|
has 'restriction' => (is => 'rw'); |
71
|
|
|
|
|
|
|
has 'severity' => (is => 'rw'); |
72
|
|
|
|
|
|
|
has 'source' => (is => 'rw'); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
has 'cc' => (is => 'rw'); |
75
|
|
|
|
|
|
|
has 'rir' => (is => 'rw'); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub to_hash { |
78
|
0
|
|
|
0
|
0
|
|
my $ret = { %{$_[0]} }; |
|
0
|
|
|
|
|
|
|
79
|
0
|
0
|
|
|
|
|
if ($ret->{address}) { |
80
|
0
|
|
|
|
|
|
$ret->{address} = $ret->{address}->to_hash(); |
81
|
|
|
|
|
|
|
} |
82
|
0
|
|
|
|
|
|
return $ret; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub from_hash { |
86
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
87
|
0
|
|
|
|
|
|
my $data = shift; |
88
|
0
|
|
|
|
|
|
my $address = $data->{address}; |
89
|
0
|
0
|
|
|
|
|
if ($address) { |
90
|
0
|
|
|
|
|
|
my $type = (keys %$address)[0]; |
91
|
0
|
0
|
|
|
|
|
if ($type) { |
92
|
0
|
|
|
|
|
|
$address = create_address($type, $address->{$type}); |
93
|
0
|
|
|
|
|
|
$data->{address} = $address; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
} |
96
|
0
|
|
|
|
|
|
return $class->new($data); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1; |