File Coverage

blib/lib/STIX/Observable/Software.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::Observable::Software;
2              
3 24     24   565 use 5.010001;
  24         107  
4 24     24   150 use strict;
  24         49  
  24         682  
5 24     24   146 use warnings;
  24         53  
  24         1413  
6 24     24   168 use utf8;
  24         63  
  24         188  
7              
8 24     24   987 use STIX::Common::List;
  24         64  
  24         828  
9 24     24   143 use STIX::Common::OpenVocabulary;
  24         47  
  24         930  
10 24     24   150 use Types::Standard qw(Str);
  24         66  
  24         301  
11 24     24   76582 use Types::TypeTiny qw(ArrayLike);
  24         65  
  24         196  
12              
13 24     24   13774 use Moo;
  24         68  
  24         213  
14 24     24   12239 use namespace::autoclean;
  24         66  
  24         303  
15              
16             extends 'STIX::Observable';
17              
18 24         2627 use constant SCHEMA =>
19 24     24   2852 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/software.json';
  24         63  
20              
21 24         1860 use constant PROPERTIES => (
22             qw(type id),
23             qw(spec_version object_marking_refs granular_markings defanged extensions),
24             qw(name cpe swid languages vendor version)
25 24     24   167 );
  24         80  
26              
27 24     24   197 use constant STIX_OBJECT => 'SCO';
  24         57  
  24         1285  
28 24     24   158 use constant STIX_OBJECT_TYPE => 'software';
  24         54  
  24         5194  
29              
30             has name => (is => 'rw', isa => Str, required => 1);
31             has cpe => (is => 'rw', isa => Str);
32             has swid => (is => 'rw', isa => Str);
33             has languages => (is => 'rw', isa => ArrayLike [Str], default => sub { STIX::Common::List->new });
34             has version => (is => 'rw', isa => Str);
35             has vendor => (is => 'rw', isa => Str);
36              
37             1;
38              
39             =encoding utf-8
40              
41             =head1 NAME
42              
43             STIX::Observable::Software - STIX Cyber-observable Object (SCO) - Software
44              
45             =head1 SYNOPSIS
46              
47             use STIX::Observable::Software;
48              
49             my $software = STIX::Observable::Software->new();
50              
51              
52             =head1 DESCRIPTION
53              
54             The Software Object represents high-level properties associated with
55             software, including software products.
56              
57              
58             =head2 METHODS
59              
60             L inherits all methods from L
61             and implements the following new ones.
62              
63             =over
64              
65             =item STIX::Observable::Software->new(%properties)
66              
67             Create a new instance of L.
68              
69             =item $software->cpe
70              
71             Specifies the Common Platform Enumeration (CPE) entry for the software, if
72             available. The value for this property MUST be a CPE v2.3 entry from the
73             official NVD CPE Dictionary.
74              
75             =item $software->id
76              
77             =item $software->languages
78              
79             Specifies the languages supported by the software. The value of each list
80             member MUST be an ISO 639-2 language code.
81              
82             =item $software->name
83              
84             Specifies the name of the software.
85              
86             =item $software->swid
87              
88             Specifies the Software Identification (SWID) Tags entry for the software,
89             if available.
90              
91             =item $software->type
92              
93             The value of this property MUST be C.
94              
95             =item $software->vendor
96              
97             Specifies the name of the vendor of the software.
98              
99             =item $software->version
100              
101             Specifies the version of the software.
102              
103             =back
104              
105              
106             =head2 HELPERS
107              
108             =over
109              
110             =item $software->TO_JSON
111              
112             Encode the object in JSON.
113              
114             =item $software->to_hash
115              
116             Return the object HASH.
117              
118             =item $software->to_string
119              
120             Encode the object in JSON.
121              
122             =item $software->validate
123              
124             Validate the object using JSON Schema
125             (see L).
126              
127             =back
128              
129              
130             =head1 SUPPORT
131              
132             =head2 Bugs / Feature Requests
133              
134             Please report any bugs or feature requests through the issue tracker
135             at L.
136             You will be notified automatically of any progress on your issue.
137              
138             =head2 Source Code
139              
140             This is open source software. The code repository is available for
141             public review and contribution under the terms of the license.
142              
143             L
144              
145             git clone https://github.com/giterlizzi/perl-STIX.git
146              
147              
148             =head1 AUTHOR
149              
150             =over 4
151              
152             =item * Giuseppe Di Terlizzi
153              
154             =back
155              
156              
157             =head1 LICENSE AND COPYRIGHT
158              
159             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
160              
161             This is free software; you can redistribute it and/or modify it under
162             the same terms as the Perl 5 programming language system itself.
163              
164             =cut