| 1 | package SBOM::CycloneDX::Vulnerability::Analysis; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use SBOM::CycloneDX::Enum; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use SBOM::CycloneDX::Timestamp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | use Types::Standard qw(Str Enum InstanceOf); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | use Types::TypeTiny qw(ArrayLike); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 18 | |||||||||||
| 19 | 1 | has state => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('IMPACT_ANALYSIS_STATE')]); | |||||||||
| 20 | |||||||||||
| 21 | 1 | has justification => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('IMPACT_ANALYSIS_JUSTIFICATION')]); | |||||||||
| 22 | |||||||||||
| 23 | has response => ( | ||||||||||
| 24 | is => 'rw', | ||||||||||
| 25 | isa => ArrayLike [Enum [qw(can_not_fix will_not_fix update rollback workaround_available)]], | ||||||||||
| 26 | 0 | ▶ | default => sub { SBOM::CycloneDX::List->new } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 27 | 1 | ); | |||||||||
| 28 | |||||||||||
| 29 | 1 | has detail => (is => 'rw', isa => Str); | |||||||||
| 30 | |||||||||||
| 31 | has first_issued => ( | ||||||||||
| 32 | is => 'rw', | ||||||||||
| 33 | isa => InstanceOf ['SBOM::CycloneDX::Timestamp'], | ||||||||||
| 34 | 0 | ▶ | coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) } | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 35 | 1 | ); | |||||||||
| 36 | |||||||||||
| 37 | has last_updated => ( | ||||||||||
| 38 | is => 'rw', | ||||||||||
| 39 | isa => InstanceOf ['SBOM::CycloneDX::Timestamp'], | ||||||||||
| 40 | 0 | ▶ | coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::Timestamp->new($_[0]) } | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 41 | 1 | ); | |||||||||
| 42 | |||||||||||
| 43 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||
| 44 | |||||||||||
| 45 | 0 | my $self = shift; | |||||||||
| 46 | |||||||||||
| 47 | 0 | my $json = {}; | |||||||||
| 48 | |||||||||||
| 49 | 0 | ▶ | $json->{state} = $self->state if $self->state; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 0 | ▶ | $json->{justification} = $self->justification if $self->justification; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 0 | ▶ | $json->{response} = $self->response if $self->response; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | 0 | ▶ | $json->{detail} = $self->detail if $self->detail; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 0 | ▶ | $json->{firstIssued} = $self->first_issued if $self->first_issued; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 0 | ▶ | $json->{lastUpdated} = $self->last_updated if $self->last_updated; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | |||||||||||
| 56 | 0 | return $json; | |||||||||
| 57 | |||||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | 1 | 1; | |||||||||
| 61 | |||||||||||
| 62 | =encoding utf-8 | ||||||||||
| 63 | |||||||||||
| 64 | =head1 NAME | ||||||||||
| 65 | |||||||||||
| 66 | SBOM::CycloneDX::Vulnerability::Analysis - Impact Analysis | ||||||||||
| 67 | |||||||||||
| 68 | =head1 SYNOPSIS | ||||||||||
| 69 | |||||||||||
| 70 | SBOM::CycloneDX::Vulnerability::Analysis->new(); | ||||||||||
| 71 | |||||||||||
| 72 | |||||||||||
| 73 | =head1 DESCRIPTION | ||||||||||
| 74 | |||||||||||
| 75 | L<SBOM::CycloneDX::Vulnerability::Analysis> An assessment of the impact and | ||||||||||
| 76 | exploitability of the vulnerability. | ||||||||||
| 77 | |||||||||||
| 78 | =head2 METHODS | ||||||||||
| 79 | |||||||||||
| 80 | L<SBOM::CycloneDX::Vulnerability::Analysis> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 81 | and implements the following new ones. | ||||||||||
| 82 | |||||||||||
| 83 | =over | ||||||||||
| 84 | |||||||||||
| 85 | =item SBOM::CycloneDX::Vulnerability::Analysis->new( %PARAMS ) | ||||||||||
| 86 | |||||||||||
| 87 | Properties: | ||||||||||
| 88 | |||||||||||
| 89 | =over | ||||||||||
| 90 | |||||||||||
| 91 | =item * C<detail>, Detailed description of the impact including methods used | ||||||||||
| 92 | during assessment. If a vulnerability is not exploitable, this field should | ||||||||||
| 93 | include specific details on why the component or service is not impacted by | ||||||||||
| 94 | this vulnerability. | ||||||||||
| 95 | |||||||||||
| 96 | =item * C<first_issued>, The date and time (timestamp) when the analysis was | ||||||||||
| 97 | first issued. | ||||||||||
| 98 | |||||||||||
| 99 | =item * C<justification>, The rationale of why the impact analysis state was asserted. | ||||||||||
| 100 | |||||||||||
| 101 | =item * C<last_updated>, The date and time (timestamp) when the analysis was | ||||||||||
| 102 | last updated. | ||||||||||
| 103 | |||||||||||
| 104 | =item * C<response>, A response to the vulnerability by the manufacturer, | ||||||||||
| 105 | supplier, or project responsible for the affected component or service. | ||||||||||
| 106 | More than one response is allowed. Responses are strongly encouraged for | ||||||||||
| 107 | vulnerabilities where the analysis state is exploitable. | ||||||||||
| 108 | |||||||||||
| 109 | =item * C<state>, Declares the current state of an occurrence of a vulnerability, | ||||||||||
| 110 | after automated or manual analysis. | ||||||||||
| 111 | |||||||||||
| 112 | =back | ||||||||||
| 113 | |||||||||||
| 114 | =item $analysis->detail | ||||||||||
| 115 | |||||||||||
| 116 | =item $analysis->first_issued | ||||||||||
| 117 | |||||||||||
| 118 | =item $analysis->justification | ||||||||||
| 119 | |||||||||||
| 120 | =item $analysis->last_updated | ||||||||||
| 121 | |||||||||||
| 122 | =item $analysis->response | ||||||||||
| 123 | |||||||||||
| 124 | =item $analysis->state | ||||||||||
| 125 | |||||||||||
| 126 | =back | ||||||||||
| 127 | |||||||||||
| 128 | |||||||||||
| 129 | =head1 SUPPORT | ||||||||||
| 130 | |||||||||||
| 131 | =head2 Bugs / Feature Requests | ||||||||||
| 132 | |||||||||||
| 133 | Please report any bugs or feature requests through the issue tracker | ||||||||||
| 134 | at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 135 | You will be notified automatically of any progress on your issue. | ||||||||||
| 136 | |||||||||||
| 137 | =head2 Source Code | ||||||||||
| 138 | |||||||||||
| 139 | This is open source software. The code repository is available for | ||||||||||
| 140 | public review and contribution under the terms of the license. | ||||||||||
| 141 | |||||||||||
| 142 | L<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 143 | |||||||||||
| 144 | git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git | ||||||||||
| 145 | |||||||||||
| 146 | |||||||||||
| 147 | =head1 AUTHOR | ||||||||||
| 148 | |||||||||||
| 149 | =over 4 | ||||||||||
| 150 | |||||||||||
| 151 | =item * Giuseppe Di Terlizzi <gdt@cpan.org> | ||||||||||
| 152 | |||||||||||
| 153 | =back | ||||||||||
| 154 | |||||||||||
| 155 | |||||||||||
| 156 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 157 | |||||||||||
| 158 | This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi. | ||||||||||
| 159 | |||||||||||
| 160 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 161 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 162 | |||||||||||
| 163 | =cut | ||||||||||