File Coverage

blib/lib/STIX/Observable/Extension/WindowsService.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::Observable::Extension::WindowsService;
2              
3 24     24   560 use 5.010001;
  24         126  
4 24     24   206 use strict;
  24         53  
  24         702  
5 24     24   140 use warnings;
  24         56  
  24         1378  
6 24     24   156 use utf8;
  24         53  
  24         200  
7              
8 24     24   1167 use STIX::Common::Enum;
  24         89  
  24         1235  
9 24     24   142 use Types::Standard qw(Str InstanceOf Enum);
  24         66  
  24         251  
10 24     24   69780 use Types::TypeTiny qw(ArrayLike);
  24         68  
  24         229  
11              
12 24     24   17298 use Moo;
  24         65  
  24         238  
13 24     24   12307 use namespace::autoclean;
  24         67  
  24         340  
14              
15             extends 'STIX::Object';
16              
17 24         2499 use constant PROPERTIES => (qw[
18             service_name
19             descriptions
20             display_name
21             group_name
22             start_type
23             service_dll_refs
24             service_type
25             service_status
26 24     24   3258 ]);
  24         79  
27              
28 24     24   184 use constant EXTENSION_TYPE => 'windows-service-ext';
  24         57  
  24         7637  
29              
30             has service_name => (is => 'rw', isa => Str);
31             has descriptions => (is => 'rw', isa => ArrayLike [Str], default => sub { STIX::Common::List->new });
32             has display_name => (is => 'rw', isa => Str);
33             has group_name => (is => 'rw', isa => Str);
34             has start_type => (is => 'rw', isa => Enum [STIX::Common::Enum->WINDOWS_SERVICE_START_TYPE()]);
35             has service_dll_refs => (
36             is => 'rw',
37             isa => ArrayLike [InstanceOf ['STIX::Observable::File']],
38             default => sub { STIX::Common::List->new }
39             );
40             has service_type => (is => 'rw', isa => Enum [STIX::Common::Enum->WINDOWS_SERVICE_TYPE()]);
41             has service_status => (is => 'rw', isa => Enum [STIX::Common::Enum->WINDOWS_SERVICE_STATUS()]);
42              
43             1;
44              
45             =encoding utf-8
46              
47             =head1 NAME
48              
49             STIX::Observable::Extension::WindowsService - STIX Cyber-observable Object (SCO) - Windows Service Extension
50              
51             =head1 SYNOPSIS
52              
53             use STIX::Observable::Extension::WindowsService;
54              
55             my $windows_service_ext = STIX::Observable::Extension::WindowsService->new();
56              
57              
58             =head1 DESCRIPTION
59              
60             The Windows Service extension specifies a default extension for capturing
61             properties specific to Windows services.
62              
63              
64             =head2 METHODS
65              
66             L inherits all methods from L
67             and implements the following new ones.
68              
69             =over
70              
71             =item STIX::Observable::Extension::WindowsService->new(%properties)
72              
73             Create a new instance of L.
74              
75             =item $windows_service_ext->service_name
76              
77             Specifies the name of the service.
78              
79             =item $windows_service_ext->descriptions
80              
81             Specifies the descriptions defined for the service.
82              
83             =item $windows_service_ext->display_name
84              
85             Specifies the displayed name of the service in Windows GUI controls.
86              
87             =item $windows_service_ext->group_name
88              
89             Specifies the name of the load ordering group of which the service is a member.
90              
91             =item $windows_service_ext->start_type
92              
93             Specifies the start options defined for the service
94             (see C in L).
95              
96             =item $windows_service_ext->service_dll_refs
97              
98             Specifies the DLLs loaded by the service, as a reference to one or more L Objects.
99              
100             =item $windows_service_ext->service_type
101              
102             Specifies the type of the service (see C in L).
103              
104             =item $windows_service_ext->service_status
105              
106             Specifies the current status of the service (see C in L).
107              
108             =back
109              
110              
111             =head2 HELPERS
112              
113             =over
114              
115             =item $windows_service_ext->TO_JSON
116              
117             Helper for JSON encoders.
118              
119             =item $windows_service_ext->to_hash
120              
121             Return the object HASH.
122              
123             =item $windows_service_ext->to_string
124              
125             Encode the object in JSON.
126              
127             =item $windows_service_ext->validate
128              
129             Validate the object using JSON Schema (see L).
130              
131             =back
132              
133              
134             =head1 SUPPORT
135              
136             =head2 Bugs / Feature Requests
137              
138             Please report any bugs or feature requests through the issue tracker
139             at L.
140             You will be notified automatically of any progress on your issue.
141              
142             =head2 Source Code
143              
144             This is open source software. The code repository is available for
145             public review and contribution under the terms of the license.
146              
147             L
148              
149             git clone https://github.com/giterlizzi/perl-STIX.git
150              
151              
152             =head1 AUTHOR
153              
154             =over 4
155              
156             =item * Giuseppe Di Terlizzi
157              
158             =back
159              
160              
161             =head1 LICENSE AND COPYRIGHT
162              
163             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
164              
165             This is free software; you can redistribute it and/or modify it under
166             the same terms as the Perl 5 programming language system itself.
167              
168             =cut