data_importer/db/seeds.rb

80 lines
1.9 KiB
Ruby
Raw Normal View History

2022-03-30 22:12:56 -05:00
# 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)
2022-04-09 23:08:48 -05:00
require '/data_importer/lib/importers/cpe_importer.rb'
require '/data_importer/lib/importers/cve_list_importer.rb'
require '/data_importer/lib/importers/poc_in_github_importer.rb'
require '/data_importer/lib/importers/inthewild_cve_exploit_importer.rb'
require '/data_importer/lib/importers/trickest_poc_cve_importer.rb'
require '/data_importer/lib/importers/cvemon_cve_importer.rb'
require '/data_importer/lib/importers/cna_importer.rb'
2022-04-11 18:45:02 -05:00
require '/data_importer/lib/importers/github_advisory_importer.rb'
require '/data_importer/lib/importers/github_user_importer.rb'
2022-04-04 13:18:03 -05:00
def line_sep
puts '----------' * 12
end
def perform
import_cves
import_github_pocs
import_trickest_poc_cves
2022-04-06 02:35:02 -05:00
import_inthewild_cve_exploits
2022-04-07 04:32:08 -05:00
import_cvemon_cves
import_cpes
2022-04-07 18:15:21 -05:00
import_cnas
2022-04-11 18:45:02 -05:00
import_github_advisories
import_github_usernames
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
2022-04-11 18:45:02 -05:00
def import_github_advisories
line_sep
GithubAdvisoryImporter.new.import
end
def import_github_usernames
line_sep
GithubUserImporter.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
2022-04-07 04:32:08 -05:00
def import_cvemon_cves
line_sep
CvemonCveImporter.new.import
end
2022-04-07 18:15:21 -05:00
def import_cnas
line_sep
CnaImporter.new.import
end
2022-04-06 02:35:02 -05:00
perform