File Coverage

blib/lib/STIX/Observable/WindowsRegistryKey.pm
Criterion Covered Total %
statement 38 38 100.0
branch n/a
condition n/a
subroutine 13 13 100.0
pod n/a
total 51 51 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::WindowsRegistryKey;
2              
3 24     24   585 use 5.010001;
  24         125  
4 24     24   161 use strict;
  24         59  
  24         816  
5 24     24   135 use warnings;
  24         52  
  24         1649  
6 24     24   175 use utf8;
  24         86  
  24         205  
7              
8 24     24   1029 use STIX::Common::List;
  24         61  
  24         1119  
9 24     24   176 use Types::Standard qw(Str Int InstanceOf);
  24         59  
  24         296  
10 24     24   53087 use Types::TypeTiny qw(ArrayLike);
  24         70  
  24         226  
11              
12 24     24   14318 use Moo;
  24         57  
  24         226  
13 24     24   11658 use namespace::autoclean;
  24         64  
  24         282  
14              
15             extends 'STIX::Observable';
16              
17 24         2557 use constant SCHEMA =>
18 24     24   2701 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/windows-registry-key.json';
  24         57  
19              
20 24         1720 use constant PROPERTIES => (
21             qw(type id),
22             qw(spec_version object_marking_refs granular_markings defanged extensions),
23             qw(key values modified_time creator_user_ref number_of_subkeys),
24 24     24   156 );
  24         64  
25              
26 24     24   173 use constant STIX_OBJECT => 'SCO';
  24         54  
  24         1259  
27 24     24   136 use constant STIX_OBJECT_TYPE => 'windows-registry-key';
  24         51  
  24         6176  
28              
29             has key => (is => 'rw', isa => Str);
30              
31             has values => (
32             is => 'rw',
33             isa => ArrayLike [InstanceOf ['STIX::Observable::Type::WindowsRegistryValue']],
34             default => sub { STIX::Common::List->new }
35             );
36              
37             has modified_time => (
38             is => 'rw',
39             isa => InstanceOf ['STIX::Common::Timestamp'],
40             coerce => sub { ref($_[0]) ? $_[0] : STIX::Common::Timestamp->new($_[0]) },
41             );
42              
43             has creator_user_ref => (is => 'rw', isa => InstanceOf ['STIX::Observable::UserAccount']);
44             has number_of_subkeys => (is => 'rw', isa => Int);
45              
46             1;
47              
48             =encoding utf-8
49              
50             =head1 NAME
51              
52             STIX::Observable::WindowsRegistryKey - STIX Cyber-observable Object (SCO) - Windows Registry Key
53              
54             =head1 SYNOPSIS
55              
56             use STIX::Observable::WindowsRegistryKey;
57              
58             my $windows_registry_key = STIX::Observable::WindowsRegistryKey->new();
59              
60              
61             =head1 DESCRIPTION
62              
63             The Registry Key Object represents the properties of a Windows registry
64             key.
65              
66              
67             =head2 METHODS
68              
69             L inherits all methods from L
70             and implements the following new ones.
71              
72             =over
73              
74             =item STIX::Observable::WindowsRegistryKey->new(%properties)
75              
76             Create a new instance of L.
77              
78             =item $windows_registry_key->creator_user_ref
79              
80             Specifies a reference to a user account, represented as a User Account
81             Object, that created the registry key.
82              
83             =item $windows_registry_key->id
84              
85             =item $windows_registry_key->key
86              
87             Specifies the full registry key including the hive.
88              
89             =item $windows_registry_key->modified_time
90              
91             Specifies the last date/time that the registry key was modified.
92              
93             =item $windows_registry_key->number_of_subkeys
94              
95             Specifies the number of subkeys contained under the registry key.
96              
97             =item $windows_registry_key->type
98              
99             The value of this property MUST be C.
100              
101             =item $windows_registry_key->values
102              
103             Specifies the values found under the registry key.
104              
105             =back
106              
107              
108             =head2 HELPERS
109              
110             =over
111              
112             =item $windows_registry_key->TO_JSON
113              
114             Encode the object in JSON.
115              
116             =item $windows_registry_key->to_hash
117              
118             Return the object HASH.
119              
120             =item $windows_registry_key->to_string
121              
122             Encode the object in JSON.
123              
124             =item $windows_registry_key->validate
125              
126             Validate the object using JSON Schema
127             (see L).
128              
129             =back
130              
131              
132             =head1 SUPPORT
133              
134             =head2 Bugs / Feature Requests
135              
136             Please report any bugs or feature requests through the issue tracker
137             at L.
138             You will be notified automatically of any progress on your issue.
139              
140             =head2 Source Code
141              
142             This is open source software. The code repository is available for
143             public review and contribution under the terms of the license.
144              
145             L
146              
147             git clone https://github.com/giterlizzi/perl-STIX.git
148              
149              
150             =head1 AUTHOR
151              
152             =over 4
153              
154             =item * Giuseppe Di Terlizzi
155              
156             =back
157              
158              
159             =head1 LICENSE AND COPYRIGHT
160              
161             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
162              
163             This is free software; you can redistribute it and/or modify it under
164             the same terms as the Perl 5 programming language system itself.
165              
166             =cut