File Coverage

blib/lib/STIX/IntrusionSet.pm
Criterion Covered Total %
statement 41 41 100.0
branch n/a
condition n/a
subroutine 14 14 100.0
pod n/a
total 55 55 100.0


line stmt bran cond sub pod time code
1             package STIX::IntrusionSet;
2              
3 24     24   584 use 5.010001;
  24         112  
4 24     24   162 use strict;
  24         54  
  24         730  
5 24     24   130 use warnings;
  24         74  
  24         1504  
6 24     24   157 use utf8;
  24         54  
  24         192  
7              
8 24     24   991 use STIX::Common::List;
  24         54  
  24         863  
9 24     24   224 use STIX::Common::OpenVocabulary;
  24         74  
  24         1319  
10 24     24   157 use Types::Standard qw(Str Enum InstanceOf);
  24         48  
  24         269  
11 24     24   94419 use Types::TypeTiny qw(ArrayLike);
  24         70  
  24         206  
12              
13 24     24   17028 use Moo;
  24         545  
  24         294  
14 24     24   11830 use namespace::autoclean;
  24         143  
  24         421  
15              
16             extends 'STIX::Common::Properties';
17              
18 24         3028 use constant SCHEMA =>
19 24     24   2930 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sdos/intrusion-set.json';
  24         59  
20              
21 24         1940 use constant PROPERTIES => (
22             qw(type spec_version id created modified),
23             qw(created_by_ref revoked labels confidence lang external_references object_marking_refs granular_markings extensions),
24             qw(name description aliases first_seen last_seen goals resource_level primary_motivation secondary_motivations)
25 24     24   167 );
  24         49  
26              
27 24     24   160 use constant STIX_OBJECT => 'SDO';
  24         71  
  24         1403  
28 24     24   242 use constant STIX_OBJECT_TYPE => 'intrusion-set';
  24         57  
  24         10179  
29              
30             has name => (is => 'rw', isa => Str, required => 1);
31             has description => (is => 'rw', isa => Str);
32             has aliases => (is => 'rw', isa => ArrayLike [Str], default => sub { STIX::Common::List->new });
33              
34             has first_seen => (
35             is => 'rw',
36             isa => InstanceOf ['STIX::Common::Timestamp'],
37             coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Timestamp->new($_[0]) },
38             );
39              
40             has last_seen => (
41             is => 'rw',
42             isa => InstanceOf ['STIX::Common::Timestamp'],
43             coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Timestamp->new($_[0]) },
44             );
45              
46             has goals => (is => 'rw', isa => ArrayLike [Str], default => sub { STIX::Common::List->new });
47             has resource_level => (is => 'rw', isa => Enum [STIX::Common::OpenVocabulary->ATTACK_RESOURCE_LEVEL()]);
48             has primary_motivation => (is => 'rw', isa => Enum [STIX::Common::OpenVocabulary->ATTACK_MOTIVATION()]);
49              
50             has secondary_motivations => (
51             is => 'rw',
52             isa => ArrayLike [Enum [STIX::Common::OpenVocabulary->ATTACK_MOTIVATION()]],
53             default => sub { STIX::Common::List->new }
54             );
55              
56             1;
57              
58             =encoding utf-8
59              
60             =head1 NAME
61              
62             STIX::IntrusionSet - STIX Domain Object (SDO) - Intrusion-set
63              
64             =head1 SYNOPSIS
65              
66             use STIX::IntrusionSet;
67              
68             my $intrusion_set = STIX::IntrusionSet->new();
69              
70              
71             =head1 DESCRIPTION
72              
73             An Intrusion Set is a grouped set of adversary behavior and resources with
74             common properties that is believed to be orchestrated by a single
75             organization.
76              
77              
78             =head2 METHODS
79              
80             L inherits all methods from L
81             and implements the following new ones.
82              
83             =over
84              
85             =item STIX::IntrusionSet->new(%properties)
86              
87             Create a new instance of L.
88              
89             =item $intrusion_set->aliases
90              
91             Alternative names used to identify this Intrusion Set.
92              
93             =item $intrusion_set->description
94              
95             Provides more context and details about the Intrusion Set object.
96              
97             =item $intrusion_set->first_seen
98              
99             The time that this Intrusion Set was first seen.
100              
101             =item $intrusion_set->goals
102              
103             The high level goals of this Intrusion Set, namely, what are they trying to
104             do.
105              
106             =item $intrusion_set->id
107              
108             =item $intrusion_set->last_seen
109              
110             The time that this Intrusion Set was last seen.
111              
112             =item $intrusion_set->name
113              
114             The name used to identify the Intrusion Set.
115              
116             =item $intrusion_set->primary_motivation
117              
118             The primary reason, motivation, or purpose behind this Intrusion Set.
119             (See C in L)
120              
121             =item $intrusion_set->resource_level
122              
123             This defines the organizational level at which this Intrusion Set typically
124             works.
125             (See C in L)
126              
127             =item $intrusion_set->secondary_motivations
128              
129             The secondary reasons, motivations, or purposes behind this Intrusion Set.
130             (See C in L)
131              
132             =item $intrusion_set->type
133              
134             The type of this object, which MUST be the literal C.
135              
136             =back
137              
138              
139             =head2 HELPERS
140              
141             =over
142              
143             =item $intrusion_set->TO_JSON
144              
145             Encode the object in JSON.
146              
147             =item $intrusion_set->to_hash
148              
149             Return the object HASH.
150              
151             =item $intrusion_set->to_string
152              
153             Encode the object in JSON.
154              
155             =item $intrusion_set->validate
156              
157             Validate the object using JSON Schema (see L).
158              
159             =back
160              
161              
162             =head1 SUPPORT
163              
164             =head2 Bugs / Feature Requests
165              
166             Please report any bugs or feature requests through the issue tracker
167             at L.
168             You will be notified automatically of any progress on your issue.
169              
170             =head2 Source Code
171              
172             This is open source software. The code repository is available for
173             public review and contribution under the terms of the license.
174              
175             L
176              
177             git clone https://github.com/giterlizzi/perl-STIX.git
178              
179              
180             =head1 AUTHOR
181              
182             =over 4
183              
184             =item * Giuseppe Di Terlizzi
185              
186             =back
187              
188              
189             =head1 LICENSE AND COPYRIGHT
190              
191             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
192              
193             This is free software; you can redistribute it and/or modify it under
194             the same terms as the Perl 5 programming language system itself.
195              
196             =cut