ronin-db-activerecord 0.1.6 → 0.2.0.rc1

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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +91 -0
  3. data/README.md +49 -1
  4. data/db/migrate/0037_add_created_at_column_to_ronin_ports_table.rb +40 -0
  5. data/db/migrate/0038_add_created_at_column_to_ronin_services_table.rb +40 -0
  6. data/db/migrate/0039_create_ronin_cert_names_table.rb +37 -0
  7. data/db/migrate/0040_create_ronin_cert_issuers_table.rb +52 -0
  8. data/db/migrate/0041_create_ronin_cert_subjects_table.rb +54 -0
  9. data/db/migrate/0042_create_ronin_cert_subject_alt_names_table.rb +42 -0
  10. data/db/migrate/0043_create_ronin_certs_table.rb +61 -0
  11. data/db/migrate/0044_add_cert_id_column_to_ronin_open_ports_table.rb +35 -0
  12. data/db/migrate/0045_create_ronin_notes_table.rb +120 -0
  13. data/db/migrate/0046_create_ronin_web_vulns_table.rb +61 -0
  14. data/db/migrate/0047_create_ronin_phone_numbers_table.rb +47 -0
  15. data/db/migrate/0048_create_ronin_street_addresses_table.rb +46 -0
  16. data/db/migrate/0049_create_ronin_people_table.rb +48 -0
  17. data/db/migrate/0050_create_ronin_personal_connections_table.rb +48 -0
  18. data/db/migrate/0051_create_ronin_personal_phone_numbers_table.rb +48 -0
  19. data/db/migrate/0052_create_ronin_personal_email_addresses_table.rb +45 -0
  20. data/db/migrate/0053_create_ronin_personal_street_addresses_table.rb +47 -0
  21. data/db/migrate/0054_add_type_column_to_ronin_organizations_table.rb +33 -0
  22. data/db/migrate/0055_add_parent_id_column_to_ronin_organizations_table.rb +43 -0
  23. data/db/migrate/0056_create_ronin_organization_departments_table.rb +59 -0
  24. data/db/migrate/0057_create_ronin_organization_members_table.rb +62 -0
  25. data/db/migrate/0058_create_ronin_organization_customers_table.rb +52 -0
  26. data/db/migrate/0059_create_ronin_organization_phone_numbers_table.rb +47 -0
  27. data/db/migrate/0060_create_ronin_organization_email_addresses_table.rb +45 -0
  28. data/db/migrate/0061_create_ronin_organization_street_addresses_table.rb +47 -0
  29. data/db/migrate/0062_add_source_ip_column_to_http_requests_table.rb +30 -0
  30. data/db/migrate/0063_create_ronin_dns_queries_table.rb +41 -0
  31. data/db/migrate/0064_create_ronin_dns_records_table.rb +42 -0
  32. data/db/migrate/0065_create_ronin_organization_host_names_table.rb +43 -0
  33. data/db/migrate/0066_create_ronin_organization_ip_addresses_table.rb +43 -0
  34. data/gemspec.yml +1 -1
  35. data/lib/ronin/db/address.rb +1 -1
  36. data/lib/ronin/db/advisory.rb +66 -1
  37. data/lib/ronin/db/arch.rb +1 -1
  38. data/lib/ronin/db/asn.rb +15 -1
  39. data/lib/ronin/db/cert.rb +501 -0
  40. data/lib/ronin/db/cert_issuer.rb +78 -0
  41. data/lib/ronin/db/cert_name.rb +107 -0
  42. data/lib/ronin/db/cert_organization.rb +127 -0
  43. data/lib/ronin/db/cert_subject.rb +81 -0
  44. data/lib/ronin/db/cert_subject_alt_name.rb +88 -0
  45. data/lib/ronin/db/credential.rb +10 -1
  46. data/lib/ronin/db/dns_query.rb +98 -0
  47. data/lib/ronin/db/dns_record.rb +76 -0
  48. data/lib/ronin/db/email_address.rb +139 -1
  49. data/lib/ronin/db/host_name.rb +45 -1
  50. data/lib/ronin/db/host_name_ip_address.rb +1 -1
  51. data/lib/ronin/db/http_header_name.rb +1 -1
  52. data/lib/ronin/db/http_query_param.rb +1 -1
  53. data/lib/ronin/db/http_query_param_name.rb +1 -1
  54. data/lib/ronin/db/http_request.rb +13 -1
  55. data/lib/ronin/db/http_request_header.rb +1 -1
  56. data/lib/ronin/db/http_response.rb +1 -1
  57. data/lib/ronin/db/http_response_header.rb +1 -1
  58. data/lib/ronin/db/ip_address.rb +46 -1
  59. data/lib/ronin/db/ip_address_mac_address.rb +1 -1
  60. data/lib/ronin/db/mac_address.rb +28 -1
  61. data/lib/ronin/db/migrations.rb +1 -1
  62. data/lib/ronin/db/model/has_name.rb +18 -1
  63. data/lib/ronin/db/model/has_unique_name.rb +1 -1
  64. data/lib/ronin/db/model/importable.rb +1 -1
  65. data/lib/ronin/db/model/last_scanned_at.rb +1 -1
  66. data/lib/ronin/db/model.rb +1 -1
  67. data/lib/ronin/db/models.rb +44 -2
  68. data/lib/ronin/db/note.rb +199 -0
  69. data/lib/ronin/db/open_port.rb +104 -3
  70. data/lib/ronin/db/organization.rb +237 -3
  71. data/lib/ronin/db/organization_customer.rb +73 -0
  72. data/lib/ronin/db/organization_department.rb +97 -0
  73. data/lib/ronin/db/organization_email_address.rb +66 -0
  74. data/lib/ronin/db/organization_host_name.rb +65 -0
  75. data/lib/ronin/db/organization_ip_address.rb +65 -0
  76. data/lib/ronin/db/organization_member.rb +158 -0
  77. data/lib/ronin/db/organization_phone_number.rb +66 -0
  78. data/lib/ronin/db/organization_street_address.rb +66 -0
  79. data/lib/ronin/db/os.rb +35 -1
  80. data/lib/ronin/db/os_guess.rb +1 -1
  81. data/lib/ronin/db/password.rb +84 -1
  82. data/lib/ronin/db/person.rb +455 -0
  83. data/lib/ronin/db/personal_connection.rb +110 -0
  84. data/lib/ronin/db/personal_email_address.rb +66 -0
  85. data/lib/ronin/db/personal_phone_number.rb +76 -0
  86. data/lib/ronin/db/personal_street_address.rb +66 -0
  87. data/lib/ronin/db/phone_number.rb +330 -0
  88. data/lib/ronin/db/port.rb +110 -1
  89. data/lib/ronin/db/service.rb +130 -1
  90. data/lib/ronin/db/service_credential.rb +1 -1
  91. data/lib/ronin/db/software.rb +37 -1
  92. data/lib/ronin/db/software_vendor.rb +1 -1
  93. data/lib/ronin/db/street_address.rb +340 -0
  94. data/lib/ronin/db/url.rb +37 -1
  95. data/lib/ronin/db/url_query_param.rb +1 -1
  96. data/lib/ronin/db/url_query_param_name.rb +9 -1
  97. data/lib/ronin/db/url_scheme.rb +1 -1
  98. data/lib/ronin/db/user_name.rb +58 -1
  99. data/lib/ronin/db/vulnerability.rb +1 -1
  100. data/lib/ronin/db/web_credential.rb +1 -1
  101. data/lib/ronin/db/web_vuln.rb +348 -0
  102. metadata +57 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 641f203f12ca2e88ac5de9f8a8c5fe6fbf5da527b7108102d55f0e65934ea641
4
- data.tar.gz: a55081d93e685f8232ae74e54bd99a5f242b40834d5ea55792ec08f3dc184782
3
+ metadata.gz: c4da08e5db9949dabcf7222863fc3494b8b490cd010c2e9b0ce1d9f45ee66ce4
4
+ data.tar.gz: 8317d25f8ea47d0280d07b4a7055901e0ca053af8cb7e9362f919fa45b8f403c
5
5
  SHA512:
6
- metadata.gz: f090ebd86546fed4ba74bada319aaaf6c524360b4f48745042aa8d5b5118c50c3e5d3224143c6fa3901546b456dd853dd1fe97853e9c259b76f8ad284e8fec0b
7
- data.tar.gz: 833ab9ec1142ba4363a42453c874bde62c2b049fb3662dfe3870c9d4eeed38948d0faff22dcdc85b9db71c8610dde8d0393e2ef51779f3df76ee4102c1957f39
6
+ metadata.gz: 8906004e4df84301446e8be83822e95558b4e9ecced80597cc2a52d4b1bc5b683de8d527aeed637f458fbf705704ecb4d489e0fdc06052ae2e3708cbe30a969b
7
+ data.tar.gz: a4ba894a3b86962397abf504f05b63ea60102ce9c2f5d15c3ad1983e75e13f2345790a59325f4b6208b625e07261eae0dd747e51c04fa0b184e37cb07dc78f0e
data/ChangeLog.md CHANGED
@@ -1,3 +1,94 @@
1
+ ### 0.2.0 / 2024-XX-XX
2
+
3
+ * Added {Ronin::DB::Advisory#host_names}.
4
+ * Added {Ronin::DB::Advisory#ip_addresses}.
5
+ * Added {Ronin::DB::Advisory#mac_addresses}.
6
+ * Added {Ronin::DB::Advisory#open_ports}.
7
+ * Added {Ronin::DB::Advisory#urls}.
8
+ * Added {Ronin::DB::Advisory#vulnerabilities}.
9
+ * Added {Ronin::DB::ASN#to_s}.
10
+ * Added {Ronin::DB::Cert}.
11
+ * Added {Ronin::DB::DNSQuery}.
12
+ * Added {Ronin::DB::DNSRecord}.
13
+ * Added {Ronin::DB::EmailAddress.for_organization}.
14
+ * Added {Ronin::DB::EmailAddress.for_person}.
15
+ * Added {Ronin::DB::EmailAddress.with_password}.
16
+ * Added {Ronin::DB::EmailAddress#passwords}.
17
+ * Added {Ronin::DB::EmailAddress#service_credentials}.
18
+ * Added {Ronin::DB::EmailAddress#web_credentials}.
19
+ * Added {Ronin::DB::HostName#advisories}.
20
+ * Added {Ronin::DB::HostName#vulnerabilities}.
21
+ * Added {Ronin::DB::HTTPRequest#source_ip}.
22
+ * Added {Ronin::DB::IPAddress#advisories}.
23
+ * Added {Ronin::DB::IPAddress#vulnerabilities}.
24
+ * Added {Ronin::DB::MACAddress#advisories}.
25
+ * Added {Ronin::DB::MACAddress#vulnerabilities}.
26
+ * Added {Ronin::DB::Model::HasName::ClassMethods#with_name}.
27
+ * Added {Ronin::DB::Note}.
28
+ * Added {Ronin::DB::OpenPort.with_ip_address}.
29
+ * Added {Ronin::DB::OpenPort.with_port_number}.
30
+ * Added {Ronin::DB::OpenPort.with_protocol}.
31
+ * Added {Ronin::DB::OpenPort.with_service_name}.
32
+ * Added {Ronin::DB::OpenPort#advisories}.
33
+ * Added {Ronin::DB::OpenPort#vulnerabilities}.
34
+ * Added {Ronin::DB::Organization.import}.
35
+ * Added {Ronin::DB::Organization.lookup}.
36
+ * Added {Ronin::DB::Organization#type}.
37
+ * Added {Ronin::DB::Organization#parent}.
38
+ * Added {Ronin::DB::OrganizationCustomer}.
39
+ * Added {Ronin::DB::OrganizationDepartment}.
40
+ * Added {Ronin::DB::OrganizationEmailAddress}.
41
+ * Added {Ronin::DB::OrganizationHostName}.
42
+ * Added {Ronin::DB::OrganizationIPAddress}.
43
+ * Added {Ronin::DB::OrganizationMember}.
44
+ * Added {Ronin::DB::OrganizationPhoneNumber}.
45
+ * Added {Ronin::DB::OrganizationStreetAddress}.
46
+ * Added {Ronin::DB::OS.with_flavor}.
47
+ * Added {Ronin::DB::OS.with_version}.
48
+ * Added {Ronin::DB::Password.for_user}.
49
+ * Added {Ronin::DB::Password.with_email_address}.
50
+ * Added {Ronin::DB::Password#email_addresses}.
51
+ * Added {Ronin::DB::Password#service_credentials}.
52
+ * Added {Ronin::DB::Password#web_credentials}.
53
+ * Added {Ronin::DB::Person}.
54
+ * Added {Ronin::DB::PersonalConnection}.
55
+ * Added {Ronin::DB::PersonalEmailAddress}.
56
+ * Added {Ronin::DB::PersonalPhoneNumber}.
57
+ * Added {Ronin::DB::PersonalStreetAddress}.
58
+ * Added {Ronin::DB::PhoneNumber}.
59
+ * Added {Ronin::DB::Port.with_ip_address}.
60
+ * Added {Ronin::DB::Port.with_number}.
61
+ * Added {Ronin::DB::Port.with_protocol}.
62
+ * Added {Ronin::DB::Port.with_service_name}.
63
+ * Added {Ronin::DB::Port#ip_addresses}.
64
+ * Added {Ronin::DB::Port#services}.
65
+ * Added {Ronin::DB::Service.import}.
66
+ * Added {Ronin::DB::Service.lookup}.
67
+ * Added {Ronin::DB::Service.with_ip_address}.
68
+ * Added {Ronin::DB::Service.with_port_number}.
69
+ * Added {Ronin::DB::Service.with_protocol}.
70
+ * Added {Ronin::DB::Service#ip_addresses}.
71
+ * Added {Ronin::DB::Service#ports}.
72
+ * Added {Ronin::DB::Software.with_vendor_name}.
73
+ * Added {Ronin::DB::Software.with_version}.
74
+ * Added {Ronin::DB::StreetAddress}.
75
+ * Added {Ronin::DB::URL#advisories}.
76
+ * Added {Ronin::DB::URL#vulnerabilities}.
77
+ * Added {Ronin::DB::URLQueryParamName.urls}.
78
+ * Added {Ronin::DB::UserName#passwords}.
79
+ * Added {Ronin::DB::UserName#service_credentials}.
80
+ * Added {Ronin::DB::UserName#web_credentials}.
81
+ * Added {Ronin::DB::UserName.with_password}.
82
+ * Added {Ronin::DB::WebVuln}.
83
+ * Include {Ronin::DB::Model::Importable} into {Ronin::DB::Service}.
84
+ * Include {Ronin::DB::Model::Importable} into {Ronin::DB::Organization}.
85
+ * Include {Ronin::DB::Model::HasName} into {Ronin::DB::Software} for the
86
+ the {Ronin::DB::Model::HasName::ClassMethods#named .named} method.
87
+ * Added missing `created_at` column and attribute to {Ronin::DB::Port}.
88
+ * Added missing `created_at` column and attribute to {Ronin::DB::Service}.
89
+ * Changed {Ronin::DB::OpenPort#to_s} to include
90
+ {Ronin::DB::OpenPort#ip_address}.
91
+
1
92
  ### 0.1.6 / 2024-06-19
2
93
 
3
94
  * Improve the validation of email addresses passed to
data/README.md CHANGED
@@ -23,6 +23,13 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
23
23
  * [Ronin::DB::Advisory]
24
24
  * [Ronin::DB::Arch]
25
25
  * [Ronin::DB::ASN]
26
+ * [Ronin::DB::Cert]
27
+ * [Ronin::DB::CertIssuer]
28
+ * [Ronin::DB::CertName]
29
+ * [Ronin::DB::CertSubject]
30
+ * [Ronin::DB::CertSubjectAltName]
31
+ * [Ronin::DB::DNSQuery]
32
+ * [Ronin::DB::DNSRecord]
26
33
  * [Ronin::DB::EmailAddress]
27
34
  * [Ronin::DB::HostName]
28
35
  * [Ronin::DB::HostNameIPAddress]
@@ -36,22 +43,39 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
36
43
  * [Ronin::DB::IPAddress]
37
44
  * [Ronin::DB::IPAddressMACAddress]
38
45
  * [Ronin::DB::MACAddress]
46
+ * [Ronin::DB::Note]
39
47
  * [Ronin::DB::OpenPort]
40
48
  * [Ronin::DB::Organization]
49
+ * [Ronin::DB::OrganizationCustomer]
50
+ * [Ronin::DB::OrganizationDepartment]
51
+ * [Ronin::DB::OrganizationEmailAddress]
52
+ * [Ronin::DB::OrganizationHostName]
53
+ * [Ronin::DB::OrganizationIPAddress]
54
+ * [Ronin::DB::OrganizationMember]
55
+ * [Ronin::DB::OrganizationPhoneNumber]
56
+ * [Ronin::DB::OrganizationStreetAddress]
41
57
  * [Ronin::DB::OS]
42
58
  * [Ronin::DB::OSGuess]
43
59
  * [Ronin::DB::Password]
60
+ * [Ronin::DB::Person]
61
+ * [Ronin::DB::PersonalConnection]
62
+ * [Ronin::DB::PersonalEmailAddress]
63
+ * [Ronin::DB::PersonalPhoneNumber]
64
+ * [Ronin::DB::PersonalStreetAddress]
65
+ * [Ronin::DB::PhoneNumber]
44
66
  * [Ronin::DB::Port]
45
67
  * [Ronin::DB::Service]
46
68
  * [Ronin::DB::ServiceCredential]
47
69
  * [Ronin::DB::Software]
48
70
  * [Ronin::DB::SoftwareVendor]
71
+ * [Ronin::DB::StreetAddress]
49
72
  * [Ronin::DB::URL]
50
73
  * [Ronin::DB::URLQueryParam]
51
74
  * [Ronin::DB::URLQueryParamName]
52
75
  * [Ronin::DB::URLScheme]
53
76
  * [Ronin::DB::UserName]
54
77
  * [Ronin::DB::Vulnerability]
78
+ * [Ronin::DB::WebVuln]
55
79
  * [Ronin::DB::WebCredential]
56
80
  * Has 98% documentation coverage.
57
81
  * Has 99% test coverage.
@@ -59,6 +83,13 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
59
83
  [Ronin::DB::Advisory]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Advisory.html
60
84
  [Ronin::DB::Arch]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Arch.html
61
85
  [Ronin::DB::ASN]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/ASN.html
86
+ [Ronin::DB::Cert]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Cert.html
87
+ [Ronin::DB::CertIssuer]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertIssuer.html
88
+ [Ronin::DB::CertName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertName.html
89
+ [Ronin::DB::CertSubject]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertSubject.html
90
+ [Ronin::DB::CertSubjectAltName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertSubjectAltName.html
91
+ [Ronin::DB::DNSQuery]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/DNSQuery.html
92
+ [Ronin::DB::DNSRecord]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/DNSRecord.html
62
93
  [Ronin::DB::EmailAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/EmailAddress.html
63
94
  [Ronin::DB::HostName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/HostName.html
64
95
  [Ronin::DB::HostNameIPAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/HostNameIPAddress.html
@@ -72,22 +103,39 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
72
103
  [Ronin::DB::IPAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/IPAddress.html
73
104
  [Ronin::DB::IPAddressMACAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/IPAddressMACAddress.html
74
105
  [Ronin::DB::MACAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/MACAddress.html
106
+ [Ronin::DB::Note]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Note.html
75
107
  [Ronin::DB::OpenPort]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OpenPort.html
76
108
  [Ronin::DB::Organization]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Organization.html
109
+ [Ronin::DB::OrganizationCustomer]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationCustomer.html
110
+ [Ronin::DB::OrganizationDepartment]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationDepartment.html
111
+ [Ronin::DB::OrganizationEmailAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationEmailAddress.html
112
+ [Ronin::DB::OrganizationHostName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationHostName.html
113
+ [Ronin::DB::OrganizationIPAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationIPAddress.html
114
+ [Ronin::DB::OrganizationMember]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationMember.html
115
+ [Ronin::DB::OrganizationPhoneNumber]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationPhoneNumber.html
116
+ [Ronin::DB::OrganizationStreetAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationStreetAddress.html
77
117
  [Ronin::DB::OS]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OS.html
78
118
  [Ronin::DB::OSGuess]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OSGuess.html
79
119
  [Ronin::DB::Password]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Password.html
120
+ [Ronin::DB::Person]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Person.html
121
+ [Ronin::DB::PersonalConnection]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalConnection.html
122
+ [Ronin::DB::PersonalEmailAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalEmailAddress.html
123
+ [Ronin::DB::PersonalPhoneNumber]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalPhoneNumber.html
124
+ [Ronin::DB::PersonalStreetAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalStreetAddress.html
125
+ [Ronin::DB::PhoneNumber]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PhoneNumber.html
80
126
  [Ronin::DB::Port]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Port.html
81
127
  [Ronin::DB::Service]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Service.html
82
128
  [Ronin::DB::ServiceCredential]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/ServiceCredential.html
83
129
  [Ronin::DB::Software]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Software.html
84
130
  [Ronin::DB::SoftwareVendor]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/SoftwareVendor.html
131
+ [Ronin::DB::StreetAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/StreetAddress.html
85
132
  [Ronin::DB::URL]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URL.html
86
133
  [Ronin::DB::URLQueryParam]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URLQueryParam.html
87
134
  [Ronin::DB::URLQueryParamName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URLQueryParamName.html
88
135
  [Ronin::DB::URLScheme]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URLScheme.html
89
136
  [Ronin::DB::UserName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/UserName.html
90
137
  [Ronin::DB::Vulnerability]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Vulnerability.html
138
+ [Ronin::DB::WebVuln]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/WebVuln.html
91
139
  [Ronin::DB::WebCredential]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/WebCredential.html
92
140
 
93
141
  ## Examples
@@ -156,7 +204,7 @@ local database console.
156
204
 
157
205
  ## License
158
206
 
159
- Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3@gmail.com)
207
+ Copyright (c) 2022-2024 Hal Brodigan (postmodern.mod3@gmail.com)
160
208
 
161
209
  ronin-db-activerecord is free software: you can redistribute it and/or modify
162
210
  it under the terms of the GNU Lesser General Public License as published
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Adds the `created_at` column to the `ronin_ports` table.
25
+ #
26
+ class AddCreatedAtColumnToRoninPortsTable < ActiveRecord::Migration[7.0]
27
+
28
+ def up
29
+ add_column :ronin_ports, :created_at, :datetime
30
+
31
+ execute 'UPDATE ronin_ports SET created_at = (SELECT created_at FROM ronin_open_ports WHERE port_id = ronin_ports.id)'
32
+
33
+ change_column_null :ronin_ports, :created_at, false
34
+ end
35
+
36
+ def down
37
+ remove_column :ronin_ports, :created_at
38
+ end
39
+
40
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Adds the `created_at` column to the `ronin_services` table.
25
+ #
26
+ class AddCreatedAtColumnToRoninServicesTable < ActiveRecord::Migration[7.0]
27
+
28
+ def up
29
+ add_column :ronin_services, :created_at, :datetime
30
+
31
+ execute 'UPDATE ronin_services SET created_at = (SELECT created_at FROM ronin_open_ports WHERE service_id = ronin_services.id)'
32
+
33
+ change_column_null :ronin_services, :created_at, false
34
+ end
35
+
36
+ def down
37
+ remove_column :ronin_services, :created_at
38
+ end
39
+
40
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Creates the `ronin_cert_names` table.
25
+ #
26
+ class CreateRoninCertNamesTable < ActiveRecord::Migration[7.0]
27
+
28
+ def change
29
+ create_table :ronin_cert_names, if_not_exists: true do |t|
30
+ t.string :name, null: false
31
+ t.datetime :created_at, null: false
32
+
33
+ t.index :name, unique: true
34
+ end
35
+ end
36
+
37
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Creates the `ronin_cert_issuers` table.
25
+ #
26
+ class CreateRoninCertIssuersTable < ActiveRecord::Migration[7.0]
27
+
28
+ def change
29
+ create_table :ronin_cert_issuers, if_not_exists: true do |t|
30
+ # NOTE: some Equifax certs do not set the issuer common name (CN)
31
+ t.string :common_name, null: true
32
+ t.string :email_address, length: 320, null: true
33
+ t.string :organization, null: false
34
+ t.string :organizational_unit, null: true
35
+ t.string :locality, null: true
36
+ t.string :state, null: true
37
+ t.string :country, null: false, length: 2
38
+
39
+ t.datetime :created_at, null: false
40
+
41
+ t.index [:common_name, :organization, :organizational_unit, :locality, :state, :country], unique: true,
42
+ name: :index_ronin_cert_issuers_table_unique
43
+ t.index :common_name
44
+ t.index :email_address
45
+ t.index :organization
46
+ t.index :organizational_unit
47
+ t.index :locality
48
+ t.index :country
49
+ end
50
+ end
51
+
52
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Creates the `ronin_cert_subjects` table.
25
+ #
26
+ class CreateRoninCertSubjectsTable < ActiveRecord::Migration[7.0]
27
+
28
+ def change
29
+ create_table :ronin_cert_subjects, if_not_exists: true do |t|
30
+ t.references :common_name, null: false,
31
+ foreign_key: {
32
+ to_table: :ronin_cert_names
33
+ }
34
+
35
+ t.string :email_address, length: 320, null: true
36
+ t.string :organization, null: false
37
+ t.string :organizational_unit, null: true
38
+ t.string :locality, null: true
39
+ t.string :state, null: true
40
+ t.string :country, null: false, length: 2
41
+
42
+ t.datetime :created_at, null: false
43
+
44
+ t.index [:common_name_id, :organization, :organizational_unit, :locality, :state, :country], unique: true,
45
+ name: :index_ronin_cert_subjects_table_unique
46
+ t.index :email_address
47
+ t.index :organization
48
+ t.index :organizational_unit
49
+ t.index :locality
50
+ t.index :country
51
+ end
52
+ end
53
+
54
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Creates the `ronin_cert_subject_alt_names` table.
25
+ #
26
+ class CreateRoninCertSubjectAltNamesTable < ActiveRecord::Migration[7.0]
27
+
28
+ def change
29
+ create_table :ronin_cert_subject_alt_names, if_not_exists: true do |t|
30
+ t.references :name, null: false,
31
+ foreign_key: {
32
+ to_table: :ronin_cert_names
33
+ }
34
+
35
+ t.references :cert, null: false,
36
+ foreign_key: {
37
+ to_table: :ronin_certs
38
+ }
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Creates the `ronin_certs` table.
25
+ #
26
+ class CreateRoninCertsTable < ActiveRecord::Migration[7.0]
27
+
28
+ def change
29
+ create_table :ronin_certs, if_not_exists: true do |t|
30
+ t.string :serial, length: 32, null: false
31
+ t.integer :version, null: false
32
+ t.datetime :not_before, null: false
33
+ t.datetime :not_after, null: false
34
+
35
+ # NOTE: self-signed certs dont' have #issuer set
36
+ t.references :issuer, null: true,
37
+ foreign_key: {
38
+ to_table: :ronin_cert_issuers
39
+ }
40
+ t.references :subject, null: false,
41
+ foreign_key: {
42
+ to_table: :ronin_cert_subjects
43
+ }
44
+
45
+ t.string :public_key_algorithm, length: 3, null: false
46
+ t.integer :public_key_size, null: true
47
+ t.string :signing_algorithm, length: 12, null: false
48
+
49
+ t.string :sha1_fingerprint, length: 40, null: false
50
+ t.string :sha256_fingerprint, length: 64, null: false
51
+
52
+ t.text :pem, null: false
53
+ t.datetime :created_at, null: false
54
+
55
+ t.index :serial
56
+ t.index :sha1_fingerprint, unique: true
57
+ t.index :sha256_fingerprint, unique: true
58
+ end
59
+ end
60
+
61
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-db-activerecord - ActiveRecord backend for the Ronin Database.
4
+ #
5
+ # Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ #
7
+ # This file is part of ronin-db-activerecord.
8
+ #
9
+ # ronin-db-activerecord is free software: you can redistribute it and/or modify
10
+ # it under the terms of the GNU Lesser General Public License as published
11
+ # by the Free Software Foundation, either version 3 of the License, or
12
+ # (at your option) any later version.
13
+ #
14
+ # ronin-db-activerecord is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public License
20
+ # along with ronin-db-activerecord. If not, see <https://www.gnu.org/licenses/>.
21
+ #
22
+
23
+ #
24
+ # Adds an optional `cert_id` column to the `ronin_open_ports` table.
25
+ #
26
+ class AddCertIdColumnToRoninOpenPortsTable < ActiveRecord::Migration[7.0]
27
+
28
+ def change
29
+ add_reference :ronin_open_ports, :cert, null: true,
30
+ foreign_key: {
31
+ to_table: :ronin_certs
32
+ }
33
+ end
34
+
35
+ end