ronin-db-activerecord 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/ChangeLog.md +91 -0
- data/README.md +51 -2
- data/db/migrate/0037_add_created_at_column_to_ronin_ports_table.rb +40 -0
- data/db/migrate/0038_add_created_at_column_to_ronin_services_table.rb +40 -0
- data/db/migrate/0039_create_ronin_cert_names_table.rb +37 -0
- data/db/migrate/0040_create_ronin_cert_issuers_table.rb +52 -0
- data/db/migrate/0041_create_ronin_cert_subjects_table.rb +54 -0
- data/db/migrate/0042_create_ronin_cert_subject_alt_names_table.rb +42 -0
- data/db/migrate/0043_create_ronin_certs_table.rb +61 -0
- data/db/migrate/0044_add_cert_id_column_to_ronin_open_ports_table.rb +35 -0
- data/db/migrate/0045_create_ronin_notes_table.rb +120 -0
- data/db/migrate/0046_create_ronin_web_vulns_table.rb +61 -0
- data/db/migrate/0047_create_ronin_phone_numbers_table.rb +47 -0
- data/db/migrate/0048_create_ronin_street_addresses_table.rb +46 -0
- data/db/migrate/0049_create_ronin_people_table.rb +48 -0
- data/db/migrate/0050_create_ronin_personal_connections_table.rb +48 -0
- data/db/migrate/0051_create_ronin_personal_phone_numbers_table.rb +48 -0
- data/db/migrate/0052_create_ronin_personal_email_addresses_table.rb +45 -0
- data/db/migrate/0053_create_ronin_personal_street_addresses_table.rb +47 -0
- data/db/migrate/0054_add_type_column_to_ronin_organizations_table.rb +33 -0
- data/db/migrate/0055_add_parent_id_column_to_ronin_organizations_table.rb +43 -0
- data/db/migrate/0056_create_ronin_organization_departments_table.rb +59 -0
- data/db/migrate/0057_create_ronin_organization_members_table.rb +62 -0
- data/db/migrate/0058_create_ronin_organization_customers_table.rb +52 -0
- data/db/migrate/0059_create_ronin_organization_phone_numbers_table.rb +47 -0
- data/db/migrate/0060_create_ronin_organization_email_addresses_table.rb +45 -0
- data/db/migrate/0061_create_ronin_organization_street_addresses_table.rb +47 -0
- data/db/migrate/0062_add_source_ip_column_to_http_requests_table.rb +30 -0
- data/db/migrate/0063_create_ronin_dns_queries_table.rb +41 -0
- data/db/migrate/0064_create_ronin_dns_records_table.rb +42 -0
- data/db/migrate/0065_create_ronin_organization_host_names_table.rb +43 -0
- data/db/migrate/0066_create_ronin_organization_ip_addresses_table.rb +43 -0
- data/gemspec.yml +3 -2
- data/lib/ronin/db/address.rb +1 -1
- data/lib/ronin/db/advisory.rb +66 -1
- data/lib/ronin/db/arch.rb +1 -1
- data/lib/ronin/db/asn.rb +15 -1
- data/lib/ronin/db/cert.rb +501 -0
- data/lib/ronin/db/cert_issuer.rb +78 -0
- data/lib/ronin/db/cert_name.rb +107 -0
- data/lib/ronin/db/cert_organization.rb +127 -0
- data/lib/ronin/db/cert_subject.rb +81 -0
- data/lib/ronin/db/cert_subject_alt_name.rb +88 -0
- data/lib/ronin/db/credential.rb +10 -1
- data/lib/ronin/db/dns_query.rb +98 -0
- data/lib/ronin/db/dns_record.rb +76 -0
- data/lib/ronin/db/email_address.rb +139 -1
- data/lib/ronin/db/host_name.rb +45 -1
- data/lib/ronin/db/host_name_ip_address.rb +1 -1
- data/lib/ronin/db/http_header_name.rb +1 -1
- data/lib/ronin/db/http_query_param.rb +1 -1
- data/lib/ronin/db/http_query_param_name.rb +1 -1
- data/lib/ronin/db/http_request.rb +13 -1
- data/lib/ronin/db/http_request_header.rb +1 -1
- data/lib/ronin/db/http_response.rb +1 -1
- data/lib/ronin/db/http_response_header.rb +1 -1
- data/lib/ronin/db/ip_address.rb +46 -1
- data/lib/ronin/db/ip_address_mac_address.rb +1 -1
- data/lib/ronin/db/mac_address.rb +28 -1
- data/lib/ronin/db/migrations.rb +1 -1
- data/lib/ronin/db/model/has_name.rb +18 -1
- data/lib/ronin/db/model/has_unique_name.rb +1 -1
- data/lib/ronin/db/model/importable.rb +1 -1
- data/lib/ronin/db/model/last_scanned_at.rb +1 -1
- data/lib/ronin/db/model.rb +1 -1
- data/lib/ronin/db/models.rb +44 -2
- data/lib/ronin/db/note.rb +199 -0
- data/lib/ronin/db/open_port.rb +104 -3
- data/lib/ronin/db/organization.rb +237 -3
- data/lib/ronin/db/organization_customer.rb +73 -0
- data/lib/ronin/db/organization_department.rb +97 -0
- data/lib/ronin/db/organization_email_address.rb +66 -0
- data/lib/ronin/db/organization_host_name.rb +65 -0
- data/lib/ronin/db/organization_ip_address.rb +65 -0
- data/lib/ronin/db/organization_member.rb +158 -0
- data/lib/ronin/db/organization_phone_number.rb +66 -0
- data/lib/ronin/db/organization_street_address.rb +66 -0
- data/lib/ronin/db/os.rb +35 -1
- data/lib/ronin/db/os_guess.rb +1 -1
- data/lib/ronin/db/password.rb +84 -1
- data/lib/ronin/db/person.rb +455 -0
- data/lib/ronin/db/personal_connection.rb +110 -0
- data/lib/ronin/db/personal_email_address.rb +66 -0
- data/lib/ronin/db/personal_phone_number.rb +76 -0
- data/lib/ronin/db/personal_street_address.rb +66 -0
- data/lib/ronin/db/phone_number.rb +330 -0
- data/lib/ronin/db/port.rb +110 -1
- data/lib/ronin/db/service.rb +130 -1
- data/lib/ronin/db/service_credential.rb +1 -1
- data/lib/ronin/db/software.rb +37 -1
- data/lib/ronin/db/software_vendor.rb +1 -1
- data/lib/ronin/db/street_address.rb +340 -0
- data/lib/ronin/db/url.rb +37 -1
- data/lib/ronin/db/url_query_param.rb +1 -1
- data/lib/ronin/db/url_query_param_name.rb +9 -1
- data/lib/ronin/db/url_scheme.rb +1 -1
- data/lib/ronin/db/user_name.rb +58 -1
- data/lib/ronin/db/vulnerability.rb +1 -1
- data/lib/ronin/db/web_credential.rb +1 -1
- data/lib/ronin/db/web_vuln.rb +348 -0
- metadata +60 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 046d7b55f13cea0416cc4644fa5fa530b7b986faa50bc14a3bce1497371f249a
|
4
|
+
data.tar.gz: 0b2658ea88b1d38ba4d8dfbaf3bb1cdf033fc182848a241134bd3df58e0e68dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00fb2566cb4864e10f9e4c542aef827e7a65250e6b2244431582dedce82e2bf1e3de29ac551f20c78d6a51c3f80ae05da1a69352edbb78992ba0cfaa316c954b
|
7
|
+
data.tar.gz: 2d68d500f1931d77c5e05af63af9ec984a925a43d2d199c508a595f785477dca8bb97dd1d72555e68269f08f5064e9ed5f89db79e1abb119f0dadd4d23710035
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-3.
|
1
|
+
ruby-3.3
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,94 @@
|
|
1
|
+
### 0.2.0 / 2024-07-22
|
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
@@ -14,7 +14,8 @@
|
|
14
14
|
## Description
|
15
15
|
|
16
16
|
ronin-db-activerecord contains [ActiveRecord] models and migrations for the
|
17
|
-
[Ronin Database][ronin-db].
|
17
|
+
[Ronin Database][ronin-db]. Provides database models storing and querying
|
18
|
+
network data, advisory data, credentials, and OSINT data.
|
18
19
|
|
19
20
|
## Features
|
20
21
|
|
@@ -23,6 +24,13 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
|
|
23
24
|
* [Ronin::DB::Advisory]
|
24
25
|
* [Ronin::DB::Arch]
|
25
26
|
* [Ronin::DB::ASN]
|
27
|
+
* [Ronin::DB::Cert]
|
28
|
+
* [Ronin::DB::CertIssuer]
|
29
|
+
* [Ronin::DB::CertName]
|
30
|
+
* [Ronin::DB::CertSubject]
|
31
|
+
* [Ronin::DB::CertSubjectAltName]
|
32
|
+
* [Ronin::DB::DNSQuery]
|
33
|
+
* [Ronin::DB::DNSRecord]
|
26
34
|
* [Ronin::DB::EmailAddress]
|
27
35
|
* [Ronin::DB::HostName]
|
28
36
|
* [Ronin::DB::HostNameIPAddress]
|
@@ -36,22 +44,39 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
|
|
36
44
|
* [Ronin::DB::IPAddress]
|
37
45
|
* [Ronin::DB::IPAddressMACAddress]
|
38
46
|
* [Ronin::DB::MACAddress]
|
47
|
+
* [Ronin::DB::Note]
|
39
48
|
* [Ronin::DB::OpenPort]
|
40
49
|
* [Ronin::DB::Organization]
|
50
|
+
* [Ronin::DB::OrganizationCustomer]
|
51
|
+
* [Ronin::DB::OrganizationDepartment]
|
52
|
+
* [Ronin::DB::OrganizationEmailAddress]
|
53
|
+
* [Ronin::DB::OrganizationHostName]
|
54
|
+
* [Ronin::DB::OrganizationIPAddress]
|
55
|
+
* [Ronin::DB::OrganizationMember]
|
56
|
+
* [Ronin::DB::OrganizationPhoneNumber]
|
57
|
+
* [Ronin::DB::OrganizationStreetAddress]
|
41
58
|
* [Ronin::DB::OS]
|
42
59
|
* [Ronin::DB::OSGuess]
|
43
60
|
* [Ronin::DB::Password]
|
61
|
+
* [Ronin::DB::Person]
|
62
|
+
* [Ronin::DB::PersonalConnection]
|
63
|
+
* [Ronin::DB::PersonalEmailAddress]
|
64
|
+
* [Ronin::DB::PersonalPhoneNumber]
|
65
|
+
* [Ronin::DB::PersonalStreetAddress]
|
66
|
+
* [Ronin::DB::PhoneNumber]
|
44
67
|
* [Ronin::DB::Port]
|
45
68
|
* [Ronin::DB::Service]
|
46
69
|
* [Ronin::DB::ServiceCredential]
|
47
70
|
* [Ronin::DB::Software]
|
48
71
|
* [Ronin::DB::SoftwareVendor]
|
72
|
+
* [Ronin::DB::StreetAddress]
|
49
73
|
* [Ronin::DB::URL]
|
50
74
|
* [Ronin::DB::URLQueryParam]
|
51
75
|
* [Ronin::DB::URLQueryParamName]
|
52
76
|
* [Ronin::DB::URLScheme]
|
53
77
|
* [Ronin::DB::UserName]
|
54
78
|
* [Ronin::DB::Vulnerability]
|
79
|
+
* [Ronin::DB::WebVuln]
|
55
80
|
* [Ronin::DB::WebCredential]
|
56
81
|
* Has 98% documentation coverage.
|
57
82
|
* Has 99% test coverage.
|
@@ -59,6 +84,13 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
|
|
59
84
|
[Ronin::DB::Advisory]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Advisory.html
|
60
85
|
[Ronin::DB::Arch]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Arch.html
|
61
86
|
[Ronin::DB::ASN]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/ASN.html
|
87
|
+
[Ronin::DB::Cert]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Cert.html
|
88
|
+
[Ronin::DB::CertIssuer]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertIssuer.html
|
89
|
+
[Ronin::DB::CertName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertName.html
|
90
|
+
[Ronin::DB::CertSubject]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertSubject.html
|
91
|
+
[Ronin::DB::CertSubjectAltName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/CertSubjectAltName.html
|
92
|
+
[Ronin::DB::DNSQuery]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/DNSQuery.html
|
93
|
+
[Ronin::DB::DNSRecord]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/DNSRecord.html
|
62
94
|
[Ronin::DB::EmailAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/EmailAddress.html
|
63
95
|
[Ronin::DB::HostName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/HostName.html
|
64
96
|
[Ronin::DB::HostNameIPAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/HostNameIPAddress.html
|
@@ -72,22 +104,39 @@ ronin-db-activerecord contains [ActiveRecord] models and migrations for the
|
|
72
104
|
[Ronin::DB::IPAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/IPAddress.html
|
73
105
|
[Ronin::DB::IPAddressMACAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/IPAddressMACAddress.html
|
74
106
|
[Ronin::DB::MACAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/MACAddress.html
|
107
|
+
[Ronin::DB::Note]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Note.html
|
75
108
|
[Ronin::DB::OpenPort]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OpenPort.html
|
76
109
|
[Ronin::DB::Organization]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Organization.html
|
110
|
+
[Ronin::DB::OrganizationCustomer]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationCustomer.html
|
111
|
+
[Ronin::DB::OrganizationDepartment]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationDepartment.html
|
112
|
+
[Ronin::DB::OrganizationEmailAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationEmailAddress.html
|
113
|
+
[Ronin::DB::OrganizationHostName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationHostName.html
|
114
|
+
[Ronin::DB::OrganizationIPAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationIPAddress.html
|
115
|
+
[Ronin::DB::OrganizationMember]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationMember.html
|
116
|
+
[Ronin::DB::OrganizationPhoneNumber]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationPhoneNumber.html
|
117
|
+
[Ronin::DB::OrganizationStreetAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OrganizationStreetAddress.html
|
77
118
|
[Ronin::DB::OS]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OS.html
|
78
119
|
[Ronin::DB::OSGuess]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/OSGuess.html
|
79
120
|
[Ronin::DB::Password]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Password.html
|
121
|
+
[Ronin::DB::Person]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Person.html
|
122
|
+
[Ronin::DB::PersonalConnection]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalConnection.html
|
123
|
+
[Ronin::DB::PersonalEmailAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalEmailAddress.html
|
124
|
+
[Ronin::DB::PersonalPhoneNumber]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalPhoneNumber.html
|
125
|
+
[Ronin::DB::PersonalStreetAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PersonalStreetAddress.html
|
126
|
+
[Ronin::DB::PhoneNumber]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/PhoneNumber.html
|
80
127
|
[Ronin::DB::Port]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Port.html
|
81
128
|
[Ronin::DB::Service]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Service.html
|
82
129
|
[Ronin::DB::ServiceCredential]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/ServiceCredential.html
|
83
130
|
[Ronin::DB::Software]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Software.html
|
84
131
|
[Ronin::DB::SoftwareVendor]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/SoftwareVendor.html
|
132
|
+
[Ronin::DB::StreetAddress]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/StreetAddress.html
|
85
133
|
[Ronin::DB::URL]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URL.html
|
86
134
|
[Ronin::DB::URLQueryParam]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URLQueryParam.html
|
87
135
|
[Ronin::DB::URLQueryParamName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URLQueryParamName.html
|
88
136
|
[Ronin::DB::URLScheme]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/URLScheme.html
|
89
137
|
[Ronin::DB::UserName]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/UserName.html
|
90
138
|
[Ronin::DB::Vulnerability]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/Vulnerability.html
|
139
|
+
[Ronin::DB::WebVuln]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/WebVuln.html
|
91
140
|
[Ronin::DB::WebCredential]: https://ronin-rb.dev/docs/ronin-db-activerecord/Ronin/DB/WebCredential.html
|
92
141
|
|
93
142
|
## Examples
|
@@ -156,7 +205,7 @@ local database console.
|
|
156
205
|
|
157
206
|
## License
|
158
207
|
|
159
|
-
Copyright (c) 2022-
|
208
|
+
Copyright (c) 2022-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
160
209
|
|
161
210
|
ronin-db-activerecord is free software: you can redistribute it and/or modify
|
162
211
|
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
|