File Coverage

blib/lib/STIX/Vulnerability.pm
Criterion Covered Total %
statement 32 32 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 43 43 100.0


line stmt bran cond sub pod time code
1             package STIX::Vulnerability;
2              
3 24     24   585 use 5.010001;
  24         127  
4 24     24   153 use strict;
  24         52  
  24         981  
5 24     24   166 use warnings;
  24         50  
  24         1495  
6 24     24   487 use utf8;
  24         310  
  24         252  
7              
8 24     24   1400 use Types::Standard qw(Str);
  24         53  
  24         248  
9              
10 24     24   76905 use Moo;
  24         67  
  24         200  
11 24     24   10964 use namespace::autoclean;
  24         60  
  24         272  
12              
13             extends 'STIX::Common::Properties';
14              
15 24         2799 use constant SCHEMA =>
16 24     24   2717 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sdos/vulnerability.json';
  24         59  
17              
18 24         1743 use constant PROPERTIES => (
19             qw(type spec_version id created modified),
20             qw(created_by_ref revoked labels confidence lang external_references object_marking_refs granular_markings extensions),
21             qw(name description)
22 24     24   183 );
  24         55  
23              
24 24     24   147 use constant STIX_OBJECT => 'SDO';
  24         59  
  24         1244  
25 24     24   135 use constant STIX_OBJECT_TYPE => 'vulnerability';
  24         51  
  24         3109  
26              
27             has name => (is => 'rw', isa => Str, required => 1);
28             has description => (is => 'rw', isa => Str);
29              
30             1;
31              
32             =encoding utf-8
33              
34             =head1 NAME
35              
36             STIX::Vulnerability - STIX Domain Object (SDO) - Vulnerability
37              
38             =head1 SYNOPSIS
39              
40             use STIX::Vulnerability;
41              
42             my $vulnerability = STIX::Vulnerability->new();
43              
44              
45             =head1 DESCRIPTION
46              
47             A Vulnerability is a mistake in software that can be directly used by a
48             hacker to gain access to a system or network.
49              
50              
51             =head2 METHODS
52              
53             L inherits all methods from L
54             and implements the following new ones.
55              
56             =over
57              
58             =item STIX::Vulnerability->new(%properties)
59              
60             Create a new instance of L.
61              
62             =item $vulnerability->description
63              
64             A description that provides more details and context about the
65             Vulnerability.
66              
67             =item $vulnerability->id
68              
69             =item $vulnerability->name
70              
71             The name used to identify the Vulnerability.
72              
73             =item $vulnerability->type
74              
75             The type of this object, which MUST be the literal C.
76              
77             =back
78              
79              
80             =head2 HELPERS
81              
82             =over
83              
84             =item $vulnerability->TO_JSON
85              
86             Encode the object in JSON.
87              
88             =item $vulnerability->to_hash
89              
90             Return the object HASH.
91              
92             =item $vulnerability->to_string
93              
94             Encode the object in JSON.
95              
96             =item $vulnerability->validate
97              
98             Validate the object using JSON Schema (see L).
99              
100             =back
101              
102              
103             =head1 SUPPORT
104              
105             =head2 Bugs / Feature Requests
106              
107             Please report any bugs or feature requests through the issue tracker
108             at L.
109             You will be notified automatically of any progress on your issue.
110              
111             =head2 Source Code
112              
113             This is open source software. The code repository is available for
114             public review and contribution under the terms of the license.
115              
116             L
117              
118             git clone https://github.com/giterlizzi/perl-STIX.git
119              
120              
121             =head1 AUTHOR
122              
123             =over 4
124              
125             =item * Giuseppe Di Terlizzi
126              
127             =back
128              
129              
130             =head1 LICENSE AND COPYRIGHT
131              
132             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
133              
134             This is free software; you can redistribute it and/or modify it under
135             the same terms as the Perl 5 programming language system itself.
136              
137             =cut
138