metasploit-model 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33abd16455058ed7a3e80b262aa179eb63f717e5
4
- data.tar.gz: b06dd66e1b8fd11133e5c9807ce88a358a207ebc
3
+ metadata.gz: c017ede1f3cdd0741b4c17b2ed709fff41896ee4
4
+ data.tar.gz: dee2a3fd5bd860a98500ff48677e12966d608d96
5
5
  SHA512:
6
- metadata.gz: d12399ecf2492ba0f99338a34cb736096f475b7bddd1624420af2063d94ed2af3c7459d86cc5587525fc93908dce056949306315bc5871849f3cf61b9e3cfa2b
7
- data.tar.gz: d3b4b50fa2668bd2c9c943c3e4777497f9eb851e6739908b06a5ae7803635170806c918e21e5457cc0c5394e275334c387dc7e37b6162aab3e0c36c6da187578
6
+ metadata.gz: bd51e30cc23e4810e26ea5554ce36fca71674baf6aadf149896d3643568c5b3a78646444cc73b9fe1f502b46464a5cf63fc752e19c36e506adcfb7d9e819935a
7
+ data.tar.gz: 00d6c1984e1ff4ce277407a6fcb2fc194823d0f02c3e946a9d923164d8f8a4b6dee57275f5c1f6ac764fb154194b7da05fa26a51cd71560ff01b85755496dd40
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.gitignore CHANGED
@@ -25,3 +25,5 @@ Gemfile.lock
25
25
  pkg/*
26
26
  # Database configuration (with passwords) for specs
27
27
  spec/dummy/config/database.yml
28
+ # Secrets
29
+ spec/dummy/config/secrets.yml
@@ -10,4 +10,7 @@ addons:
10
10
  language: ruby
11
11
  rvm:
12
12
  - 2.2.4
13
+ before_script:
14
+ - cp spec/dummy/config/database.yml.travis spec/dummy/config/database.yml
15
+ - bundle exec rake db:setup
13
16
  script: bundle exec rake spec yard
data/Gemfile CHANGED
@@ -3,14 +3,11 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in metasploit-model.gemspec
4
4
  gemspec
5
5
 
6
- # gem 'metasploit-yard', github: 'rapid7/metasploit-yard', branch: 'staging/rails-upgrade'
7
- # gem 'metasploit-erd', github: 'rapid7/metasploit-erd', branch: 'staging/rails-upgrade'
8
-
9
6
  # used by dummy application
10
7
  group :development, :test do
11
8
  # supplies factories for producing model instance for specs
12
9
  # Version 4.1.0 or newer is needed to support generate calls without the 'FactoryGirl.' in factory definitions syntax.
13
- gem 'factory_girl', '>= 4.1.0'
10
+ gem 'factory_girl'
14
11
  # auto-load factories from spec/factories
15
12
  gem 'factory_girl_rails'
16
13
  end
@@ -18,18 +15,18 @@ end
18
15
  group :test do
19
16
  # rails is not used because activerecord should not be included, but rails would normally coordinate the versions
20
17
  # between its dependencies, which is now handled by this constraint.
21
- rails_version_constraint = [
22
- '>= 4.0.9',
23
- '< 4.1.0'
24
- ]
25
18
 
26
19
  # Dummy app uses actionpack for ActionController, but not rails since it doesn't use activerecord.
27
- gem 'actionpack', *rails_version_constraint
20
+ gem 'actionpack'
28
21
  # Uploads simplecov reports to coveralls.io
29
22
  gem 'coveralls', require: false
30
23
  # Engine tasks are loaded using railtie
31
- gem 'railties', *rails_version_constraint
32
- gem 'rspec-rails', '~> 3.1'
24
+ gem 'railties'
25
+ gem 'rspec-rails'
26
+ # Used for Postgres
27
+ gem 'pg'
28
+ # provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
29
+ gem "minitest"
33
30
  # In a full rails project, factory_girl_rails would be in both the :development, and :test group, but since we only
34
31
  # want rails in :test, factory_girl_rails must also only be in :test.
35
32
  # add matchers from shoulda, such as validates_presence_of, which are useful for testing validations
@@ -1,7 +1,7 @@
1
1
  module Metasploit
2
2
  module Model
3
3
  # VERSION is managed by GemRelease
4
- VERSION = '1.1.0'
4
+ VERSION = '2.0.0'
5
5
 
6
6
  # @return [String]
7
7
  #
@@ -19,7 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.required_ruby_version = '>= 2.1'
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
- spec.add_development_dependency 'metasploit-yard', '~> 1.1'
22
+ spec.add_development_dependency 'metasploit-yard'
23
+ spec.add_development_dependency 'metasploit-erd'
23
24
  spec.add_development_dependency 'rake'
24
25
 
25
26
  # documentation
@@ -27,12 +28,11 @@ Gem::Specification.new do |spec|
27
28
  spec.add_development_dependency 'yard', '< 0.8.7.4'
28
29
 
29
30
  # Dependency loading
30
- rails_version_constraints = ['>= 4.0.9', '< 4.1.0']
31
31
 
32
- spec.add_runtime_dependency 'activemodel', *rails_version_constraints
33
- spec.add_runtime_dependency 'activesupport', *rails_version_constraints
32
+ spec.add_runtime_dependency 'activemodel', '~> 4.2.6'
33
+ spec.add_runtime_dependency 'activesupport', '~> 4.2.6'
34
34
 
35
- spec.add_runtime_dependency 'railties', *rails_version_constraints
35
+ spec.add_runtime_dependency 'railties', '~> 4.2.6'
36
36
 
37
37
  if RUBY_PLATFORM =~ /java/
38
38
  # markdown formatting for yard
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -2,7 +2,7 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  # Pick the frameworks you want:
4
4
  require 'active_model/railtie'
5
- require "action_controller/railtie"
5
+ require 'action_controller/railtie'
6
6
 
7
7
  Bundler.require(*Rails.groups)
8
8
 
@@ -41,7 +41,7 @@ module Dummy
41
41
  config.active_support.escape_html_entities_in_json = true
42
42
 
43
43
  # Enable the asset pipeline
44
- config.assets.enabled = true
44
+ config.assets.enabled = false
45
45
 
46
46
  # Version of your assets, change this if you want to expire all your assets
47
47
  config.assets.version = '1.0'
@@ -1,10 +1,4 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
3
 
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,37 @@
1
+ production:
2
+ adapter: postgresql
3
+ database: metasploit_model_production
4
+ username: msf
5
+ password: pass123
6
+ host: localhost
7
+ port: 5432
8
+ pool: 50
9
+ timeout: 5
10
+
11
+
12
+
13
+ # Please only use postgresql bound to a TCP port.
14
+ development:
15
+ adapter: postgresql
16
+ database: metasploit_model_development
17
+ username: msf
18
+ password: pass123
19
+ host: localhost
20
+ port: 5432
21
+ pool: 50
22
+ timeout: 5
23
+
24
+ # Warning: The database defined as "test" will be erased and
25
+ # re-generated from your development database when you run "rake".
26
+ # Do not set this db to the same as development or production.
27
+ #
28
+ # Note also, sqlite3 is totally unsupported by Metasploit now.
29
+ test:
30
+ adapter: postgresql
31
+ database: metasploit_model_test
32
+ username: msf
33
+ password: pass123
34
+ host: localhost
35
+ port: 5432
36
+ pool: 50
37
+ timeout: 5
@@ -0,0 +1,22 @@
1
+ # @note This file is only for use in travis-ci. If you need to make a `spec/dummy/config/database.yml` for running
2
+ # rake, rake spec, or rspec locally, please customize `spec/dummy/config/database.yml.example`.
3
+ #
4
+ # @example Customizing config/database.yml.example
5
+ # cp spec/dummy/config/database.yml.example spec/dummy/config/database.yml
6
+ # # update password fields for each environment's user
7
+
8
+ # Using the postgres user locally without a host and port is the supported configuration from Travis-CI
9
+ #
10
+ # @see http://about.travis-ci.org/docs/user/database-setup/#PostgreSQL
11
+ development: &pgsql
12
+ adapter: postgresql
13
+ database: metasploit_model_development
14
+ username: postgres
15
+ pool: 5
16
+ timeout: 5
17
+
18
+ # Warning: The database defined as "test" will be erased and re-generated from your development database when you run
19
+ # `rake`. Do not set this db to the same as development or production.
20
+ test:
21
+ <<: *pgsql
22
+ database: metasploit_model_test
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -1,21 +1,35 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
-
9
+ # Do not eager load code on boot.
10
10
  config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
12
+ # Show full error reports and disable caching.
13
13
  config.consider_all_requests_local = true
14
14
  config.action_controller.perform_caching = false
15
15
 
16
- # Do not compress assets
17
- config.assets.compress = false
18
16
 
19
- # Expands the lines which load the assets
17
+ # Print deprecation notices to the Rails logger.
18
+ config.active_support.deprecation = :log
19
+
20
+ # Raise an error on page load if there are pending migrations.
21
+ config.active_record.migration_error = :page_load
22
+
23
+ # Debug mode disables concatenation and preprocessing of assets.
24
+ # This option may cause significant delays in view rendering with a large
25
+ # number of complex assets.
20
26
  config.assets.debug = true
27
+
28
+ # Adds additional error checking when serving assets at runtime.
29
+ # Checks for improperly declared sprockets dependencies.
30
+ # Raises helpful error messages.
31
+ config.assets.raise_runtime_errors = true
32
+
33
+ # Raises error for missing translations
34
+ # config.action_view.raise_on_missing_translations = true
21
35
  end
@@ -1,62 +1,78 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
7
11
  config.eager_load = true
8
12
 
9
- # Full error reports are disabled and caching is turned on
13
+ # Full error reports are disabled and caching is turned on.
10
14
  config.consider_all_requests_local = false
11
15
  config.action_controller.perform_caching = true
12
16
 
13
- # Disable Rails's static asset server (Apache or nginx will already do this)
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
14
23
  config.serve_static_assets = false
15
24
 
16
- # Compress JavaScripts and CSS
17
- config.assets.compress = true
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
18
28
 
19
- # Don't fallback to assets pipeline if a precompiled asset is missed
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
20
30
  config.assets.compile = false
21
31
 
22
- # Generate digests for assets URLs
32
+ # Generate digests for assets URLs.
23
33
  config.assets.digest = true
24
34
 
25
- # Defaults to nil and saved in location specified by config.assets.prefix
26
- # config.assets.manifest = YOUR_PATH
35
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
27
36
 
28
- # Specifies the header that your server uses for sending files
37
+ # Specifies the header that your server uses for sending files.
29
38
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
30
39
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
31
40
 
32
41
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
33
42
  # config.force_ssl = true
34
43
 
35
- # See everything in the log (default is :info)
36
- # config.log_level = :debug
44
+ # Set to :debug to see everything in the log.
45
+ config.log_level = :info
37
46
 
38
- # Prepend all log lines with the following tags
47
+ # Prepend all log lines with the following tags.
39
48
  # config.log_tags = [ :subdomain, :uuid ]
40
49
 
41
- # Use a different logger for distributed setups
50
+ # Use a different logger for distributed setups.
42
51
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
43
52
 
44
- # Use a different cache store in production
53
+ # Use a different cache store in production.
45
54
  # config.cache_store = :mem_cache_store
46
55
 
47
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
56
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
48
57
  # config.action_controller.asset_host = "http://assets.example.com"
49
58
 
50
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
51
- # config.assets.precompile += %w( search.js )
52
-
53
- # Disable delivery errors, bad email addresses will be ignored
59
+ # Ignore bad email addresses and do not raise email delivery errors.
60
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
54
61
  # config.action_mailer.raise_delivery_errors = false
55
62
 
56
- # Enable threaded mode
57
- # config.threadsafe!
58
-
59
63
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
60
- # the I18n.default_locale when a translation can not be found)
64
+ # the I18n.default_locale when a translation cannot be found).
61
65
  config.i18n.fallbacks = true
66
+
67
+ # Send deprecation notices to registered listeners.
68
+ config.active_support.deprecation = :notify
69
+
70
+ # Disable automatic flushing of the log to improve performance.
71
+ # config.autoflush_log = false
72
+
73
+ # Use default logging formatter so that PID and timestamp are not suppressed.
74
+ config.log_formatter = ::Logger::Formatter.new
75
+
76
+ # Do not dump schema after migrations.
77
+ config.active_record.dump_schema_after_migration = false
62
78
  end
@@ -1,5 +1,5 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,20 +7,28 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- config.eager_load = true
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
11
14
 
12
- # Configure static asset server for tests with Cache-Control for performance
13
- config.serve_static_assets = true
14
- config.static_cache_control = "public, max-age=3600"
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = 'public, max-age=3600'
15
18
 
16
-
17
- # Show full error reports and disable caching
19
+ # Show full error reports and disable caching.
18
20
  config.consider_all_requests_local = true
19
21
  config.action_controller.perform_caching = false
20
22
 
21
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
22
24
  config.action_dispatch.show_exceptions = false
23
25
 
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Print deprecation notices to the stderr.
30
+ config.active_support.deprecation = :stderr
31
+
32
+ # Raises error for missing translations
33
+ # config.action_view.raise_on_missing_translations = true
26
34
  end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]