reorganize and make a data dir for the xml
This commit is contained in:
parent
5cdf3b0704
commit
42decc7207
4 changed files with 5 additions and 6 deletions
|
@ -1,4 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# 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 'ox'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
|
|
@ -9,7 +9,7 @@ require 'pry'
|
||||||
|
|
||||||
ARGV << '-h' if ARGV.empty?
|
ARGV << '-h' if ARGV.empty?
|
||||||
|
|
||||||
data_file = './rpm-to-cve.xml'
|
data_file = './data/rpm-to-cve.xml'
|
||||||
|
|
||||||
options = {}
|
options = {}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ elsif pkg_name
|
||||||
cve_pkgs_and_adv = rhel_api_client.cve_pkg_adv(json_response)
|
cve_pkgs_and_adv = rhel_api_client.cve_pkg_adv(json_response)
|
||||||
puts JSON.pretty_generate(cve_pkgs_and_adv)
|
puts JSON.pretty_generate(cve_pkgs_and_adv)
|
||||||
elsif options[:refresh]
|
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]
|
elsif options[:cve]
|
||||||
cve = options[:cve]
|
cve = options[:cve]
|
||||||
r = rhel_api_client.cve_id(cve)
|
r = rhel_api_client.cve_id(cve)
|
||||||
|
|
|
@ -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
|
|
Loading…
Add table
Reference in a new issue