metasploit_data_models 0.23.0-java → 0.23.1-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40af8814f893342a2de8b24726c1b715ec48417b
4
- data.tar.gz: 01def61e27759816405723a389ec4dd46add19cc
3
+ metadata.gz: f2b79a89306158ed950b09e9defc78c9b161aec1
4
+ data.tar.gz: 2ec869dda2b9e3abb141941c97630acc2f76b2fe
5
5
  SHA512:
6
- metadata.gz: f6140d7a31e8c68ebcf2623de48e4f43f5ba159a0152f96e2969adfa7bcb78222fa6254708067ef721eb8ee9a25740a940ed6f5693906c1b1f9754dc2e41c609
7
- data.tar.gz: 8a67027055c22b9516335714e1d43985af3079c2c4f2cedb02dbd59bd67c77d4339aedc41198117e7eb64a931c8b452eff2ba77d9ea1e9e87d83117d8275dc2a
6
+ metadata.gz: 6f7730a8236b2b5f8ead000baced3c0513eb712c47fdad7cd42de4f5b83d50c9f62a7a4867bc486933631ac9cbb9f9f892341785f096cbaa8881df706a34f24e
7
+ data.tar.gz: 9902d6edc51a3d22edd344f4fee43751552dcec29da9fe2b6927f365d4603a777dc6d2cd29cc3e8c9124d61f498b8c0eadf4a856315d17473360e38f22052c74
@@ -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: java
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
@@ -408,6 +408,7 @@ files:
408
408
  - db/migrate/20140905031549_add_detected_arch_to_host.rb
409
409
  - db/migrate/20150112203945_remove_duplicate_services.rb
410
410
  - db/migrate/20150205192745_drop_service_uniqueness_index.rb
411
+ - db/migrate/20150209195939_add_vuln_id_to_note.rb
411
412
  - db/migrate/20150212214222_remove_duplicate_services2.rb
412
413
  - lib/mdm.rb
413
414
  - lib/mdm/host/operating_system_normalization.rb