NVD/Update.pm

filter: Statementstmt 38.6% 17 / 44 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod 100% 9 / 9 totaltotal 46.2% 31 / 67 CC 1 SCAR 5.0
CC
1
Cov
39%
put_cve_idx_cpe
2.0
update_websec_idx_cpe
2.0
put_cwe_idx_cpe
2.0
CRAP 1.6
« NVD.pm ↑ Summary NVD/Store/DB_File.pm »
1 package NIST::NVD::Update;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use NIST::NVD::Query;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use base qw{NIST::NVD::Query};
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 =head1 NAME
13  
14 NIST::NVD::Update - Query and Update the NVD database
15  
16 =head1 VERSION
17  
18 Version 1.02.01
19  
20 =cut
21  
22 1 our $VERSION = '1.02.01';
23  
24 =head1 SYNOPSIS
25  
26 use NIST::NVD::Update;
27  
28 # use convert_nvdcve to generate these files from the XML dumps:
29 # http://nvd.nist.gov/download.cfm
30  
31 my $u = NIST::NVD::Update->new(
32 store => $some_store,
33 %args
34 );
35  
36 =head1 SUBROUTINES/METHODS
37  
38 =head2 new
39  
40 # See NIST::NVD::Storage::DB_File or NIST::NVD::Storage::SQLite3 for
41 # an example store implementation
42  
43 my $NVD_Updater =
44 NIST::NVD::Update->new( store => $store_type, %args );
45  
46 =cut
47  
48  
49 =head2 put_cve_idx_cpe
50  
51 my $result = put_cve_idx_cpe ( $cpe_urn, $cve_list )
52  
53 =cut
54  
55 0 ▶sub put_cve_idx_cpe {
Subroutine put_cve_idx_cpe: not called CC=1 SCAR=6.9
Pod documented
56 0 my $self = shift;
57 # TODO: Validate
58  
59 0 my $result = $self->{store}->put_cve_idx_cpe(@_);
60  
61 0 return $result;
62 }
63  
64 =head2 update_websec_idx_cpe
65  
66 my $result = update_websec_idx_cpe ();
67  
68 =cut
69  
70 0 ▶sub update_websec_idx_cpe {
Subroutine update_websec_idx_cpe: not called CC=1 SCAR=6.9
Pod documented
71 0 my $self = shift;
72 # TODO: Validate
73  
74 0 my $result = $self->{store}->update_websec_idx_cpe(@_);
75  
76 0 return $result;
77 }
78  
79 =head2 put_cwe_idx_cpe
80  
81 my $result = put_cwe_idx_cpe ( $cpe_urn, $cwe_id )
82  
83 =cut
84  
85 0 ▶sub put_cwe_idx_cpe {
Subroutine put_cwe_idx_cpe: not called CC=1 SCAR=6.9
Pod documented
86 0 my $self = shift;
87  
88 0 my $result = $self->{store}->put_cwe_idx_cpe(@_);
89  
90 0 return $result
91 }
92  
93 =head2 put_cwe_idx_cve
94  
95 my $result = put_cwe_idx_cve ( { NVD_ID0 => $data_about_NVD_ID[0],
96 NVD_ID1 => $data_about_NVD_ID[1],
97 # ...
98 "NVD_ID$N" => $data_about_NVD_ID[$N],
99 } )
100  
101  
102 =cut
103  
104 0 ▶sub put_cwe_idx_cve {
Subroutine put_cwe_idx_cve: not called CC=1 SCAR=6.9
Pod documented
105 0 my $self = shift;
106  
107 0 my $result = $self->{store}->put_cwe_idx_cve(@_);
108  
109 0 return $result
110 }
111  
112  
113 =head2 put_cpe
114  
115 my $result = put_cpe ( $cpe_urn )
116  
117 =cut
118  
119 0 ▶sub put_cpe {
Subroutine put_cpe: not called CC=1 SCAR=6.9
Pod documented
120 0 my $self = shift;
121 # TODO: Validate
122  
123 0 my $result = $self->{store}->put_cpe(@_);
124  
125 0 return $result;
126 }
127  
128  
129 =head2 put_nvd_entries
130  
131 my $N = lots();
132  
133 my $result = put_nvd_entries ( { NVD_ID0 => $data_about_NVD_ID[0],
134 NVD_ID1 => $data_about_NVD_ID[1],
135 # ...
136 "NVD_ID$N" => $data_about_NVD_ID[$N],
137 } )
138  
139 =cut
140  
141 0 ▶sub put_nvd_entries {
Subroutine put_nvd_entries: not called CC=1 SCAR=6.9
Pod documented
142 0 my $self = shift;
143  
144 0 my $result = $self->{store}->put_nvd_entries(@_);
145  
146 0 return $result;
147 }
148  
149 =head2 put_cwe
150  
151 $result = $self->put_cwe( cwe_id => 'CWE-42',
152 cwe_dump => $cwe_dump );
153  
154 =cut
155  
156 0 ▶sub put_cwe {
Subroutine put_cwe: not called CC=1 SCAR=6.9
Pod documented
157 0 my $self = shift;
158  
159 0 my $result = $self->{store}->put_cwe(@_);
160  
161 0 return $result;
162 }
163  
164 =head2 commit
165  
166 $result = $self->commit($commit_buffer_name);
167  
168 =cut
169  
170 0 ▶sub commit {
Subroutine commit: not called CC=1 SCAR=6.9
Pod documented
171 0 my $self = shift;
172  
173 0 my $result = $self->{store}->commit(@_);
174  
175 0 return $result;
176 }
177  
178  
179 =head2 put_cwe_data
180  
181 my $N = lots();
182  
183 my $result = put_cwe_data ( { CWE_ID0 => $data_about_CWE_ID[0],
184 CWE_ID1 => $data_about_CWE_ID[1],
185 # ...
186 "CWE_ID$N" => $data_about_CWE_ID[$N],
187 } )
188  
189 =cut
190  
191 0 ▶sub put_cwe_data {
Subroutine put_cwe_data: not called CC=1 SCAR=6.9
Pod documented
192 0 my $self = shift;
193  
194 0 my $result = $self->{store}->put_cwe_data(@_);
195  
196 0 return $result;
197 }
198  
199  
200 =head1 AUTHOR
201  
202 C.J. Collier, C<< <cjac at google.com> >>
203  
204 =head1 LICENSE AND COPYRIGHT
205  
206 Copyright (C) 2012 C.J. Adams-Collier
207 Copyright (C) 2011,2012 F5 Networks, Inc
208 Copyright (C) 2013 Washington State Guard Association
209 Copyright (C) 2022 Google, LLC
210  
211 CVE(r) and CWE(tm) are marks of The MITRE Corporation and used here with
212 permission. The information in CVE and CWE are copyright of The MITRE
213 Corporation and also used here with permission.
214  
215 Please include links for CVE(r) <http://cve.mitre.org/> and CWE(tm)
216 <http://cwe.mitre.org/> in all reproductions of these materials.
217  
218 This program is free software; you can redistribute it and/or modify it
219 under the terms of either: the GNU General Public License as published
220 by the Free Software Foundation; or the Artistic License.
221  
222 See http://dev.perl.org/licenses/ for more information.
223  
224 =cut
225  
226 1 1; # End of NIST::NVD::Update
« NVD.pm ↑ Summary NVD/Store/DB_File.pm »