ronin-db-activerecord 0.1.0.beta1 → 0.1.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -0
  3. data/.yardopts +1 -1
  4. data/README.md +2 -1
  5. data/db/migrate/0001_create_ronin_ip_address_mac_addresses_table.rb +1 -1
  6. data/db/migrate/0002_create_ronin_vulnerabilities_table.rb +1 -1
  7. data/db/migrate/0003_create_ronin_url_schemes_table.rb +1 -1
  8. data/db/migrate/0004_create_ronin_url_query_param_names_table.rb +1 -1
  9. data/db/migrate/0005_create_ronin_user_names_table.rb +1 -1
  10. data/db/migrate/0006_create_ronin_software_vendors_table.rb +1 -1
  11. data/db/migrate/0007_create_ronin_advisories_table.rb +1 -1
  12. data/db/migrate/0008_create_ronin_host_name_ip_addresses_table.rb +1 -1
  13. data/db/migrate/0009_create_ronin_host_names_table.rb +1 -1
  14. data/db/migrate/0010_create_ronin_arches_table.rb +1 -1
  15. data/db/migrate/0011_create_ronin_email_addresses_table.rb +1 -1
  16. data/db/migrate/0012_create_ronin_oses_table.rb +1 -1
  17. data/db/migrate/0013_create_ronin_organizations_table.rb +1 -1
  18. data/db/migrate/0014_create_ronin_ip_addresses_table.rb +1 -1
  19. data/db/migrate/0015_create_ronin_os_guesses_table.rb +1 -1
  20. data/db/migrate/0016_create_ronin_url_query_params_table.rb +1 -1
  21. data/db/migrate/0017_create_ronin_passwords_table.rb +1 -1
  22. data/db/migrate/0018_create_ronin_open_ports_table.rb +1 -1
  23. data/db/migrate/0019_create_ronin_urls_table.rb +1 -1
  24. data/db/migrate/0020_create_ronin_softwares_table.rb +1 -1
  25. data/db/migrate/0021_create_ronin_mac_addresses_table.rb +1 -1
  26. data/db/migrate/0022_create_ronin_countries_table.rb +1 -1
  27. data/db/migrate/0023_create_ronin_services_table.rb +1 -1
  28. data/db/migrate/0024_create_ronin_credentials_table.rb +1 -1
  29. data/db/migrate/0025_create_ronin_ports_table.rb +1 -1
  30. data/db/migrate/0026_create_ronin_asns_table.rb +1 -1
  31. data/db/migrate/0027_create_ronin_http_query_param_names_table.rb +1 -1
  32. data/db/migrate/0028_create_ronin_http_query_params_table.rb +1 -1
  33. data/db/migrate/0029_create_ronin_http_header_names_table.rb +1 -1
  34. data/db/migrate/0030_create_ronin_http_request_headers_table.rb +1 -1
  35. data/db/migrate/0031_create_ronin_http_response_headers_table.rb +1 -1
  36. data/db/migrate/0032_create_ronin_http_requests_table.rb +1 -1
  37. data/db/migrate/0033_create_ronin_http_responses_table.rb +1 -1
  38. data/db/migrate/0034_create_ronin_service_credentials_table.rb +1 -1
  39. data/db/migrate/0035_create_ronin_web_credentials_table.rb +1 -1
  40. data/gemspec.yml +3 -3
  41. data/lib/ronin/db/address.rb +1 -1
  42. data/lib/ronin/db/advisory.rb +1 -1
  43. data/lib/ronin/db/arch.rb +1 -1
  44. data/lib/ronin/db/asn.rb +1 -1
  45. data/lib/ronin/db/credential.rb +1 -1
  46. data/lib/ronin/db/email_address.rb +1 -1
  47. data/lib/ronin/db/host_name.rb +1 -1
  48. data/lib/ronin/db/host_name_ip_address.rb +1 -1
  49. data/lib/ronin/db/http_header_name.rb +1 -1
  50. data/lib/ronin/db/http_query_param.rb +1 -1
  51. data/lib/ronin/db/http_query_param_name.rb +1 -1
  52. data/lib/ronin/db/http_request.rb +1 -1
  53. data/lib/ronin/db/http_request_header.rb +1 -1
  54. data/lib/ronin/db/http_response.rb +1 -1
  55. data/lib/ronin/db/http_response_header.rb +1 -1
  56. data/lib/ronin/db/ip_address.rb +1 -1
  57. data/lib/ronin/db/ip_address_mac_address.rb +1 -1
  58. data/lib/ronin/db/mac_address.rb +1 -1
  59. data/lib/ronin/db/migrations.rb +1 -1
  60. data/lib/ronin/db/model/has_name.rb +1 -1
  61. data/lib/ronin/db/model/has_unique_name.rb +1 -1
  62. data/lib/ronin/db/model/importable.rb +1 -1
  63. data/lib/ronin/db/model/last_scanned_at.rb +1 -1
  64. data/lib/ronin/db/model.rb +1 -1
  65. data/lib/ronin/db/models.rb +1 -1
  66. data/lib/ronin/db/open_port.rb +1 -1
  67. data/lib/ronin/db/organization.rb +1 -1
  68. data/lib/ronin/db/os.rb +1 -1
  69. data/lib/ronin/db/os_guess.rb +1 -1
  70. data/lib/ronin/db/password.rb +1 -1
  71. data/lib/ronin/db/port.rb +1 -1
  72. data/lib/ronin/db/schema_migration.rb +1 -1
  73. data/lib/ronin/db/service.rb +1 -1
  74. data/lib/ronin/db/service_credential.rb +1 -1
  75. data/lib/ronin/db/software.rb +1 -1
  76. data/lib/ronin/db/software_vendor.rb +1 -1
  77. data/lib/ronin/db/url.rb +1 -1
  78. data/lib/ronin/db/url_query_param.rb +1 -1
  79. data/lib/ronin/db/url_query_param_name.rb +1 -1
  80. data/lib/ronin/db/url_scheme.rb +1 -1
  81. data/lib/ronin/db/user_name.rb +1 -1
  82. data/lib/ronin/db/vulnerability.rb +1 -1
  83. data/lib/ronin/db/web_credential.rb +1 -1
  84. data/ronin-db-activerecord.gemspec +2 -1
  85. metadata +5 -87
  86. data/lib/ronin/db/root.rb +0 -28
  87. data/spec/advisory_spec.rb +0 -277
  88. data/spec/arch_spec.rb +0 -228
  89. data/spec/asn_spec.rb +0 -504
  90. data/spec/credential_spec.rb +0 -362
  91. data/spec/email_address_spec.rb +0 -372
  92. data/spec/host_name_ip_address_spec.rb +0 -8
  93. data/spec/host_name_spec.rb +0 -207
  94. data/spec/http_header_name_spec.rb +0 -25
  95. data/spec/http_query_param_name_spec.rb +0 -25
  96. data/spec/http_query_param_spec.rb +0 -104
  97. data/spec/http_request_header_spec.rb +0 -72
  98. data/spec/http_request_spec.rb +0 -168
  99. data/spec/http_response_header_spec.rb +0 -74
  100. data/spec/http_response_spec.rb +0 -103
  101. data/spec/ip_address_mac_addresses_spec.rb +0 -8
  102. data/spec/ip_address_spec.rb +0 -386
  103. data/spec/mac_address_spec.rb +0 -67
  104. data/spec/migrations_spec.rb +0 -122
  105. data/spec/model/has_name_spec.rb +0 -65
  106. data/spec/model/has_unique_name_spec.rb +0 -61
  107. data/spec/model/importable_spec.rb +0 -105
  108. data/spec/models_spec.rb +0 -60
  109. data/spec/open_port_spec.rb +0 -87
  110. data/spec/organization_spec.rb +0 -10
  111. data/spec/os_guess_spec.rb +0 -43
  112. data/spec/os_spec.rb +0 -114
  113. data/spec/password_spec.rb +0 -81
  114. data/spec/port_spec.rb +0 -102
  115. data/spec/schema_migration_spec.rb +0 -8
  116. data/spec/service_credential_spec.rb +0 -43
  117. data/spec/service_spec.rb +0 -39
  118. data/spec/software_spec.rb +0 -76
  119. data/spec/software_vendor_spec.rb +0 -33
  120. data/spec/spec_helper.rb +0 -13
  121. data/spec/url_query_param_name_spec.rb +0 -25
  122. data/spec/url_query_param_spec.rb +0 -110
  123. data/spec/url_scheme_spec.rb +0 -39
  124. data/spec/url_spec.rb +0 -951
  125. data/spec/user_name_spec.rb +0 -54
  126. data/spec/vulnerability_spec.rb +0 -8
  127. data/spec/web_credential_spec.rb +0 -72
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
data/lib/ronin/db/os.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
data/lib/ronin/db/port.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
data/lib/ronin/db/url.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
4
  #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
6
  #
7
7
  # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU Lesser General Public License as published
@@ -27,13 +27,14 @@ Gem::Specification.new do |gem|
27
27
  gem.files = `git ls-files`.split($/)
28
28
  gem.files = glob[gemspec['files']] if gemspec['files']
29
29
  gem.files += Array(gemspec['generated_files'])
30
+ # exclude test files from the packages gem
31
+ gem.files -= glob[gemspec['test_files'] || 'spec/{**/}*']
30
32
 
31
33
  gem.executables = gemspec.fetch('executables') do
32
34
  glob['bin/*'].map { |path| File.basename(path) }
33
35
  end
34
36
 
35
37
  gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
36
- gem.test_files = glob[gemspec['test_files'] || 'spec/{**/}*_spec.rb']
37
38
  gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
38
39
 
39
40
  gem.require_paths = Array(gemspec.fetch('require_paths') {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-db-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta1
4
+ version: 0.1.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri-query_params
@@ -140,7 +140,6 @@ files:
140
140
  - lib/ronin/db/os_guess.rb
141
141
  - lib/ronin/db/password.rb
142
142
  - lib/ronin/db/port.rb
143
- - lib/ronin/db/root.rb
144
143
  - lib/ronin/db/schema_migration.rb
145
144
  - lib/ronin/db/service.rb
146
145
  - lib/ronin/db/service_credential.rb
@@ -154,55 +153,14 @@ files:
154
153
  - lib/ronin/db/vulnerability.rb
155
154
  - lib/ronin/db/web_credential.rb
156
155
  - ronin-db-activerecord.gemspec
157
- - spec/advisory_spec.rb
158
- - spec/arch_spec.rb
159
- - spec/asn_spec.rb
160
- - spec/credential_spec.rb
161
- - spec/email_address_spec.rb
162
- - spec/host_name_ip_address_spec.rb
163
- - spec/host_name_spec.rb
164
- - spec/http_header_name_spec.rb
165
- - spec/http_query_param_name_spec.rb
166
- - spec/http_query_param_spec.rb
167
- - spec/http_request_header_spec.rb
168
- - spec/http_request_spec.rb
169
- - spec/http_response_header_spec.rb
170
- - spec/http_response_spec.rb
171
- - spec/ip_address_mac_addresses_spec.rb
172
- - spec/ip_address_spec.rb
173
- - spec/mac_address_spec.rb
174
- - spec/migrations_spec.rb
175
- - spec/model/has_name_spec.rb
176
- - spec/model/has_unique_name_spec.rb
177
- - spec/model/importable_spec.rb
178
- - spec/models_spec.rb
179
- - spec/open_port_spec.rb
180
- - spec/organization_spec.rb
181
- - spec/os_guess_spec.rb
182
- - spec/os_spec.rb
183
- - spec/password_spec.rb
184
- - spec/port_spec.rb
185
- - spec/schema_migration_spec.rb
186
- - spec/service_credential_spec.rb
187
- - spec/service_spec.rb
188
- - spec/software_spec.rb
189
- - spec/software_vendor_spec.rb
190
- - spec/spec_helper.rb
191
- - spec/url_query_param_name_spec.rb
192
- - spec/url_query_param_spec.rb
193
- - spec/url_scheme_spec.rb
194
- - spec/url_spec.rb
195
- - spec/user_name_spec.rb
196
- - spec/vulnerability_spec.rb
197
- - spec/web_credential_spec.rb
198
156
  homepage: https://ronin-rb.dev/
199
157
  licenses:
200
158
  - LGPL-3.0
201
159
  metadata:
202
- documentation_uri: https://rubydoc.info/gems/ronin-db-activerecord
160
+ documentation_uri: https://ronin-rb.dev/docs/ronin-db-activerecord
203
161
  source_code_uri: https://github.com/ronin-rb/ronin-db-activerecord
204
162
  bug_tracker_uri: https://github.com/ronin-rb/ronin-db-activerecord/issues
205
- changelog_uri: https://github.com/ronin-rb/ronin-db-activerecord/blob/master/ChangeLog.md
163
+ changelog_uri: https://github.com/ronin-rb/ronin-db-activerecord/blob/main/ChangeLog.md
206
164
  rubygems_mfa_required: 'true'
207
165
  post_install_message:
208
166
  rdoc_options: []
@@ -223,44 +181,4 @@ rubygems_version: 3.3.26
223
181
  signing_key:
224
182
  specification_version: 4
225
183
  summary: ActiveRecord backend for the Ronin Database
226
- test_files:
227
- - spec/advisory_spec.rb
228
- - spec/arch_spec.rb
229
- - spec/asn_spec.rb
230
- - spec/credential_spec.rb
231
- - spec/email_address_spec.rb
232
- - spec/host_name_ip_address_spec.rb
233
- - spec/host_name_spec.rb
234
- - spec/http_header_name_spec.rb
235
- - spec/http_query_param_name_spec.rb
236
- - spec/http_query_param_spec.rb
237
- - spec/http_request_header_spec.rb
238
- - spec/http_request_spec.rb
239
- - spec/http_response_header_spec.rb
240
- - spec/http_response_spec.rb
241
- - spec/ip_address_mac_addresses_spec.rb
242
- - spec/ip_address_spec.rb
243
- - spec/mac_address_spec.rb
244
- - spec/migrations_spec.rb
245
- - spec/model/has_name_spec.rb
246
- - spec/model/has_unique_name_spec.rb
247
- - spec/model/importable_spec.rb
248
- - spec/models_spec.rb
249
- - spec/open_port_spec.rb
250
- - spec/organization_spec.rb
251
- - spec/os_guess_spec.rb
252
- - spec/os_spec.rb
253
- - spec/password_spec.rb
254
- - spec/port_spec.rb
255
- - spec/schema_migration_spec.rb
256
- - spec/service_credential_spec.rb
257
- - spec/service_spec.rb
258
- - spec/software_spec.rb
259
- - spec/software_vendor_spec.rb
260
- - spec/url_query_param_name_spec.rb
261
- - spec/url_query_param_spec.rb
262
- - spec/url_scheme_spec.rb
263
- - spec/url_spec.rb
264
- - spec/user_name_spec.rb
265
- - spec/vulnerability_spec.rb
266
- - spec/web_credential_spec.rb
184
+ test_files: []
data/lib/ronin/db/root.rb DELETED
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
- #
3
- # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
- #
5
- # Copyright (c) 2022 Hal Brodigan (postmodern.mod3 at gmail.com)
6
- #
7
- # ronin-db-activerecord is free software: you can redistribute it and/or modify
8
- # it under the terms of the GNU Lesser General Public License as published
9
- # by the Free Software Foundation, either version 3 of the License, or
10
- # (at your option) any later version.
11
- #
12
- # ronin-db-activerecord is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Lesser General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU Lesser General Public License
18
- # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
19
- #
20
-
21
- module Ronin
22
- module DB
23
- # Path to `ronin-db-activerecord` root directory.
24
- #
25
- # @api private
26
- ROOT = File.expand_path(File.join(__dir__,'..','..','..'))
27
- end
28
- end
@@ -1,277 +0,0 @@
1
- require 'spec_helper'
2
- require 'ronin/db/advisory'
3
-
4
- describe Ronin::DB::Advisory do
5
- describe described_class::ID do
6
- describe ".parse" do
7
- subject { described_class }
8
-
9
- context "when given a CVE ID" do
10
- let(:year) { 2020 }
11
- let(:identifier) { '1234' }
12
- let(:id) { "CVE-#{year}-#{identifier}" }
13
-
14
- it "must return a Hash containing the ID, 'CVE' prefix, the year, and the identifier" do
15
- expect(subject.parse(id)).to eq(
16
- {
17
- id: id,
18
- prefix: 'CVE',
19
- year: year,
20
- identifier: identifier
21
- }
22
- )
23
- end
24
- end
25
-
26
- context "when given a MS ID" do
27
- let(:year) { 2017 }
28
- let(:identifier) { '010' }
29
- let(:id) { "MS#{year - 2000}-#{identifier}" }
30
-
31
- it "must return a Hash containing the ID, 'MS' prefix, the full year, and the identifier" do
32
- expect(subject.parse(id)).to eq(
33
- {
34
- id: id,
35
- prefix: 'MS',
36
- year: year,
37
- identifier: identifier
38
- }
39
- )
40
- end
41
- end
42
-
43
- context "when given a RHSA ID" do
44
- let(:year) { 2022 }
45
- let(:identifier) { '6187' }
46
- let(:id) { "RHSA-#{year}:#{identifier}" }
47
-
48
- it "must return a Hash containing the ID, 'RHSA' prefix, the year, and the identifier" do
49
- expect(subject.parse(id)).to eq(
50
- {
51
- id: id,
52
- prefix: 'RHSA',
53
- year: year,
54
- identifier: identifier
55
- }
56
- )
57
- end
58
- end
59
-
60
- context "when given a GHSA ID" do
61
- let(:identifier) { '3hhc-qp5v-9p2j' }
62
- let(:id) { "GHSA-#{identifier}" }
63
-
64
- it "must return a Hash containing the ID and the identifier" do
65
- expect(subject.parse(id)).to eq(
66
- {
67
- id: id,
68
- prefix: 'GHSA',
69
- identifier: identifier
70
- }
71
- )
72
- end
73
- end
74
- end
75
- end
76
-
77
- describe "validations" do
78
- describe "prefix" do
79
- subject do
80
- end
81
-
82
- it "must require a preifx" do
83
- advisory = described_class.new(
84
- id: 'CVE-2022-1234',
85
- year: 2022,
86
- identifier: '2022-1234'
87
- )
88
- expect(advisory).to_not be_valid
89
- expect(advisory.errors[:prefix]).to eq(["can't be blank"])
90
-
91
- advisory = described_class.new(
92
- id: 'CVE-2022-1234',
93
- prefix: 'CVE',
94
- year: 2022,
95
- identifier: '2022-1234'
96
- )
97
- expect(advisory).to be_valid
98
- end
99
- end
100
-
101
- describe "year" do
102
- it "must accept a nil value" do
103
- advisory = described_class.new(
104
- id: 'GHSA-3hhc-qp5v-9p2j',
105
- prefix: 'GHSA',
106
- year: nil,
107
- identifier: '3hhc-qp5v-9p2j',
108
- )
109
-
110
- advisory.valid?
111
- p advisory.errors
112
- expect(advisory).to be_valid
113
- end
114
-
115
- it "must accept a numberic value" do
116
- advisory = described_class.new(
117
- id: 'CVE-2022-1234',
118
- prefix: 'CVE',
119
- year: 2022,
120
- identifier: '2022-1234'
121
- )
122
-
123
- expect(advisory).to be_valid
124
- end
125
- end
126
-
127
- describe "identifier" do
128
- it "must require a preifx" do
129
- advisory = described_class.new(
130
- id: 'CVE-2022-1234',
131
- prefix: 'CVE',
132
- year: 2022
133
- )
134
- expect(advisory).to_not be_valid
135
- expect(advisory.errors[:identifier]).to eq(["can't be blank"])
136
-
137
- advisory = described_class.new(
138
- id: 'CVE-2022-1234',
139
- prefix: 'CVE',
140
- year: 2022,
141
- identifier: '2022-1234'
142
- )
143
- expect(advisory).to be_valid
144
- end
145
- end
146
- end
147
-
148
- let(:prefix) { 'CVE' }
149
- let(:year) { 2022 }
150
- let(:identifier) { '1234' }
151
- let(:id) { "#{prefix}-#{year}-#{identifier}" }
152
-
153
- describe ".lookup" do
154
- let(:id) { 'CVE-2022-1234' }
155
-
156
- before do
157
- described_class.create(
158
- id: 'CVE-2000-1234',
159
- prefix: 'CVE',
160
- year: 2000,
161
- identifier: '2000-1234'
162
- )
163
- described_class.create(
164
- id: id,
165
- prefix: prefix,
166
- year: year,
167
- identifier: identifier
168
- )
169
- described_class.create(
170
- id: 'CVE-2000-5678',
171
- prefix: 'CVE',
172
- year: 2000,
173
- identifier: '2000-5678'
174
- )
175
- end
176
-
177
- it "must query the #{described_class} with the matching ID" do
178
- advisory = described_class.lookup(id)
179
-
180
- expect(advisory).to be_kind_of(described_class)
181
- expect(advisory.id).to eq(id)
182
- end
183
-
184
- after { described_class.destroy_all }
185
- end
186
-
187
- describe ".import" do
188
- let(:id) { 'CVE-2022-1234' }
189
- let(:parsed_id) { described_class::ID.parse(id) }
190
-
191
- subject { described_class.import(id) }
192
-
193
- it "must parse and import the advisory ID and return a new #{described_class}" do
194
- expect(subject.id).to eq(id)
195
- expect(subject.prefix).to eq(parsed_id[:prefix])
196
- expect(subject.year).to eq(parsed_id[:year])
197
- expect(subject.identifier).to eq(parsed_id[:identifier])
198
- end
199
-
200
- after { described_class.destroy_all }
201
- end
202
-
203
- subject do
204
- described_class.new(
205
- id: id,
206
- prefix: prefix,
207
- year: year,
208
- identifier: identifier
209
- )
210
- end
211
-
212
- describe "#url" do
213
- context "when #prefix is 'CVE'" do
214
- let(:prefix) { 'CVE' }
215
- let(:year) { 2022 }
216
- let(:identifier) { '1234' }
217
- let(:id) { "#{prefix}-#{year}-#{identifier}" }
218
-
219
- subject do
220
- described_class.new(
221
- id: id,
222
- prefix: prefix,
223
- year: year,
224
- identifier: identifier
225
- )
226
- end
227
-
228
- it "must return 'https://nvd.nist.gov/vuln/detail/CVE-YYYY-NNNN'" do
229
- expect(subject.url).to eq("https://nvd.nist.gov/vuln/detail/#{id}")
230
- end
231
- end
232
-
233
- context "when #prefix is 'RHSA'" do
234
- let(:prefix) { 'RHSA' }
235
- let(:year) { 2022 }
236
- let(:identifier) { '6187' }
237
- let(:id) { "#{prefix}-#{year}:#{identifier}" }
238
-
239
- subject do
240
- described_class.new(
241
- id: id,
242
- prefix: prefix,
243
- year: year,
244
- identifier: identifier
245
- )
246
- end
247
-
248
- it "must return 'https://access.redhat.com/errata/RHSA-YYYY-NNNN'" do
249
- expect(subject.url).to eq("https://access.redhat.com/errata/#{id}")
250
- end
251
- end
252
-
253
- context "when #prefix is 'GHSA'" do
254
- let(:prefix) { 'GHSA' }
255
- let(:identifier) { '3hhc-qp5v-9p2j' }
256
- let(:id) { "#{prefix}-#{identifier}" }
257
-
258
- subject do
259
- described_class.new(
260
- id: id,
261
- prefix: prefix,
262
- identifier: identifier
263
- )
264
- end
265
-
266
- it "must return 'https://github.com/advisories/GHSA-...'" do
267
- expect(subject.url).to eq("https://github.com/advisories/#{id}")
268
- end
269
- end
270
- end
271
-
272
- describe "#to_s" do
273
- it "must return the #id" do
274
- expect(subject.to_s).to eq(id)
275
- end
276
- end
277
- end