reorganize and make a data dir for the xml

This commit is contained in:
kenna-bmcdevitt 2020-10-30 17:12:13 -05:00
parent 5cdf3b0704
commit 42decc7207
4 changed files with 5 additions and 6 deletions

View file

@ -1,4 +1,7 @@
# frozen_string_literal: true
# this is meant to parse and query data in redhat linux rpm-to-cve.xml file
# that is posted on their security API.
# Reference: https://www.redhat.com/security/data/metrics/
require 'ox'
require 'json'

View file

@ -9,7 +9,7 @@ require 'pry'
ARGV << '-h' if ARGV.empty?
data_file = './rpm-to-cve.xml'
data_file = './data/rpm-to-cve.xml'
options = {}
@ -53,7 +53,7 @@ elsif pkg_name
cve_pkgs_and_adv = rhel_api_client.cve_pkg_adv(json_response)
puts JSON.pretty_generate(cve_pkgs_and_adv)
elsif options[:refresh]
rpm_auditer.refresh_rpm_to_cve_file('./rpm-to-cve.xml')
rpm_auditer.refresh_rpm_to_cve_file('./data/rpm-to-cve.xml')
elsif options[:cve]
cve = options[:cve]
r = rhel_api_client.cve_id(cve)

View file

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# refresh the latest rpm to cve xml mapping file from redhat security page
wget -O rpm-to-cve.xml https://www.redhat.com/security/data/metrics/rpm-to-cve.xml