added a method to pull down just mozilla cpes from a cve
This commit is contained in:
parent
278991912e
commit
47b51b2d87
1 changed files with 9 additions and 0 deletions
|
@ -135,6 +135,15 @@ class MozillaSecurityAdvisoryScraper
|
||||||
cpes = json.dig('matchStrings').map {|match_strings| match_strings.dig('matches')}
|
cpes = json.dig('matchStrings').map {|match_strings| match_strings.dig('matches')}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_mozilla_cpes_from_cve(cve_id)
|
||||||
|
cve_cpes = cve_cpes_from_nvd(cve_id)
|
||||||
|
cve_cpes.flat_map do |cpe_configuration|
|
||||||
|
cpe_configuration.select do |cpe_hash|
|
||||||
|
cpe_hash.dig('cpeName').start_with?('cpe:2.3:a:mozilla')
|
||||||
|
end
|
||||||
|
end.map {|cpe_h| cpe_h.dig('cpeName')}
|
||||||
|
end
|
||||||
|
|
||||||
def product_name_to_cpe
|
def product_name_to_cpe
|
||||||
# todo: record cpe translation
|
# todo: record cpe translation
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue