metasploit_data_models 0.23.0 → 0.23.1

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: 5e8bc2e148729867ec972b74493e62d471823696
4
- data.tar.gz: 56c14fa5d0c88baf42f3c57482b0e0de09bf6bb9
3
+ metadata.gz: e51d22eadaeed4e22c7baa124b8114e4da2eb18e
4
+ data.tar.gz: 85d923444c7ef5c77c992247f2bbc8ec3a3ba5a0
5
5
  SHA512:
6
- metadata.gz: 9f3f0d5d0bd3ad985783b7af153ed18a5b40eb77a028efc4d385c485f80eb212221093440d18912d10d49e1e81cd1e26105af841fdc59914e3daf8d48773a038
7
- data.tar.gz: ed3459352d3b161d487db7afa170ddae756192f3ddc2563a2dd3c73f0c0ac514def03d48c162612e2fddcddd4d58550f81f8741c823c1950f66a98cb7c6c6c86
6
+ metadata.gz: 985147647109e0da1c592add750c845ee35e9e219b13c23f9ef9f21623b0597c9ca3156dac90068eabf2179341539f2500ec8ea2c9e70709087365a8b78221f0
7
+ data.tar.gz: 3d069e07db3b8ff62ea29690e1abad596c11cd16ba45639464c876612c0b0ca9d2d21fa9d8dad3c7082768d4e62551c30079a846013c8ec76be0a0544b79d221
@@ -23,6 +23,15 @@ class Mdm::Note < ActiveRecord::Base
23
23
  class_name: 'Mdm::Service',
24
24
  inverse_of: :notes
25
25
 
26
+ # @!attribute [rw] vuln
27
+ # The vuln to which this note is attached.
28
+ #
29
+ # @return [Mdm::Vuln] if note is attached to an {Mdm::Vuln}.
30
+ # @return [nil] if not is attached to an {Mdm::Host}.
31
+ belongs_to :vuln,
32
+ class_name: 'Mdm::Vuln',
33
+ inverse_of: :notes
34
+
26
35
  # @!attribute [rw] workspace
27
36
  # The workspace in which the {#host} or {#service} exists.
28
37
  #
@@ -56,6 +56,16 @@ class Mdm::Vuln < ActiveRecord::Base
56
56
  dependent: :destroy,
57
57
  inverse_of: :vuln
58
58
 
59
+ # @!attribute [rw] notes
60
+ # Notes about the vuln entered by a user with {Mdm::Note#created_at oldest notes} first.
61
+ #
62
+ # @return [Array<Mdm::Note>]
63
+ has_many :notes,
64
+ class_name: 'Mdm::Note',
65
+ inverse_of: :vuln,
66
+ dependent: :delete_all,
67
+ order: 'notes.created_at'
68
+
59
69
  #
60
70
  # Through :vuln_refs
61
71
  #
@@ -0,0 +1,6 @@
1
+ class AddVulnIdToNote < ActiveRecord::Migration
2
+ def change
3
+ add_column :notes, :vuln_id, :integer
4
+ add_index :notes, :vuln_id
5
+ end
6
+ end
@@ -5,8 +5,8 @@ module MetasploitDataModels
5
5
  MAJOR = 0
6
6
  # The minor version number, scoped to the {MAJOR} version number.
7
7
  MINOR = 23
8
- # The patch number, scoped to the {MINOR} version number.
9
- PATCH = 0
8
+ # The patch number, scoped to the {MAJOR} and {MINOR} version numbers.
9
+ PATCH = 1
10
10
 
11
11
  # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the `PRERELEASE` in the
12
12
  # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
@@ -21,6 +21,7 @@ describe Mdm::Note do
21
21
  it { should have_db_column(:workspace_id).of_type(:integer).with_options(:null => false, :default =>1) }
22
22
  it { should have_db_column(:host_id).of_type(:integer) }
23
23
  it { should have_db_column(:service_id).of_type(:integer) }
24
+ it { should have_db_column(:vuln_id).of_type(:integer) }
24
25
  it { should have_db_column(:ntype).of_type(:string) }
25
26
  it { should have_db_column(:critical).of_type(:boolean) }
26
27
  it { should have_db_column(:seen).of_type(:boolean) }
@@ -44,6 +45,7 @@ describe Mdm::Note do
44
45
  it { should belong_to(:workspace).class_name('Mdm::Workspace') }
45
46
  it { should belong_to(:host).class_name('Mdm::Host') }
46
47
  it { should belong_to(:service).class_name('Mdm::Service') }
48
+ it { should belong_to(:vuln).class_name('Mdm::Vuln') }
47
49
  end
48
50
 
49
51
  context 'scopes' do
@@ -42,6 +42,7 @@ describe Mdm::Vuln do
42
42
  it { should have_many(:vuln_details).class_name('Mdm::VulnDetail').dependent(:destroy) }
43
43
  # @todo https://www.pivotaltracker.com/story/show/49004623
44
44
  it { should have_many(:vulns_refs).class_name('Mdm::VulnRef').dependent(:destroy) }
45
+ it { should have_many(:notes).class_name('Mdm::Note').dependent(:delete_all).order('notes.created_at') }
45
46
 
46
47
  context 'module_details' do
47
48
  it { should have_many(:module_details).class_name('Mdm::Module::Detail').through(:module_refs) }
@@ -818,7 +818,8 @@ CREATE TABLE notes (
818
818
  updated_at timestamp without time zone,
819
819
  critical boolean,
820
820
  seen boolean,
821
- data text
821
+ data text,
822
+ vuln_id integer
822
823
  );
823
824
 
824
825
 
@@ -2679,6 +2680,13 @@ CREATE INDEX index_module_targets_on_module_detail_id ON module_targets USING bt
2679
2680
  CREATE INDEX index_notes_on_ntype ON notes USING btree (ntype);
2680
2681
 
2681
2682
 
2683
+ --
2684
+ -- Name: index_notes_on_vuln_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2685
+ --
2686
+
2687
+ CREATE INDEX index_notes_on_vuln_id ON notes USING btree (vuln_id);
2688
+
2689
+
2682
2690
  --
2683
2691
  -- Name: index_refs_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
2684
2692
  --
@@ -2998,6 +3006,8 @@ INSERT INTO schema_migrations (version) VALUES ('20150112203945');
2998
3006
 
2999
3007
  INSERT INTO schema_migrations (version) VALUES ('20150205192745');
3000
3008
 
3009
+ INSERT INTO schema_migrations (version) VALUES ('20150209195939');
3010
+
3001
3011
  INSERT INTO schema_migrations (version) VALUES ('20150212214222');
3002
3012
 
3003
3013
  INSERT INTO schema_migrations (version) VALUES ('21');
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Huckins
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-02-18 00:00:00.000000000 Z
14
+ date: 2015-02-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -395,6 +395,7 @@ files:
395
395
  - db/migrate/20140905031549_add_detected_arch_to_host.rb
396
396
  - db/migrate/20150112203945_remove_duplicate_services.rb
397
397
  - db/migrate/20150205192745_drop_service_uniqueness_index.rb
398
+ - db/migrate/20150209195939_add_vuln_id_to_note.rb
398
399
  - db/migrate/20150212214222_remove_duplicate_services2.rb
399
400
  - lib/mdm.rb
400
401
  - lib/mdm/host/operating_system_normalization.rb