data_importer/db/seeds.rb

59 lines
No EOL
1.3 KiB
Ruby

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
require '/data_importer/lib/cpe_importer.rb'
require '/data_importer/lib/cve_list_importer.rb'
require '/data_importer/lib/poc_in_github_importer.rb'
require '/data_importer/lib/inthewild_cve_exploit_importer.rb'
require '/data_importer/lib/trickest_poc_cve_importer.rb'
require '/data_importer/lib/cvemon_cve_importer.rb'
def line_sep
puts '----------' * 12
end
def perform
import_cves
import_github_pocs
import_trickest_poc_cves
import_inthewild_cve_exploits
import_cvemon_cves
import_cpes
end
def import_cves
line_sep
CveListImporter.new.import
end
def import_cpes
line_sep
CpeImporter.download_and_import
end
def import_github_pocs
line_sep
PocInGithubImporter.new.import
end
def import_inthewild_cve_exploits
line_sep
InthewildCveExploitImporter.new.import
end
def import_trickest_poc_cves
line_sep
TrickestPocCveImporter.new.import
end
def import_cvemon_cves
line_sep
CvemonCveImporter.new.import
end
perform