# nvd-json_feeds * [Homepage](https://github.com/postmodern/nvd-json_feeds.rb#readme) * [Issues](https://github.com/postmodern/nvd-json_feeds.rb/issues) * [Documentation](http://rubydoc.info/gems/nvd-json_feeds/frames) * [Email](mailto:postmodern.mod3 at gmail.com) ## Description Provides a Ruby API to [NVD JSON Feeds]. ## Features * Supports [NVD JSON 1.1 Schema]. * Supports recent, modified, and Year number `.gz`/`.zip` JSON feed files. * Supports parsing META feed files. * Supports downloading `.gz`/`.zip` JSON feed files. * Supports reading `.gz`/`.zip` JSON feed files, without extracting them. * Supports extracting `.gz`/`.zip` JSON feed files. * Supports parsing extracted JSON feed files. ## Examples require 'nvd/json_feeds' Access the Modified CVEs feed: NVD::JSONFeeds[:modified] # => #, # @meta= # #, # @name=:modified, # @zip= # #> Access the Recent CVEs feed: NVD::JSONFeeds[:recent] # => #, # @meta= # #, # @name=:recent, # @zip= # #> Access the year 2020 CVEs feed: NVD::JSONFeeds[2020] # => #, # @meta= # #, # @name=2020, # @zip= # #> Read the `.meta` feed file: meta = NVD::JSONFeeds[2020].meta.parse # => # # meta.size # => 67524038 meta.zip_size # => 3777141 meta.gz_size # => 3777005 meta.sha256 # => "9288B92370FC4D6E92ACB6FFDDDA378C4B9F1B3B5257105BD6D92535DA46BD55" Download the `.zip`/`.gz` feed file: zip_feed = NVD::JSONFeeds[2020].zip.download(dest) # => # gz_feed = NVD::JSONFeeds[2020].gz.download(dest) # => # Access a pre-downloaded `.zip`/`.gz` feed file: zip_feed = NVD::JSONFeeds::ZipFeedFile.new('path/to/nvdcve-1.1-2020.json.zip') # => # gz_feed = NVD::JSONFeeds::GzFeedFile.new('path/to/nvdcve-1.1-2020.json.gz') # => # Parse a `.zip`/`.gz` feed file (without extracting it): cve_feed = zip_feed.parse # => # cve_feed = gz_feed.parse # => # Extracts a `.zip`/`.gz` feed file: json_feed = zip_feed.extract(dest_dir) # => # json_feed = gz_feed.extract # => # Access a pre-extracted `.json` feed file: json_feed = NVD::JSONFeeds::JSONFeed.new('path/to/nvdcve-1.1-2020.json') # => # cve_feed = json_feed.parse # => # ## Requirements * [ruby] >= 2.7.0 * [multi_json] ~> 1.0 * [cve_schema] ~> 0.1 ## Install $ gem install nvd-json_feeds ### Gemfile gem 'nvd-json_feeds', '~> 0.1' ## Copyright Copyright (c) 2021 Hal Brodigan See {file:LICENSE.txt} for details. [NVD JSON Feeds]: https://nvd.nist.gov/vuln/data-feeds#JSON_FEEDS [NVD JSON 1.1 Schema]: https://csrc.nist.gov/schema/nvd/feed/1.1/nvd_cve_feed_json_1.1.schema [multi_json]: https://github.com/intridea/multi_json#readme [cve_schema]: https://github.com/postmodern/cve_schema.rb#readme