Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seed CWE Authority #38

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ group :development, :test do
gem 'factory_girl_rails'
# Needs to be defined here because runtime dependencies from gemspec will not load for rspec environment
# @todo Change back to `gem 'metasploi-model', '~> <X>.<Y>.<Z>'` once metasploit-model version X.Y.Z is released to rubygems.
gem 'metasploit-model', :git => 'git://github.com/rapid7/metasploit-model.git', :tag => 'v0.5.0.module-caching'
gem 'metasploit-model', :git => 'git://github.com/rapid7/metasploit-model.git', :tag => 'v0.5.2.cwe-authority'
# rails is only used for the dummy application in spec/dummy
# restrict from rails 4.0 as it requires protected_attributes gem and other changes for compatibility
# @see https://www.pivotaltracker.com/story/show/52309083
Expand Down
58 changes: 1 addition & 57 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,7 @@
Mdm::Architecture.where(attributes).first_or_create!
end

authority_attributes = [
{
:abbreviation => 'BID',
:obsolete => false,
:summary => 'BuqTraq ID',
:url => 'http://www.securityfocus.com/bid'
},
{
:abbreviation => 'CVE',
:obsolete => false,
:summary => 'Common Vulnerabilities and Exposures',
:url => 'http://cvedetails.com'
},
{
:abbreviation => 'MIL',
:obsolete => true,
:summary => 'milw0rm',
:url => 'https://en.wikipedia.org/wiki/Milw0rm'
},
{
:abbreviation => 'MSB',
:obsolete => false,
:summary => 'Microsoft Security Bulletin',
:url => 'http://www.microsoft.com/technet/security/bulletin'
},
{
:abbreviation => 'OSVDB',
:obsolete => false,
:summary => 'Open Sourced Vulnerability Database',
:url => 'http://osvdb.org'
},
{
:abbreviation => 'PMASA',
:obsolete => false,
:summary => 'phpMyAdmin Security Announcement',
:url => 'http://www.phpmyadmin.net/home_page/security/'
},
{
:abbreviation => 'SECUNIA',
:obsolete => false,
:summary => 'Secunia',
:url => 'https://secunia.com/advisories'
},
{
:abbreviation => 'US-CERT-VU',
:obsolete => false,
:summary => 'United States Computer Emergency Readiness Team Vulnerability Notes Database',
:url => 'http://www.kb.cert.org/vuls'
},
{
:abbreviation => 'waraxe',
:obsolete => false,
:summary => 'Waraxe Advisories',
:url => 'http://www.waraxe.us/content-cat-1.html'
}
]
authority_attributes.each do |attributes|
Metasploit::Model::Authority::SEED_ATTRIBUTES.each do |attributes|
abbreviation = attributes.fetch(:abbreviation)

# abbreviation is the only unique and :null => false column, so use it to look for updates. Authority may be updated
Expand Down
2 changes: 1 addition & 1 deletion lib/metasploit_data_models/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module MetasploitDataModels
# metasploit-framework/data/sql/migrate to db/migrate in this project, not all models have specs that verify the
# migrations (with have_db_column and have_db_index) and certain models may not be shared between metasploit-framework
# and pro, so models may be removed in the future. Because of the unstable API the version should remain below 1.0.0
VERSION = '0.40.3'
VERSION = '0.40.4'
end
2 changes: 1 addition & 1 deletion metasploit_data_models.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |s|

s.add_runtime_dependency 'activerecord', '>= 3.2.13'
s.add_runtime_dependency 'activesupport'
s.add_runtime_dependency 'metasploit-model', '~> 0.5.0'
s.add_runtime_dependency 'metasploit-model', '~> 0.5.2'

if RUBY_PLATFORM =~ /java/
s.add_runtime_dependency 'jdbc-postgres'
Expand Down