File Coverage

blib/lib/STIX/Observable/Extension/UnixAccount.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod n/a
total 39 39 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::Extension::UnixAccount;
2              
3 24     24   520 use 5.010001;
  24         115  
4 24     24   187 use strict;
  24         73  
  24         851  
5 24     24   167 use warnings;
  24         98  
  24         1605  
6 24     24   216 use utf8;
  24         104  
  24         226  
7              
8 24     24   1251 use Types::Standard qw(Str);
  24         64  
  24         239  
9 24     24   45403 use Types::TypeTiny qw(ArrayLike);
  24         67  
  24         194  
10              
11 24     24   16398 use Moo;
  24         68  
  24         199  
12 24     24   11058 use namespace::autoclean;
  24         71  
  24         258  
13              
14             extends 'STIX::Object';
15              
16 24         2305 use constant PROPERTIES => (qw[
17             gid
18             groups
19             home_dir
20             shell
21 24     24   2823 ]);
  24         60  
22              
23 24     24   163 use constant EXTENSION_TYPE => 'unix-account-ext';
  24         56  
  24         4606  
24              
25             has gid => (is => 'rw', isa => Str);
26             has groups => (is => 'rw', isa => ArrayLike [Str], default => sub { STIX::Common::List->new });
27             has home_dir => (is => 'rw', isa => Str);
28             has shell => (is => 'rw', isa => Str);
29              
30             1;
31              
32             =encoding utf-8
33              
34             =head1 NAME
35              
36             STIX::Observable::Extension::UnixAccount - STIX Cyber-observable Object (SCO) - UNIX Account Extension
37              
38             =head1 SYNOPSIS
39              
40             use STIX::Observable::Extension::UnixAccount;
41              
42             my $unix_account_ext = STIX::Observable::Extension::UnixAccount->new();
43              
44              
45             =head1 DESCRIPTION
46              
47             The User Account Object defines the following extensions. In addition to these,
48             producers MAY create their own.
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::Observable::Extension::UnixAccount->new(%properties)
59              
60             Create a new instance of L.
61              
62             =item $unix_account_ext->gid
63              
64             Specifies the primary group ID of the account.
65              
66             =item $unix_account_ext->groups
67              
68             Specifies a list of names of groups that the account is a member of.
69              
70             =item $unix_account_ext->home_dir
71              
72             Specifies the home directory of the account.
73              
74             =item $unix_account_ext->shell
75              
76             Specifies the account’s command shell.
77              
78             =back
79              
80              
81             =head2 HELPERS
82              
83             =over
84              
85             =item $unix_account_ext->TO_JSON
86              
87             Helper for JSON encoders.
88              
89             =item $unix_account_ext->to_hash
90              
91             Return the object HASH.
92              
93             =item $unix_account_ext->to_string
94              
95             Encode the object in JSON.
96              
97             =item $unix_account_ext->validate
98              
99             Validate the object using JSON Schema (see L).
100              
101             =back
102              
103              
104             =head1 SUPPORT
105              
106             =head2 Bugs / Feature Requests
107              
108             Please report any bugs or feature requests through the issue tracker
109             at L.
110             You will be notified automatically of any progress on your issue.
111              
112             =head2 Source Code
113              
114             This is open source software. The code repository is available for
115             public review and contribution under the terms of the license.
116              
117             L
118              
119             git clone https://github.com/giterlizzi/perl-STIX.git
120              
121              
122             =head1 AUTHOR
123              
124             =over 4
125              
126             =item * Giuseppe Di Terlizzi
127              
128             =back
129              
130              
131             =head1 LICENSE AND COPYRIGHT
132              
133             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
134              
135             This is free software; you can redistribute it and/or modify it under
136             the same terms as the Perl 5 programming language system itself.
137              
138             =cut