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],