mihari 5.6.0 → 5.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/docs/analyzers/binaryedge.md +1 -1
  3. data/docs/analyzers/censys.md +1 -1
  4. data/docs/analyzers/circl.md +1 -1
  5. data/docs/analyzers/crtsh.md +1 -1
  6. data/docs/analyzers/dnstwister.md +1 -1
  7. data/docs/analyzers/greynoise.md +1 -1
  8. data/docs/analyzers/hunterhow.md +1 -1
  9. data/docs/analyzers/index.md +29 -15
  10. data/docs/analyzers/onyphe.md +1 -1
  11. data/docs/analyzers/otx.md +2 -2
  12. data/docs/analyzers/passivetotal.md +2 -2
  13. data/docs/analyzers/pulsedive.md +2 -2
  14. data/docs/analyzers/securitytrails.md +2 -2
  15. data/docs/analyzers/shodan.md +1 -1
  16. data/docs/analyzers/urlscan.md +3 -3
  17. data/docs/analyzers/virustotal.md +2 -2
  18. data/docs/analyzers/virustotal_intelligence.md +4 -4
  19. data/docs/analyzers/zoomeye.md +5 -0
  20. data/docs/enrichers/google_public_dns.md +1 -1
  21. data/docs/enrichers/ipinfo.md +2 -2
  22. data/docs/enrichers/shodan.md +4 -4
  23. data/docs/enrichers/whois.md +1 -1
  24. data/frontend/package-lock.json +3 -3
  25. data/lib/mihari/analyzers/circl.rb +1 -1
  26. data/lib/mihari/analyzers/crtsh.rb +1 -1
  27. data/lib/mihari/analyzers/dnstwister.rb +1 -1
  28. data/lib/mihari/analyzers/otx.rb +1 -1
  29. data/lib/mihari/analyzers/passivetotal.rb +1 -1
  30. data/lib/mihari/analyzers/pulsedive.rb +1 -1
  31. data/lib/mihari/analyzers/securitytrails.rb +1 -1
  32. data/lib/mihari/clients/base.rb +2 -2
  33. data/lib/mihari/clients/binaryedge.rb +3 -5
  34. data/lib/mihari/clients/censys.rb +3 -3
  35. data/lib/mihari/clients/circl.rb +5 -4
  36. data/lib/mihari/clients/crtsh.rb +3 -2
  37. data/lib/mihari/clients/dnstwister.rb +3 -2
  38. data/lib/mihari/clients/greynoise.rb +2 -2
  39. data/lib/mihari/clients/hunterhow.rb +2 -2
  40. data/lib/mihari/clients/misp.rb +1 -1
  41. data/lib/mihari/clients/onyphe.rb +2 -2
  42. data/lib/mihari/clients/otx.rb +4 -3
  43. data/lib/mihari/clients/passivetotal.rb +5 -4
  44. data/lib/mihari/clients/publsedive.rb +4 -3
  45. data/lib/mihari/clients/securitytrails.rb +5 -3
  46. data/lib/mihari/clients/shodan.rb +2 -2
  47. data/lib/mihari/clients/the_hive.rb +1 -1
  48. data/lib/mihari/clients/urlscan.rb +4 -4
  49. data/lib/mihari/clients/virustotal.rb +2 -2
  50. data/lib/mihari/clients/zoomeye.rb +2 -2
  51. data/lib/mihari/version.rb +1 -1
  52. data/mkdocs.yml +0 -3
  53. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9131a7f69be7cde564ec00479ae3fa3723a3e80d28690c3e989119de3feab5f5
4
- data.tar.gz: b115531cc635b7767e6bcf75c8ca0376e4ade45772e98aa9fc07df3b2dcc2e96
3
+ metadata.gz: d661d9c83ba421776c4ca19e4a6fe19b980bbcbe86fe5e7628c1c3a15205e8a9
4
+ data.tar.gz: d3a26407b8f8146b86c70cbc443865ff895390ad6f32816f5873464c3f6b4e9d
5
5
  SHA512:
6
- metadata.gz: 9a893bb138e769bf082bbea057229726f9b2e353fa539c9a1fb64aabcc8a622ed22315a0aa42e5dc873f6a13e3ec145776afe75203db93b7a3d2352d46b026b9
7
- data.tar.gz: cd11791f340b58ffc39a03fba8ee2aad1da58fcf47fd8a00281fe8984d0149fa1e448aff4b55860b47e5fb424d994a40ab00f7691b416f315b3fbfdcd5737509
6
+ metadata.gz: 35a3783578b46a62dd3eafada97f27ad1701df53ad2b53179155daf4e9545feca0ba912d35c9ca9e8ccaf1f5ce5a15760850d723d55af51f80388b14fc41d95d
7
+ data.tar.gz: 8f7b3a5624c0ea5b677b32983e21ca731afb396c1904737b923c2b0082c7d1e3cac141e655eeae441150d01d4a26cd83b50665685211118efe9c4bfad512eeef
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  ---
5
5
 
6
6
  # BinaryEdge
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  ---
5
5
 
6
6
  # Censys
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  - Passive DNS
5
5
  - Passive SSL
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - Domain
3
+ - Artifact:Domain
4
4
  ---
5
5
 
6
6
  # crt.sh
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - Domain
3
+ - Artifact:Domain
4
4
  ---
5
5
 
6
6
  # dnstwister
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  ---
5
5
 
6
6
  # GreyNoise
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  ---
5
5
 
6
6
  # Hunter How
@@ -26,29 +26,28 @@ All the analyzers can have optional `options`.
26
26
  analyzer: ...
27
27
  query: ...
28
28
  options:
29
- timeout: ...
30
- pagination_interval: ...
31
- pagination_limit: ...
32
29
  retry_times: ...
33
30
  retry_interval: ...
34
31
  retry_exponential_backoff: ...
32
+ timeout: ...
35
33
  ignore_error: ...
36
34
  ```
37
35
 
38
- ### Timeout
39
-
40
- `timeout` (`integer`) is an HTTP timeout in seconds. Optional.
41
-
42
- ### Pagination Interval
43
-
44
- `pagination_interval` (`integer`) is an interval in seconds between pagination. Optional. Defaults to 0.
36
+ Also the following analyzers can have pagination options.
45
37
 
46
- ### Pagination Limit
47
-
48
- `pagination_limit` (`integer`) is an limit for pagination. Optional. Defaults to 100.
38
+ - [Shodan](./shodan.md)
39
+ - [BinaryEdge](./binaryedge.md)
40
+ - [Censys](./censys.md)
41
+ - [ZoomEye](./zoomeye.md)
42
+ - [urlscan.io](./urlscan.md)
43
+ - [VirusTotal Intelligence](./virustotal_intelligence.md)
44
+ - [HunterHow](./hunterhow.md)
49
45
 
50
- In the worst case, if something wrong with Mihari or a service, Mihari can drain API quota by doing pagination forever.
51
- `pagination_limit` is a safety valve for that. A number of pagination is limited as `pagination_limit` times.
46
+ ```yaml
47
+ options:
48
+ pagination_interval: ...
49
+ pagination_limit: ...
50
+ ```
52
51
 
53
52
  ### Retry Times
54
53
 
@@ -62,6 +61,10 @@ In the worst case, if something wrong with Mihari or a service, Mihari can drain
62
61
 
63
62
  `retry_exponential_backoff` (`bool`) controls whether to do exponential backoff. Optional. Defaults to `true`.
64
63
 
64
+ ### Timeout
65
+
66
+ `timeout` (`integer`) is an HTTP timeout in seconds. Optional.
67
+
65
68
  ### Ignore Error
66
69
 
67
70
  `ignore_error` (`bool`) controls whether to ignore an error or not. Optional. Defaults to `false`.
@@ -87,3 +90,14 @@ queries:
87
90
  - analyzer: censys
88
91
  query: ip:8.8.8.8
89
92
  ```
93
+
94
+ ### Pagination Interval
95
+
96
+ `pagination_interval` (`integer`) is an interval in seconds between pagination. Optional. Defaults to 0.
97
+
98
+ ### Pagination Limit
99
+
100
+ `pagination_limit` (`integer`) is an limit for pagination. Optional. Defaults to 100.
101
+
102
+ In the worst case, if something wrong with Mihari or a service, Mihari can drain API quota by doing pagination forever.
103
+ `pagination_limit` is a safety valve for that. A number of pagination is limited as `pagination_limit` times.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  ---
5
5
 
6
6
  # ONYPHE
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
5
  - Passive DNS
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
5
  - Passive DNS
6
6
  - Passive SSL
7
7
  - Reverse Whois
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
5
  - Passive DNS
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
5
  - Passive DNS
6
6
  - Reverse Whois
7
7
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - IP address
3
+ - Artifact:IP
4
4
  ---
5
5
 
6
6
  # Shodan
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
5
- - URL
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
+ - Artifact:URL
6
6
  ---
7
7
 
8
8
  # urlscan.io
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
5
  - Passive DNS
6
6
  ---
7
7
 
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  tags:
3
- - IP address
4
- - Domain
5
- - URL
6
- - Hash
3
+ - Artifact:IP
4
+ - Artifact:Domain
5
+ - Artifact:URL
6
+ - Artifact:Hash
7
7
  ---
8
8
 
9
9
  # VirusTotal Intelligence
@@ -1,3 +1,8 @@
1
+ ---
2
+ tags:
3
+ - Artifact:IP
4
+ ---
5
+
1
6
  # ZoomEye
2
7
 
3
8
  - [https://zoomeye.org/](https://zoomeye.org/)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - DNS record
3
+ - Enrichment:DNS_Record
4
4
  ---
5
5
 
6
6
  # Google Public DNS
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  tags:
3
- - Autonomous system
4
- - Geolocation
3
+ - Enrichment:Autonomous_System
4
+ - Enrichment:Geolocation
5
5
  ---
6
6
 
7
7
  # ipinfo.io
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  tags:
3
- - Port
4
- - CPE
5
- - DNS record
3
+ - Enrichment:Port
4
+ - Enrichment:CPE
5
+ - Enrichment:DNS_Record
6
6
  ---
7
7
 
8
- # Shodan
8
+ # Shodan (The InternetDB API)
9
9
 
10
10
  - [https://www.shodan.io/](https://www.shodan.io/dashboard)
11
11
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  tags:
3
- - Whois
3
+ - Enrichment:Whois
4
4
  ---
5
5
 
6
6
  # Whois
@@ -6925,9 +6925,9 @@
6925
6925
  }
6926
6926
  },
6927
6927
  "node_modules/vue-template-compiler": {
6928
- "version": "2.7.14",
6929
- "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz",
6930
- "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==",
6928
+ "version": "2.7.15",
6929
+ "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.15.tgz",
6930
+ "integrity": "sha512-yQxjxMptBL7UAog00O8sANud99C6wJF+7kgbcwqkvA38vCGF7HWE66w0ZFnS/kX5gSoJr/PQ4/oS3Ne2pW37Og==",
6931
6931
  "dev": true,
6932
6932
  "dependencies": {
6933
6933
  "de-indent": "^1.0.2",
@@ -51,7 +51,7 @@ module Mihari
51
51
  private
52
52
 
53
53
  def client
54
- @client ||= Clients::CIRCL.new(username: username, password: password)
54
+ @client ||= Clients::CIRCL.new(username: username, password: password, timeout: timeout)
55
55
  end
56
56
 
57
57
  def username?
@@ -28,7 +28,7 @@ module Mihari
28
28
  # @return [Mihari::Clients::Crtsh]
29
29
  #
30
30
  def client
31
- @client ||= Mihari::Clients::Crtsh.new
31
+ @client ||= Mihari::Clients::Crtsh.new(timeout: timeout)
32
32
  end
33
33
  end
34
34
  end
@@ -39,7 +39,7 @@ module Mihari
39
39
  end
40
40
 
41
41
  def client
42
- @client ||= Clients::DNSTwister.new
42
+ @client ||= Clients::DNSTwister.new(timeout: timeout)
43
43
  end
44
44
 
45
45
  #
@@ -42,7 +42,7 @@ module Mihari
42
42
  private
43
43
 
44
44
  def client
45
- @client ||= Mihari::Clients::OTX.new(api_key: api_key)
45
+ @client ||= Mihari::Clients::OTX.new(api_key: api_key, timeout: timeout)
46
46
  end
47
47
 
48
48
  #
@@ -62,7 +62,7 @@ module Mihari
62
62
  private
63
63
 
64
64
  def client
65
- @client ||= Clients::PassiveTotal.new(username: username, api_key: api_key)
65
+ @client ||= Clients::PassiveTotal.new(username: username, api_key: api_key, timeout: timeout)
66
66
  end
67
67
 
68
68
  #
@@ -47,7 +47,7 @@ module Mihari
47
47
  private
48
48
 
49
49
  def client
50
- @client ||= Clients::PulseDive.new(api_key: api_key)
50
+ @client ||= Clients::PulseDive.new(api_key: api_key, timeout: timeout)
51
51
  end
52
52
 
53
53
  #
@@ -56,7 +56,7 @@ module Mihari
56
56
  private
57
57
 
58
58
  def client
59
- @client ||= Clients::SecurityTrails.new(api_key: api_key)
59
+ @client ||= Clients::SecurityTrails.new(api_key: api_key, timeout: timeout)
60
60
  end
61
61
 
62
62
  #
@@ -18,10 +18,10 @@ module Mihari
18
18
  #
19
19
  # @param [String] base_url
20
20
  # @param [Hash] headers
21
- # @param [Integer] interval
21
+ # @param [Integer] pagination_interval
22
22
  # @param [Integer, nil] timeout
23
23
  #
24
- def initialize(base_url, headers: {}, pagination_interval: 0, timeout: nil)
24
+ def initialize(base_url, headers: {}, pagination_interval: Mihari.config.pagination_interval, timeout: nil)
25
25
  @base_url = base_url
26
26
  @headers = headers || {}
27
27
  @pagination_interval = pagination_interval
@@ -7,21 +7,19 @@ module Mihari
7
7
  # @param [String] base_url
8
8
  # @param [String, nil] api_key
9
9
  # @param [Hash] headers
10
- # @param [Integer] pagnation_interval
11
10
  # @param [Integer, nil] timeout
11
+ # @param [Integer] pagination_interval
12
12
  #
13
13
  def initialize(
14
14
  base_url = "https://api.binaryedge.io/v2",
15
15
  api_key:,
16
16
  headers: {},
17
- pagination_interval: 0,
17
+ pagination_interval: Mihari.config.pagination_interval,
18
18
  timeout: nil
19
19
  )
20
- raise(ArgumentError, "'api_key' argument is required") unless api_key
21
-
22
20
  headers["x-key"] = api_key
23
21
 
24
- super(base_url, headers: headers, pagination_interval: pagination_interval, timeout: timeout)
22
+ super(base_url, headers: headers, timeout: timeout, pagination_interval: pagination_interval)
25
23
  end
26
24
 
27
25
  #
@@ -18,11 +18,11 @@ module Mihari
18
18
  id:,
19
19
  secret:,
20
20
  headers: {},
21
- pagination_interval: 0,
21
+ pagination_interval: Mihari.config.pagination_interval,
22
22
  timeout: nil
23
23
  )
24
- raise(ArgumentError, "'id' argument is required") if id.nil?
25
- raise(ArgumentError, "'secret' argument is required") if secret.nil?
24
+ raise(ArgumentError, "id is required") if id.nil?
25
+ raise(ArgumentError, "secret is required") if secret.nil?
26
26
 
27
27
  headers["authorization"] = "Basic #{Base64.strict_encode64("#{id}:#{secret}")}"
28
28
 
@@ -10,14 +10,15 @@ module Mihari
10
10
  # @param [String, nil] username
11
11
  # @param [String, nil] password
12
12
  # @param [Hash] headers
13
+ # @param [Integer, nil] timeout
13
14
  #
14
- def initialize(base_url = "https://www.circl.lu", username:, password:, headers: {})
15
- raise(ArgumentError, "'username' argument is required") if username.nil?
16
- raise(ArgumentError, "'password' argument is required") if password.nil?
15
+ def initialize(base_url = "https://www.circl.lu", username:, password:, headers: {}, timeout: nil)
16
+ raise(ArgumentError, "username is required") if username.nil?
17
+ raise(ArgumentError, "password is required") if password.nil?
17
18
 
18
19
  headers["authorization"] = "Basic #{Base64.strict_encode64("#{username}:#{password}")}"
19
20
 
20
- super(base_url, headers: headers)
21
+ super(base_url, headers: headers, timeout: timeout)
21
22
  end
22
23
 
23
24
  #
@@ -6,9 +6,10 @@ module Mihari
6
6
  #
7
7
  # @param [String] base_url
8
8
  # @param [Hash] headers
9
+ # @param [Integer, nil] timeout
9
10
  #
10
- def initialize(base_url = "https://crt.sh", headers: {})
11
- super(base_url, headers: headers)
11
+ def initialize(base_url = "https://crt.sh", headers: {}, timeout: nil)
12
+ super(base_url, headers: headers, timeout: timeout)
12
13
  end
13
14
 
14
15
  #
@@ -6,9 +6,10 @@ module Mihari
6
6
  #
7
7
  # @param [String] base_url
8
8
  # @param [Hash] headers
9
+ # @param [Integer, nil] timeout
9
10
  #
10
- def initialize(base_url = "https://dnstwister.report", headers: {})
11
- super(base_url, headers: headers)
11
+ def initialize(base_url = "https://dnstwister.report", headers: {}, timeout: nil)
12
+ super(base_url, headers: headers, timeout: timeout)
12
13
  end
13
14
 
14
15
  #
@@ -16,10 +16,10 @@ module Mihari
16
16
  base_url = "https://api.greynoise.io",
17
17
  api_key:,
18
18
  headers: {},
19
- pagination_interval: 0,
19
+ pagination_interval: Mihari.config.pagination_interval,
20
20
  timeout: nil
21
21
  )
22
- raise(ArgumentError, "'api_key' argument is required") unless api_key
22
+ raise(ArgumentError, "api_key is required") unless api_key
23
23
 
24
24
  headers["key"] = api_key
25
25
  super(base_url, headers: headers, pagination_interval: pagination_interval, timeout: timeout)
@@ -21,10 +21,10 @@ module Mihari
21
21
  base_url = "https://api.hunter.how/",
22
22
  api_key:,
23
23
  headers: {},
24
- pagination_interval: 0,
24
+ pagination_interval: Mihari.config.pagination_interval,
25
25
  timeout: nil
26
26
  )
27
- raise(ArgumentError, "'api_key' argument is required") unless api_key
27
+ raise(ArgumentError, "api_key is required") unless api_key
28
28
 
29
29
  super(base_url, headers: headers, pagination_interval: pagination_interval, timeout: timeout)
30
30
 
@@ -10,7 +10,7 @@ module Mihari
10
10
  # @param [Integer, nil] timeout
11
11
  #
12
12
  def initialize(base_url, api_key:, headers: {}, timeout: nil)
13
- raise(ArgumentError, "'api_key' argument is required") unless api_key
13
+ raise(ArgumentError, "api_key is required") unless api_key
14
14
 
15
15
  headers["authorization"] = api_key
16
16
  headers["accept"] = "application/json"
@@ -19,10 +19,10 @@ module Mihari
19
19
  base_url = "https://www.onyphe.io",
20
20
  api_key:,
21
21
  headers: {},
22
- pagination_interval: 0,
22
+ pagination_interval: Mihari.config.pagination_interval,
23
23
  timeout: nil
24
24
  )
25
- raise(ArgumentError, "'api_key' argument is required") if api_key.nil?
25
+ raise(ArgumentError, "api_key is required") if api_key.nil?
26
26
 
27
27
  super(base_url, headers: headers, pagination_interval: pagination_interval, timeout: timeout)
28
28
 
@@ -7,12 +7,13 @@ module Mihari
7
7
  # @param [String] base_url
8
8
  # @param [String, nil] api_key
9
9
  # @param [Hash] headers
10
+ # @param [Integer, nil] timeout
10
11
  #
11
- def initialize(base_url = "https://otx.alienvault.com", api_key:, headers: {})
12
- raise(ArgumentError, "'api_key' argument is required") unless api_key
12
+ def initialize(base_url = "https://otx.alienvault.com", api_key:, headers: {}, timeout: nil)
13
+ raise(ArgumentError, "api_key is required") unless api_key
13
14
 
14
15
  headers["x-otx-api-key"] = api_key
15
- super(base_url, headers: headers)
16
+ super(base_url, headers: headers, timeout: timeout)
16
17
  end
17
18
 
18
19
  #
@@ -10,14 +10,15 @@ module Mihari
10
10
  # @param [String, nil] username
11
11
  # @param [String, nil] api_key
12
12
  # @param [Hash] headers
13
+ # @param [Integer, nil] timeout
13
14
  #
14
- def initialize(base_url = "https://api.passivetotal.org", username:, api_key:, headers: {})
15
- raise(ArgumentError, "'username' argument is required") if username.nil?
16
- raise(ArgumentError, "'api_key' argument is required") if api_key.nil?
15
+ def initialize(base_url = "https://api.passivetotal.org", username:, api_key:, headers: {}, timeout: nil)
16
+ raise(ArgumentError, "username is required") if username.nil?
17
+ raise(ArgumentError, "api_key is required") if api_key.nil?
17
18
 
18
19
  headers["authorization"] = "Basic #{Base64.strict_encode64("#{username}:#{api_key}")}"
19
20
 
20
- super(base_url, headers: headers)
21
+ super(base_url, headers: headers, timeout: timeout)
21
22
  end
22
23
 
23
24
  #
@@ -10,13 +10,14 @@ module Mihari
10
10
  # @param [String] base_url
11
11
  # @param [String, nil] api_key
12
12
  # @param [Hash] headers
13
+ # @param [Integer, nil] timeout
13
14
  #
14
- def initialize(base_url = "https://pulsedive.com", api_key:, headers: {})
15
- super(base_url, headers: headers)
15
+ def initialize(base_url = "https://pulsedive.com", api_key:, headers: {}, timeout: nil)
16
+ raise(ArgumentError, "api_key is required") unless api_key
16
17
 
17
18
  @api_key = api_key
18
19
 
19
- raise(ArgumentError, "'api_key' argument is required") unless api_key
20
+ super(base_url, headers: headers, timeout: timeout)
20
21
  end
21
22
 
22
23
  #
@@ -7,12 +7,14 @@ module Mihari
7
7
  # @param [String] base_url
8
8
  # @param [String, nil] api_key
9
9
  # @param [Hash] headers
10
+ # @param [Integer, nil] timeout
10
11
  #
11
- def initialize(base_url = "https://api.securitytrails.com", api_key:, headers: {})
12
- raise(ArgumentError, "'api_key' argument is required") unless api_key
12
+ def initialize(base_url = "https://api.securitytrails.com", api_key:, headers: {}, timeout: nil)
13
+ raise(ArgumentError, "api_key is required") unless api_key
13
14
 
14
15
  headers["apikey"] = api_key
15
- super(base_url, headers: headers)
16
+
17
+ super(base_url, headers: headers, timeout: timeout)
16
18
  end
17
19
 
18
20
  #
@@ -19,10 +19,10 @@ module Mihari
19
19
  base_url = "https://api.shodan.io",
20
20
  api_key:,
21
21
  headers: {},
22
- pagination_interval: 0,
22
+ pagination_interval: Mihari.config.pagination_interval,
23
23
  timeout: nil
24
24
  )
25
- raise(ArgumentError, "'api_key' argument is required") unless api_key
25
+ raise(ArgumentError, "api_key is required") unless api_key
26
26
 
27
27
  super(base_url, headers: headers, pagination_interval: pagination_interval, timeout: timeout)
28
28
 
@@ -11,7 +11,7 @@ module Mihari
11
11
  # @param [Integer, nil] timeout
12
12
  #
13
13
  def initialize(base_url, api_key:, api_version:, headers: {}, timeout: nil)
14
- raise(ArgumentError, "'api_key' argument is required") unless api_key
14
+ raise(ArgumentError, "api_key is required") unless api_key
15
15
 
16
16
  base_url += "/#{api_version}" unless api_version.nil?
17
17
  headers["authorization"] = "Bearer #{api_key}"
@@ -7,17 +7,17 @@ module Mihari
7
7
  # @param [String] base_url
8
8
  # @param [String, nil] api_key
9
9
  # @param [Hash] headers
10
- # @param [Interval, nil] interval
11
- # @param [Interval, nil] timeout
10
+ # @param [Integer, nil] interval
11
+ # @param [Integer, nil] timeout
12
12
  #
13
13
  def initialize(
14
14
  base_url = "https://urlscan.io",
15
15
  api_key:,
16
16
  headers: {},
17
- pagination_interval: 0,
17
+ pagination_interval: Mihari.config.pagination_interval,
18
18
  timeout: nil
19
19
  )
20
- raise(ArgumentError, "'api_key' argument is required") if api_key.nil?
20
+ raise(ArgumentError, "api_key is required") if api_key.nil?
21
21
 
22
22
  headers["api-key"] = api_key
23
23
 
@@ -14,10 +14,10 @@ module Mihari
14
14
  base_url = "https://www.virustotal.com",
15
15
  api_key:,
16
16
  headers: {},
17
- pagination_interval: 0,
17
+ pagination_interval: Mihari.config.pagination_interval,
18
18
  timeout: nil
19
19
  )
20
- raise(ArgumentError, "'api_key' argument is required") if api_key.nil?
20
+ raise(ArgumentError, "api_key is required") if api_key.nil?
21
21
 
22
22
  headers["x-apikey"] = api_key
23
23
 
@@ -18,10 +18,10 @@ module Mihari
18
18
  base_url = "https://api.zoomeye.org",
19
19
  api_key:,
20
20
  headers: {},
21
- pagination_interval: 0,
21
+ pagination_interval: Mihari.config.pagination_interval,
22
22
  timeout: nil
23
23
  )
24
- raise(ArgumentError, "'api_key' argument is required") unless api_key
24
+ raise(ArgumentError, "api_key is required") unless api_key
25
25
 
26
26
  headers["api-key"] = api_key
27
27
  super(base_url, headers: headers, pagination_interval: pagination_interval, timeout: timeout)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "5.6.0"
4
+ VERSION = "5.6.1"
5
5
  end
data/mkdocs.yml CHANGED
@@ -8,9 +8,6 @@ plugins:
8
8
  tags:
9
9
  enabled: true
10
10
  tags_file: tags.md
11
- tags_slugify: !!python/object/apply:pymdownx.slugs.slugify
12
- kwds:
13
- case: lower
14
11
 
15
12
  nav:
16
13
  - Requirements: requirements.md
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mihari
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.0
4
+ version: 5.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-22 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler