From 1045a44ddc61b2f2ffe0182c35be3fbb07be222f Mon Sep 17 00:00:00 2001 From: kenna-bmcdevitt Date: Tue, 27 Oct 2020 01:58:38 -0500 Subject: [PATCH] adjust reject filter --- microsoft_kb/microsoft_kb_checker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/microsoft_kb/microsoft_kb_checker.rb b/microsoft_kb/microsoft_kb_checker.rb index e67f64e..8b9223e 100644 --- a/microsoft_kb/microsoft_kb_checker.rb +++ b/microsoft_kb/microsoft_kb_checker.rb @@ -12,6 +12,8 @@ class MicrosoftKbChecker attr_accessor :options # options hash {:cve_id => 'cve-2020-1234', :os_name => 'Windows Server 2012'} + # you can also pass in an advisory number as it uses the same API endpoint + # eg... {:cve_id => 'ADV180002', :os_name => "Windows Server 2012 R2"} def initialize(options) @options = options end @@ -115,7 +117,7 @@ class MicrosoftKbChecker kbs = articles.map do |article_info| num = article_info[:article_num] os_json.values_at("articleTitle#{num}") - end.flatten.reject! { |kb| kb == '' } + end.flatten.reject { |kb| kb == '' } { os_name: os_json['name'], cve_id: options[:cve_id],