mihari 5.6.0 → 5.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) 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 +176 -179
  25. data/frontend/package.json +9 -9
  26. data/lib/mihari/{base.rb → actor.rb} +16 -2
  27. data/lib/mihari/analyzers/base.rb +5 -10
  28. data/lib/mihari/analyzers/censys.rb +1 -1
  29. data/lib/mihari/analyzers/circl.rb +1 -1
  30. data/lib/mihari/analyzers/crtsh.rb +1 -1
  31. data/lib/mihari/analyzers/dnstwister.rb +1 -1
  32. data/lib/mihari/analyzers/hunterhow.rb +1 -1
  33. data/lib/mihari/analyzers/otx.rb +1 -1
  34. data/lib/mihari/analyzers/passivetotal.rb +2 -2
  35. data/lib/mihari/analyzers/pulsedive.rb +2 -2
  36. data/lib/mihari/analyzers/securitytrails.rb +2 -2
  37. data/lib/mihari/analyzers/urlscan.rb +1 -1
  38. data/lib/mihari/analyzers/virustotal.rb +5 -5
  39. data/lib/mihari/analyzers/zoomeye.rb +3 -3
  40. data/lib/mihari/clients/base.rb +2 -2
  41. data/lib/mihari/clients/binaryedge.rb +3 -5
  42. data/lib/mihari/clients/censys.rb +3 -3
  43. data/lib/mihari/clients/circl.rb +5 -4
  44. data/lib/mihari/clients/crtsh.rb +5 -4
  45. data/lib/mihari/clients/dnstwister.rb +3 -2
  46. data/lib/mihari/clients/greynoise.rb +2 -2
  47. data/lib/mihari/clients/hunterhow.rb +2 -2
  48. data/lib/mihari/clients/misp.rb +1 -1
  49. data/lib/mihari/clients/onyphe.rb +2 -2
  50. data/lib/mihari/clients/otx.rb +4 -3
  51. data/lib/mihari/clients/passivetotal.rb +9 -8
  52. data/lib/mihari/clients/publsedive.rb +4 -3
  53. data/lib/mihari/clients/securitytrails.rb +8 -6
  54. data/lib/mihari/clients/shodan.rb +2 -2
  55. data/lib/mihari/clients/the_hive.rb +1 -1
  56. data/lib/mihari/clients/urlscan.rb +4 -4
  57. data/lib/mihari/clients/virustotal.rb +2 -2
  58. data/lib/mihari/clients/zoomeye.rb +2 -2
  59. data/lib/mihari/commands/rule.rb +2 -11
  60. data/lib/mihari/commands/search.rb +1 -1
  61. data/lib/mihari/emitters/base.rb +13 -24
  62. data/lib/mihari/emitters/database.rb +7 -9
  63. data/lib/mihari/emitters/misp.rb +14 -38
  64. data/lib/mihari/emitters/slack.rb +14 -11
  65. data/lib/mihari/emitters/the_hive.rb +16 -44
  66. data/lib/mihari/emitters/webhook.rb +31 -21
  67. data/lib/mihari/enrichers/base.rb +1 -6
  68. data/lib/mihari/enrichers/whois.rb +1 -1
  69. data/lib/mihari/models/alert.rb +75 -73
  70. data/lib/mihari/models/artifact.rb +182 -180
  71. data/lib/mihari/models/autonomous_system.rb +22 -20
  72. data/lib/mihari/models/cpe.rb +21 -19
  73. data/lib/mihari/models/dns.rb +24 -22
  74. data/lib/mihari/models/geolocation.rb +22 -20
  75. data/lib/mihari/models/port.rb +21 -19
  76. data/lib/mihari/models/reverse_dns.rb +21 -19
  77. data/lib/mihari/models/rule.rb +67 -65
  78. data/lib/mihari/models/tag.rb +5 -3
  79. data/lib/mihari/models/tagging.rb +5 -3
  80. data/lib/mihari/models/whois.rb +18 -16
  81. data/lib/mihari/rule.rb +352 -0
  82. data/lib/mihari/schemas/analyzer.rb +94 -87
  83. data/lib/mihari/schemas/emitter.rb +9 -5
  84. data/lib/mihari/schemas/enricher.rb +8 -4
  85. data/lib/mihari/schemas/mixins.rb +15 -0
  86. data/lib/mihari/schemas/rule.rb +3 -10
  87. data/lib/mihari/services/alert_builder.rb +1 -1
  88. data/lib/mihari/services/alert_proxy.rb +10 -6
  89. data/lib/mihari/services/alert_runner.rb +4 -4
  90. data/lib/mihari/services/rule_builder.rb +3 -3
  91. data/lib/mihari/services/rule_runner.rb +5 -5
  92. data/lib/mihari/structs/binaryedge.rb +1 -1
  93. data/lib/mihari/structs/censys.rb +6 -6
  94. data/lib/mihari/structs/config.rb +1 -1
  95. data/lib/mihari/structs/greynoise.rb +5 -5
  96. data/lib/mihari/structs/hunterhow.rb +3 -3
  97. data/lib/mihari/structs/onyphe.rb +5 -5
  98. data/lib/mihari/structs/shodan.rb +6 -6
  99. data/lib/mihari/structs/urlscan.rb +3 -3
  100. data/lib/mihari/structs/virustotal_intelligence.rb +3 -3
  101. data/lib/mihari/version.rb +1 -1
  102. data/lib/mihari/web/endpoints/alerts.rb +4 -4
  103. data/lib/mihari/web/endpoints/artifacts.rb +6 -6
  104. data/lib/mihari/web/endpoints/rules.rb +10 -17
  105. data/lib/mihari/web/endpoints/tags.rb +2 -2
  106. data/lib/mihari/web/public/assets/{index-9cc489e6.js → index-28d4c79d.js} +48 -48
  107. data/lib/mihari/web/public/index.html +1 -1
  108. data/lib/mihari.rb +6 -8
  109. data/mihari.gemspec +1 -2
  110. data/mkdocs.yml +0 -3
  111. data/requirements.txt +1 -1
  112. metadata +8 -22
  113. data/lib/mihari/analyzers/rule.rb +0 -232
  114. data/lib/mihari/services/rule_proxy.rb +0 -182
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9131a7f69be7cde564ec00479ae3fa3723a3e80d28690c3e989119de3feab5f5
4
- data.tar.gz: b115531cc635b7767e6bcf75c8ca0376e4ade45772e98aa9fc07df3b2dcc2e96
3
+ metadata.gz: 7136011e523fa8b61ed048932c1ca7e265425a4eaf89c76a5f8052f74c108f17
4
+ data.tar.gz: 243dfcbc17341520912a626210a336d0cdd419b011160d4d2f60ddd1f2326c33
5
5
  SHA512:
6
- metadata.gz: 9a893bb138e769bf082bbea057229726f9b2e353fa539c9a1fb64aabcc8a622ed22315a0aa42e5dc873f6a13e3ec145776afe75203db93b7a3d2352d46b026b9
7
- data.tar.gz: cd11791f340b58ffc39a03fba8ee2aad1da58fcf47fd8a00281fe8984d0149fa1e448aff4b55860b47e5fb424d994a40ab00f7691b416f315b3fbfdcd5737509
6
+ metadata.gz: eade462830cc2258517594564713cd5b612755f359a4efafb40fd16973282785f9a0ad610e3063c9b372ffddcf45e98773e6047f3761547493a68f6bafe25769
7
+ data.tar.gz: 7ff869faaaf0782d842e241e476d5b7602d94e3c08ae2588d4fcbe56d0c44bb6b38714db72fa6be5da70ca5989c6803193b0516614af80d2752114783ff3a5bf
@@ -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