mihari 3.12.0 → 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -0
  3. data/config.ru +0 -1
  4. data/lib/mihari/analyzers/base.rb +6 -6
  5. data/lib/mihari/analyzers/binaryedge.rb +3 -5
  6. data/lib/mihari/analyzers/censys.rb +1 -3
  7. data/lib/mihari/analyzers/circl.rb +0 -3
  8. data/lib/mihari/analyzers/crtsh.rb +7 -5
  9. data/lib/mihari/analyzers/dnpedia.rb +4 -4
  10. data/lib/mihari/analyzers/dnstwister.rb +1 -4
  11. data/lib/mihari/analyzers/feed.rb +0 -3
  12. data/lib/mihari/analyzers/greynoise.rb +1 -3
  13. data/lib/mihari/analyzers/onyphe.rb +1 -3
  14. data/lib/mihari/analyzers/otx.rb +0 -3
  15. data/lib/mihari/analyzers/passivetotal.rb +8 -9
  16. data/lib/mihari/analyzers/pulsedive.rb +7 -5
  17. data/lib/mihari/analyzers/rule.rb +5 -6
  18. data/lib/mihari/analyzers/securitytrails.rb +10 -7
  19. data/lib/mihari/analyzers/shodan.rb +19 -6
  20. data/lib/mihari/analyzers/spyse.rb +10 -11
  21. data/lib/mihari/analyzers/urlscan.rb +5 -6
  22. data/lib/mihari/analyzers/virustotal.rb +8 -9
  23. data/lib/mihari/analyzers/virustotal_intelligence.rb +4 -5
  24. data/lib/mihari/analyzers/zoomeye.rb +4 -5
  25. data/lib/mihari/cli/base.rb +0 -5
  26. data/lib/mihari/cli/init.rb +0 -2
  27. data/lib/mihari/cli/main.rb +4 -6
  28. data/lib/mihari/cli/mixins/utils.rb +2 -18
  29. data/lib/mihari/commands/init.rb +0 -18
  30. data/lib/mihari/commands/search.rb +20 -15
  31. data/lib/mihari/commands/validator.rb +7 -19
  32. data/lib/mihari/commands/web.rb +0 -3
  33. data/lib/mihari/database.rb +66 -14
  34. data/lib/mihari/emitters/misp.rb +0 -1
  35. data/lib/mihari/emitters/slack.rb +3 -4
  36. data/lib/mihari/emitters/stdout.rb +0 -2
  37. data/lib/mihari/emitters/the_hive.rb +0 -1
  38. data/lib/mihari/emitters/webhook.rb +1 -5
  39. data/lib/mihari/enrichers/ipinfo.rb +0 -2
  40. data/lib/mihari/errors.rb +2 -0
  41. data/lib/mihari/feed/reader.rb +22 -8
  42. data/lib/mihari/mixins/database.rb +14 -0
  43. data/lib/mihari/mixins/disallowed_data_value.rb +1 -4
  44. data/lib/mihari/mixins/rule.rb +34 -31
  45. data/lib/mihari/models/alert.rb +3 -3
  46. data/lib/mihari/models/artifact.rb +0 -5
  47. data/lib/mihari/models/autonomous_system.rb +0 -2
  48. data/lib/mihari/models/dns.rb +0 -3
  49. data/lib/mihari/models/geolocation.rb +0 -1
  50. data/lib/mihari/models/reverse_dns.rb +0 -3
  51. data/lib/mihari/models/rule.rb +73 -0
  52. data/lib/mihari/models/tag.rb +0 -2
  53. data/lib/mihari/models/tagging.rb +0 -2
  54. data/lib/mihari/models/whois.rb +0 -2
  55. data/lib/mihari/notifiers/exception_notifier.rb +0 -2
  56. data/lib/mihari/schemas/analyzer.rb +0 -5
  57. data/lib/mihari/schemas/macros.rb +0 -2
  58. data/lib/mihari/schemas/rule.rb +0 -5
  59. data/lib/mihari/structs/alert.rb +0 -3
  60. data/lib/mihari/structs/censys.rb +3 -4
  61. data/lib/mihari/structs/greynoise.rb +3 -4
  62. data/lib/mihari/structs/ipinfo.rb +0 -3
  63. data/lib/mihari/structs/onyphe.rb +5 -6
  64. data/lib/mihari/structs/rule.rb +127 -0
  65. data/lib/mihari/structs/shodan.rb +3 -4
  66. data/lib/mihari/structs/urlscan.rb +0 -3
  67. data/lib/mihari/structs/virustotal_intelligence.rb +3 -4
  68. data/lib/mihari/type_checker.rb +2 -6
  69. data/lib/mihari/types.rb +0 -2
  70. data/lib/mihari/version.rb +1 -1
  71. data/lib/mihari/web/api.rb +4 -0
  72. data/lib/mihari/web/app.rb +6 -8
  73. data/lib/mihari/web/endpoints/alerts.rb +7 -3
  74. data/lib/mihari/web/endpoints/artifacts.rb +6 -3
  75. data/lib/mihari/web/endpoints/command.rb +2 -1
  76. data/lib/mihari/web/endpoints/configs.rb +2 -1
  77. data/lib/mihari/web/endpoints/ip_addresses.rb +2 -1
  78. data/lib/mihari/web/endpoints/rules.rb +175 -0
  79. data/lib/mihari/web/endpoints/sources.rb +2 -1
  80. data/lib/mihari/web/endpoints/tags.rb +4 -2
  81. data/lib/mihari/web/entities/artifact.rb +2 -0
  82. data/lib/mihari/web/entities/rule.rb +35 -0
  83. data/lib/mihari/web/middleware/connection_adapter.rb +19 -0
  84. data/lib/mihari/web/public/index.html +1 -1
  85. data/lib/mihari/web/public/redoc-static.html +39 -22
  86. data/lib/mihari/web/public/static/js/app.49ab738a.js +21 -0
  87. data/lib/mihari/web/public/static/js/app.49ab738a.js.map +1 -0
  88. data/lib/mihari/web/public/static/js/app.b88ce341.js +35 -0
  89. data/lib/mihari/web/public/static/js/app.b88ce341.js.map +1 -0
  90. data/lib/mihari/web/public/static/js/app.cb1fa7be.js +30 -0
  91. data/lib/mihari/web/public/static/js/app.cb1fa7be.js.map +1 -0
  92. data/lib/mihari/web/public/static/js/app.eb95cfc9.js +30 -0
  93. data/lib/mihari/web/public/static/js/app.eb95cfc9.js.map +1 -0
  94. data/lib/mihari.rb +40 -35
  95. data/mihari.gemspec +11 -13
  96. data/sig/lib/mihari/analyzers/binaryedge.rbs +0 -3
  97. data/sig/lib/mihari/analyzers/censys.rbs +0 -3
  98. data/sig/lib/mihari/analyzers/circl.rbs +1 -3
  99. data/sig/lib/mihari/analyzers/crtsh.rbs +1 -3
  100. data/sig/lib/mihari/analyzers/dnpedia.rbs +1 -4
  101. data/sig/lib/mihari/analyzers/dnstwister.rbs +1 -3
  102. data/sig/lib/mihari/analyzers/feed.rbs +0 -3
  103. data/sig/lib/mihari/analyzers/onyphe.rbs +0 -3
  104. data/sig/lib/mihari/analyzers/otx.rbs +1 -3
  105. data/sig/lib/mihari/analyzers/passivetotal.rbs +3 -5
  106. data/sig/lib/mihari/analyzers/pulsedive.rbs +2 -4
  107. data/sig/lib/mihari/analyzers/securitytrails.rbs +3 -5
  108. data/sig/lib/mihari/analyzers/shodan.rbs +2 -3
  109. data/sig/lib/mihari/analyzers/spyse.rbs +4 -6
  110. data/sig/lib/mihari/analyzers/urlscan.rbs +1 -3
  111. data/sig/lib/mihari/analyzers/virustotal.rbs +4 -6
  112. data/sig/lib/mihari/analyzers/virustotal_intelligence.rbs +0 -3
  113. data/sig/lib/mihari/analyzers/zoomeye.rbs +2 -4
  114. data/sig/lib/mihari/commands/init.rbs +0 -2
  115. data/sig/lib/mihari/commands/validator.rbs +0 -2
  116. data/sig/lib/mihari/emitters/slack.rbs +0 -1
  117. data/sig/lib/mihari/feed/reader.rbs +1 -1
  118. data/sig/lib/mihari/mixins/disallowed_data_value.rbs +0 -2
  119. data/sig/lib/mihari/mixins/rule.rbs +5 -12
  120. data/sig/lib/mihari/models/alert.rbs +1 -1
  121. data/sig/lib/mihari/models/artifact.rbs +2 -0
  122. data/sig/lib/mihari/models/rule.rbs +14 -0
  123. data/sig/lib/mihari/structs/rule.rbs +56 -0
  124. data/sig/lib/mihari.rbs +0 -2
  125. metadata +40 -97
  126. data/lib/mihari/analyzers/basic.rb +0 -19
  127. data/lib/mihari/cli/analyzer.rb +0 -55
  128. data/lib/mihari/commands/binaryedge.rb +0 -21
  129. data/lib/mihari/commands/censys.rb +0 -22
  130. data/lib/mihari/commands/circl.rb +0 -21
  131. data/lib/mihari/commands/crtsh.rb +0 -22
  132. data/lib/mihari/commands/dnpedia.rb +0 -21
  133. data/lib/mihari/commands/dnstwister.rb +0 -21
  134. data/lib/mihari/commands/feed.rb +0 -26
  135. data/lib/mihari/commands/greynoise.rb +0 -21
  136. data/lib/mihari/commands/json.rb +0 -42
  137. data/lib/mihari/commands/onyphe.rb +0 -21
  138. data/lib/mihari/commands/otx.rb +0 -21
  139. data/lib/mihari/commands/passivetotal.rb +0 -22
  140. data/lib/mihari/commands/pulsedive.rb +0 -21
  141. data/lib/mihari/commands/securitytrails.rb +0 -22
  142. data/lib/mihari/commands/shodan.rb +0 -21
  143. data/lib/mihari/commands/spyse.rb +0 -22
  144. data/lib/mihari/commands/urlscan.rb +0 -22
  145. data/lib/mihari/commands/virustotal.rb +0 -22
  146. data/lib/mihari/commands/virustotal_intelligence.rb +0 -22
  147. data/lib/mihari/commands/zoomeye.rb +0 -22
  148. data/lib/mihari/mixins/configuration.rb +0 -100
  149. data/lib/mihari/mixins/hash.rb +0 -20
  150. data/lib/mihari/schemas/configuration.rb +0 -44
  151. data/lib/mihari/web/public/grape.rb +0 -73
  152. data/sig/lib/mihari/analyzers/basic.rbs +0 -17
  153. data/sig/lib/mihari/cli/analyzer.rbs +0 -43
  154. data/sig/lib/mihari/commands/binaryedge.rbs +0 -7
  155. data/sig/lib/mihari/commands/censys.rbs +0 -7
  156. data/sig/lib/mihari/commands/circl.rbs +0 -7
  157. data/sig/lib/mihari/commands/crtsh.rbs +0 -7
  158. data/sig/lib/mihari/commands/dnpedia.rbs +0 -7
  159. data/sig/lib/mihari/commands/dnstwister.rbs +0 -7
  160. data/sig/lib/mihari/commands/feed.rbs +0 -7
  161. data/sig/lib/mihari/commands/onyphe.rbs +0 -7
  162. data/sig/lib/mihari/commands/otx.rbs +0 -7
  163. data/sig/lib/mihari/commands/passivetotal.rbs +0 -7
  164. data/sig/lib/mihari/commands/pulsedive.rbs +0 -7
  165. data/sig/lib/mihari/commands/securitytrails.rbs +0 -7
  166. data/sig/lib/mihari/commands/shodan.rbs +0 -7
  167. data/sig/lib/mihari/commands/spyse.rbs +0 -7
  168. data/sig/lib/mihari/commands/urlscan.rbs +0 -7
  169. data/sig/lib/mihari/commands/virustotal.rbs +0 -7
  170. data/sig/lib/mihari/commands/zoomeye.rbs +0 -7
@@ -0,0 +1,56 @@
1
+ module Mihari
2
+ module Structs
3
+ module Rule
4
+ class SearchFilter < Dry::Struct
5
+ end
6
+
7
+ class SearchFilterWithPagination < SearchFilter
8
+ def without_pagination: () -> SearchFilter
9
+ end
10
+
11
+ class Rule
12
+ attr_reader data: Hash
13
+
14
+ attr_reader errors: Array[untypes]
15
+
16
+ def initialize: (Hash data) -> void
17
+
18
+ #
19
+ # @return [Boolean]
20
+ #
21
+ def errors?: () -> (bool)
22
+
23
+ #
24
+ # @return [Array[String]]
25
+ #
26
+ def error_messages: () -> (Array[String])
27
+
28
+ def validate: () -> void
29
+
30
+ def validate!: () -> void
31
+
32
+ def []: (untyped key) -> untyped
33
+
34
+ #
35
+ # @return [String]
36
+ #
37
+ def id: () -> String
38
+
39
+ #
40
+ # @return [String]
41
+ #
42
+ def title: () -> String
43
+
44
+ #
45
+ # @return [String]
46
+ #
47
+ def description: () -> String
48
+
49
+ #
50
+ # @return [Mihari::Rule]
51
+ #
52
+ def to_model: () -> Mihari::Rule
53
+ end
54
+ end
55
+ end
56
+ end
data/sig/lib/mihari.rbs CHANGED
@@ -36,8 +36,6 @@ module Mihari
36
36
 
37
37
  extend Mixins::Configuration
38
38
 
39
- # include Mem
40
-
41
39
  def self.emitters: () -> ::Array[singleton(Mihari::Emitters::Base)]
42
40
 
43
41
  def self.analyzers: () -> ::Array[singleton(Mihari::Analyzers::Base)]
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: 3.12.0
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-03 00:00:00.000000000 Z
11
+ date: 2022-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.2'
89
+ version: '1.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.2'
96
+ version: '1.3'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rack-test
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -156,28 +156,28 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '3.10'
159
+ version: '3.11'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '3.10'
166
+ version: '3.11'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: standard
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '1.5'
173
+ version: '1.7'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '1.5'
180
+ version: '1.7'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: steep
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 7.0.0
243
+ version: 7.0.2.2
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 7.0.0
250
+ version: 7.0.2.2
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: addressable
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -268,14 +268,14 @@ dependencies:
268
268
  requirements:
269
269
  - - "~>"
270
270
  - !ruby/object:Gem::Version
271
- version: '1.2'
271
+ version: '2.0'
272
272
  type: :runtime
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: '1.2'
278
+ version: '2.0'
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: binaryedge
281
281
  requirement: !ruby/object:Gem::Requirement
@@ -332,20 +332,6 @@ dependencies:
332
332
  - - "~>"
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0.3'
335
- - !ruby/object:Gem::Dependency
336
- name: cymbal
337
- requirement: !ruby/object:Gem::Requirement
338
- requirements:
339
- - - "~>"
340
- - !ruby/object:Gem::Version
341
- version: '2.0'
342
- type: :runtime
343
- prerelease: false
344
- version_requirements: !ruby/object:Gem::Requirement
345
- requirements:
346
- - - "~>"
347
- - !ruby/object:Gem::Version
348
- version: '2.0'
349
335
  - !ruby/object:Gem::Dependency
350
336
  name: dnpedia
351
337
  requirement: !ruby/object:Gem::Requirement
@@ -394,14 +380,14 @@ dependencies:
394
380
  requirements:
395
381
  - - '='
396
382
  - !ruby/object:Gem::Version
397
- version: 0.13.0
383
+ version: 0.14.0
398
384
  type: :runtime
399
385
  prerelease: false
400
386
  version_requirements: !ruby/object:Gem::Requirement
401
387
  requirements:
402
388
  - - '='
403
389
  - !ruby/object:Gem::Version
404
- version: 0.13.0
390
+ version: 0.14.0
405
391
  - !ruby/object:Gem::Dependency
406
392
  name: dry-container
407
393
  requirement: !ruby/object:Gem::Requirement
@@ -436,14 +422,14 @@ dependencies:
436
422
  requirements:
437
423
  - - '='
438
424
  - !ruby/object:Gem::Version
439
- version: 3.0.4
425
+ version: 3.1.1
440
426
  type: :runtime
441
427
  prerelease: false
442
428
  version_requirements: !ruby/object:Gem::Requirement
443
429
  requirements:
444
430
  - - '='
445
431
  - !ruby/object:Gem::Version
446
- version: 3.0.4
432
+ version: 3.1.1
447
433
  - !ruby/object:Gem::Dependency
448
434
  name: dry-struct
449
435
  requirement: !ruby/object:Gem::Requirement
@@ -612,20 +598,6 @@ dependencies:
612
598
  - - "~>"
613
599
  - !ruby/object:Gem::Version
614
600
  version: '2.5'
615
- - !ruby/object:Gem::Dependency
616
- name: mem
617
- requirement: !ruby/object:Gem::Requirement
618
- requirements:
619
- - - "~>"
620
- - !ruby/object:Gem::Version
621
- version: '0.1'
622
- type: :runtime
623
- prerelease: false
624
- version_requirements: !ruby/object:Gem::Requirement
625
- requirements:
626
- - - "~>"
627
- - !ruby/object:Gem::Version
628
- version: '0.1'
629
601
  - !ruby/object:Gem::Dependency
630
602
  name: memist
631
603
  requirement: !ruby/object:Gem::Requirement
@@ -672,14 +644,14 @@ dependencies:
672
644
  name: normalize_country
673
645
  requirement: !ruby/object:Gem::Requirement
674
646
  requirements:
675
- - - '='
647
+ - - "~>"
676
648
  - !ruby/object:Gem::Version
677
649
  version: '0.3'
678
650
  type: :runtime
679
651
  prerelease: false
680
652
  version_requirements: !ruby/object:Gem::Requirement
681
653
  requirements:
682
- - - '='
654
+ - - "~>"
683
655
  - !ruby/object:Gem::Version
684
656
  version: '0.3'
685
657
  - !ruby/object:Gem::Dependency
@@ -758,14 +730,14 @@ dependencies:
758
730
  requirements:
759
731
  - - "~>"
760
732
  - !ruby/object:Gem::Version
761
- version: '1.4'
733
+ version: '2.0'
762
734
  type: :runtime
763
735
  prerelease: false
764
736
  version_requirements: !ruby/object:Gem::Requirement
765
737
  requirements:
766
738
  - - "~>"
767
739
  - !ruby/object:Gem::Version
768
- version: '1.4'
740
+ version: '2.0'
769
741
  - !ruby/object:Gem::Dependency
770
742
  name: public_suffix
771
743
  requirement: !ruby/object:Gem::Requirement
@@ -800,14 +772,14 @@ dependencies:
800
772
  requirements:
801
773
  - - '='
802
774
  - !ruby/object:Gem::Version
803
- version: 5.5.2
775
+ version: 5.6.2
804
776
  type: :runtime
805
777
  prerelease: false
806
778
  version_requirements: !ruby/object:Gem::Requirement
807
779
  requirements:
808
780
  - - '='
809
781
  - !ruby/object:Gem::Version
810
- version: 5.5.2
782
+ version: 5.6.2
811
783
  - !ruby/object:Gem::Dependency
812
784
  name: rack
813
785
  requirement: !ruby/object:Gem::Requirement
@@ -940,14 +912,14 @@ dependencies:
940
912
  requirements:
941
913
  - - '='
942
914
  - !ruby/object:Gem::Version
943
- version: 1.1.0
915
+ version: 1.2.1
944
916
  type: :runtime
945
917
  prerelease: false
946
918
  version_requirements: !ruby/object:Gem::Requirement
947
919
  requirements:
948
920
  - - '='
949
921
  - !ruby/object:Gem::Version
950
- version: 1.1.0
922
+ version: 1.2.1
951
923
  - !ruby/object:Gem::Dependency
952
924
  name: thread_safe
953
925
  requirement: !ruby/object:Gem::Requirement
@@ -1085,7 +1057,6 @@ files:
1085
1057
  - images/web_config.png
1086
1058
  - lib/mihari.rb
1087
1059
  - lib/mihari/analyzers/base.rb
1088
- - lib/mihari/analyzers/basic.rb
1089
1060
  - lib/mihari/analyzers/binaryedge.rb
1090
1061
  - lib/mihari/analyzers/censys.rb
1091
1062
  - lib/mihari/analyzers/circl.rb
@@ -1106,36 +1077,15 @@ files:
1106
1077
  - lib/mihari/analyzers/virustotal.rb
1107
1078
  - lib/mihari/analyzers/virustotal_intelligence.rb
1108
1079
  - lib/mihari/analyzers/zoomeye.rb
1109
- - lib/mihari/cli/analyzer.rb
1110
1080
  - lib/mihari/cli/base.rb
1111
1081
  - lib/mihari/cli/init.rb
1112
1082
  - lib/mihari/cli/main.rb
1113
1083
  - lib/mihari/cli/mixins/utils.rb
1114
1084
  - lib/mihari/cli/validator.rb
1115
- - lib/mihari/commands/binaryedge.rb
1116
- - lib/mihari/commands/censys.rb
1117
- - lib/mihari/commands/circl.rb
1118
- - lib/mihari/commands/crtsh.rb
1119
- - lib/mihari/commands/dnpedia.rb
1120
- - lib/mihari/commands/dnstwister.rb
1121
- - lib/mihari/commands/feed.rb
1122
- - lib/mihari/commands/greynoise.rb
1123
1085
  - lib/mihari/commands/init.rb
1124
- - lib/mihari/commands/json.rb
1125
- - lib/mihari/commands/onyphe.rb
1126
- - lib/mihari/commands/otx.rb
1127
- - lib/mihari/commands/passivetotal.rb
1128
- - lib/mihari/commands/pulsedive.rb
1129
1086
  - lib/mihari/commands/search.rb
1130
- - lib/mihari/commands/securitytrails.rb
1131
- - lib/mihari/commands/shodan.rb
1132
- - lib/mihari/commands/spyse.rb
1133
- - lib/mihari/commands/urlscan.rb
1134
1087
  - lib/mihari/commands/validator.rb
1135
- - lib/mihari/commands/virustotal.rb
1136
- - lib/mihari/commands/virustotal_intelligence.rb
1137
1088
  - lib/mihari/commands/web.rb
1138
- - lib/mihari/commands/zoomeye.rb
1139
1089
  - lib/mihari/constants.rb
1140
1090
  - lib/mihari/database.rb
1141
1091
  - lib/mihari/emitters/base.rb
@@ -1152,9 +1102,8 @@ files:
1152
1102
  - lib/mihari/feed/reader.rb
1153
1103
  - lib/mihari/mixins/autonomous_system.rb
1154
1104
  - lib/mihari/mixins/configurable.rb
1155
- - lib/mihari/mixins/configuration.rb
1105
+ - lib/mihari/mixins/database.rb
1156
1106
  - lib/mihari/mixins/disallowed_data_value.rb
1157
- - lib/mihari/mixins/hash.rb
1158
1107
  - lib/mihari/mixins/refang.rb
1159
1108
  - lib/mihari/mixins/retriable.rb
1160
1109
  - lib/mihari/mixins/rule.rb
@@ -1164,6 +1113,7 @@ files:
1164
1113
  - lib/mihari/models/dns.rb
1165
1114
  - lib/mihari/models/geolocation.rb
1166
1115
  - lib/mihari/models/reverse_dns.rb
1116
+ - lib/mihari/models/rule.rb
1167
1117
  - lib/mihari/models/tag.rb
1168
1118
  - lib/mihari/models/tagging.rb
1169
1119
  - lib/mihari/models/whois.rb
@@ -1171,7 +1121,6 @@ files:
1171
1121
  - lib/mihari/notifiers/exception_notifier.rb
1172
1122
  - lib/mihari/notifiers/slack.rb
1173
1123
  - lib/mihari/schemas/analyzer.rb
1174
- - lib/mihari/schemas/configuration.rb
1175
1124
  - lib/mihari/schemas/macros.rb
1176
1125
  - lib/mihari/schemas/rule.rb
1177
1126
  - lib/mihari/status.rb
@@ -1180,6 +1129,7 @@ files:
1180
1129
  - lib/mihari/structs/greynoise.rb
1181
1130
  - lib/mihari/structs/ipinfo.rb
1182
1131
  - lib/mihari/structs/onyphe.rb
1132
+ - lib/mihari/structs/rule.rb
1183
1133
  - lib/mihari/structs/shodan.rb
1184
1134
  - lib/mihari/structs/urlscan.rb
1185
1135
  - lib/mihari/structs/virustotal_intelligence.rb
@@ -1194,6 +1144,7 @@ files:
1194
1144
  - lib/mihari/web/endpoints/command.rb
1195
1145
  - lib/mihari/web/endpoints/configs.rb
1196
1146
  - lib/mihari/web/endpoints/ip_addresses.rb
1147
+ - lib/mihari/web/endpoints/rules.rb
1197
1148
  - lib/mihari/web/endpoints/sources.rb
1198
1149
  - lib/mihari/web/endpoints/tags.rb
1199
1150
  - lib/mihari/web/entities/alert.rb
@@ -1206,10 +1157,11 @@ files:
1206
1157
  - lib/mihari/web/entities/ip_address.rb
1207
1158
  - lib/mihari/web/entities/message.rb
1208
1159
  - lib/mihari/web/entities/reverse_dns.rb
1160
+ - lib/mihari/web/entities/rule.rb
1209
1161
  - lib/mihari/web/entities/source.rb
1210
1162
  - lib/mihari/web/entities/tag.rb
1211
1163
  - lib/mihari/web/entities/whois.rb
1212
- - lib/mihari/web/public/grape.rb
1164
+ - lib/mihari/web/middleware/connection_adapter.rb
1213
1165
  - lib/mihari/web/public/index.html
1214
1166
  - lib/mihari/web/public/redoc-static.html
1215
1167
  - lib/mihari/web/public/static/favicon.ico
@@ -1253,6 +1205,8 @@ files:
1253
1205
  - lib/mihari/web/public/static/js/app.365f1907.js.map
1254
1206
  - lib/mihari/web/public/static/js/app.378da3dc.js
1255
1207
  - lib/mihari/web/public/static/js/app.378da3dc.js.map
1208
+ - lib/mihari/web/public/static/js/app.49ab738a.js
1209
+ - lib/mihari/web/public/static/js/app.49ab738a.js.map
1256
1210
  - lib/mihari/web/public/static/js/app.5dc97aae.js
1257
1211
  - lib/mihari/web/public/static/js/app.5dc97aae.js.map
1258
1212
  - lib/mihari/web/public/static/js/app.6b636b62.js
@@ -1265,8 +1219,14 @@ files:
1265
1219
  - lib/mihari/web/public/static/js/app.ab213f7c.js.map
1266
1220
  - lib/mihari/web/public/static/js/app.b5914c39.js
1267
1221
  - lib/mihari/web/public/static/js/app.b5914c39.js.map
1222
+ - lib/mihari/web/public/static/js/app.b88ce341.js
1223
+ - lib/mihari/web/public/static/js/app.b88ce341.js.map
1224
+ - lib/mihari/web/public/static/js/app.cb1fa7be.js
1225
+ - lib/mihari/web/public/static/js/app.cb1fa7be.js.map
1268
1226
  - lib/mihari/web/public/static/js/app.cccddb2b.js
1269
1227
  - lib/mihari/web/public/static/js/app.cccddb2b.js.map
1228
+ - lib/mihari/web/public/static/js/app.eb95cfc9.js
1229
+ - lib/mihari/web/public/static/js/app.eb95cfc9.js.map
1270
1230
  - lib/mihari/web/public/static/js/app.f2b8890f.js
1271
1231
  - lib/mihari/web/public/static/js/app.f2b8890f.js.map
1272
1232
  - lib/mihari/web/public/static/js/app.fbc19869.js
@@ -1275,7 +1235,6 @@ files:
1275
1235
  - renovate.json
1276
1236
  - sig/lib/mihari.rbs
1277
1237
  - sig/lib/mihari/analyzers/base.rbs
1278
- - sig/lib/mihari/analyzers/basic.rbs
1279
1238
  - sig/lib/mihari/analyzers/binaryedge.rbs
1280
1239
  - sig/lib/mihari/analyzers/censys.rbs
1281
1240
  - sig/lib/mihari/analyzers/circl.rbs
@@ -1295,34 +1254,16 @@ files:
1295
1254
  - sig/lib/mihari/analyzers/virustotal.rbs
1296
1255
  - sig/lib/mihari/analyzers/virustotal_intelligence.rbs
1297
1256
  - sig/lib/mihari/analyzers/zoomeye.rbs
1298
- - sig/lib/mihari/cli/analyzer.rbs
1299
1257
  - sig/lib/mihari/cli/base.rbs
1300
1258
  - sig/lib/mihari/cli/init.rbs
1301
1259
  - sig/lib/mihari/cli/main.rbs
1302
1260
  - sig/lib/mihari/cli/mixins/utils.rbs
1303
1261
  - sig/lib/mihari/cli/validator.rbs
1304
- - sig/lib/mihari/commands/binaryedge.rbs
1305
- - sig/lib/mihari/commands/censys.rbs
1306
- - sig/lib/mihari/commands/circl.rbs
1307
- - sig/lib/mihari/commands/crtsh.rbs
1308
- - sig/lib/mihari/commands/dnpedia.rbs
1309
- - sig/lib/mihari/commands/dnstwister.rbs
1310
- - sig/lib/mihari/commands/feed.rbs
1311
1262
  - sig/lib/mihari/commands/init.rbs
1312
1263
  - sig/lib/mihari/commands/json.rbs
1313
- - sig/lib/mihari/commands/onyphe.rbs
1314
- - sig/lib/mihari/commands/otx.rbs
1315
- - sig/lib/mihari/commands/passivetotal.rbs
1316
- - sig/lib/mihari/commands/pulsedive.rbs
1317
1264
  - sig/lib/mihari/commands/search.rbs
1318
- - sig/lib/mihari/commands/securitytrails.rbs
1319
- - sig/lib/mihari/commands/shodan.rbs
1320
- - sig/lib/mihari/commands/spyse.rbs
1321
- - sig/lib/mihari/commands/urlscan.rbs
1322
1265
  - sig/lib/mihari/commands/validator.rbs
1323
- - sig/lib/mihari/commands/virustotal.rbs
1324
1266
  - sig/lib/mihari/commands/web.rbs
1325
- - sig/lib/mihari/commands/zoomeye.rbs
1326
1267
  - sig/lib/mihari/constants.rbs
1327
1268
  - sig/lib/mihari/database.rbs
1328
1269
  - sig/lib/mihari/emitters/base.rbs
@@ -1351,6 +1292,7 @@ files:
1351
1292
  - sig/lib/mihari/models/dns.rbs
1352
1293
  - sig/lib/mihari/models/geolocation.rbs
1353
1294
  - sig/lib/mihari/models/reverse_dns.rbs
1295
+ - sig/lib/mihari/models/rule.rbs
1354
1296
  - sig/lib/mihari/models/tag.rbs
1355
1297
  - sig/lib/mihari/models/tagging.rbs
1356
1298
  - sig/lib/mihari/models/whois.rbs
@@ -1363,6 +1305,7 @@ files:
1363
1305
  - sig/lib/mihari/structs/greynoise.rbs
1364
1306
  - sig/lib/mihari/structs/ipinfo.rbs
1365
1307
  - sig/lib/mihari/structs/onyphe.rbs
1308
+ - sig/lib/mihari/structs/rule.rbs
1366
1309
  - sig/lib/mihari/structs/shodan.rbs
1367
1310
  - sig/lib/mihari/structs/urlscan.rbs
1368
1311
  - sig/lib/mihari/structs/virustotal_intelligence.rbs
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Analyzers
5
- class Basic < Base
6
- attr_reader :title, :description, :artifacts, :source, :tags
7
-
8
- def initialize(title:, description:, artifacts:, source:, tags: [])
9
- super()
10
-
11
- @title = title
12
- @description = description
13
- @artifacts = artifacts
14
- @source = source
15
- @tags = tags
16
- end
17
- end
18
- end
19
- end
@@ -1,55 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "mihari/commands/binaryedge"
4
- require "mihari/commands/censys"
5
- require "mihari/commands/circl"
6
- require "mihari/commands/crtsh"
7
- require "mihari/commands/dnpedia"
8
- require "mihari/commands/dnstwister"
9
- require "mihari/commands/feed"
10
- require "mihari/commands/greynoise"
11
- require "mihari/commands/onyphe"
12
- require "mihari/commands/otx"
13
- require "mihari/commands/passivetotal"
14
- require "mihari/commands/pulsedive"
15
- require "mihari/commands/securitytrails"
16
- require "mihari/commands/shodan"
17
- require "mihari/commands/spyse"
18
- require "mihari/commands/urlscan"
19
- require "mihari/commands/virustotal_intelligence"
20
- require "mihari/commands/virustotal"
21
- require "mihari/commands/zoomeye"
22
-
23
- require "mihari/commands/json"
24
-
25
- module Mihari
26
- module CLI
27
- class Analyzer < Base
28
- class_option :ignore_old_artifacts, type: :boolean, default: false, desc: "Whether to ignore old artifacts from checking or not."
29
- class_option :ignore_threshold, type: :numeric, default: 0, desc: "Number of days to define whether an artifact is old or not."
30
- class_option :interval, type: :numeric, default: 0, desc: "Seconds of the interval while calling API in a row."
31
- class_option :config, type: :string, desc: "Path to the config file"
32
-
33
- include Mihari::Commands::BinaryEdge
34
- include Mihari::Commands::Censys
35
- include Mihari::Commands::CIRCL
36
- include Mihari::Commands::Crtsh
37
- include Mihari::Commands::DNPedia
38
- include Mihari::Commands::DNSTwister
39
- include Mihari::Commands::Feed
40
- include Mihari::Commands::GreyNoise
41
- include Mihari::Commands::JSON
42
- include Mihari::Commands::Onyphe
43
- include Mihari::Commands::OTX
44
- include Mihari::Commands::PassiveTotal
45
- include Mihari::Commands::Pulsedive
46
- include Mihari::Commands::SecurityTrails
47
- include Mihari::Commands::Shodan
48
- include Mihari::Commands::Spyse
49
- include Mihari::Commands::Urlscan
50
- include Mihari::Commands::VirusTotal
51
- include Mihari::Commands::VirusTotalIntelligence
52
- include Mihari::Commands::ZoomEye
53
- end
54
- end
55
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Commands
5
- module BinaryEdge
6
- def self.included(thor)
7
- thor.class_eval do
8
- desc "binaryedge [QUERY]", "BinaryEdge host search"
9
- method_option :title, type: :string, desc: "title"
10
- method_option :description, type: :string, desc: "description"
11
- method_option :tags, type: :array, desc: "tags"
12
- def binaryedge(query)
13
- with_error_handling do
14
- run_analyzer Analyzers::BinaryEdge, query: query, options: options
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Commands
5
- module Censys
6
- def self.included(thor)
7
- thor.class_eval do
8
- desc "censys [QUERY]", "Censys IPv4 search"
9
- method_option :title, type: :string, desc: "title"
10
- method_option :description, type: :string, desc: "description"
11
- method_option :tags, type: :array, desc: "tags"
12
- method_option :type, type: :string, desc: "type to search (ipv4 / websites / certificates)", default: "ipv4"
13
- def censys(query)
14
- with_error_handling do
15
- run_analyzer Analyzers::Censys, query: query, options: options
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Commands
5
- module CIRCL
6
- def self.included(thor)
7
- thor.class_eval do
8
- desc "circl [DOMAIN|SHA1]", "CIRCL passive DNS/SSL search by a domain or SHA1 certificate fingerprint"
9
- method_option :title, type: :string, desc: "title"
10
- method_option :description, type: :string, desc: "description"
11
- method_option :tags, type: :array, desc: "tags"
12
- def circl(query)
13
- with_error_handling do
14
- run_analyzer Analyzers::CIRCL, query: query, options: options
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Commands
5
- module Crtsh
6
- def self.included(thor)
7
- thor.class_eval do
8
- desc "crtsh [QUERY]", "crt.sh search"
9
- method_option :title, type: :string, desc: "title"
10
- method_option :description, type: :string, desc: "description"
11
- method_option :tags, type: :array, desc: "tags"
12
- method_option :exclude_expired, type: :boolean, desc: "exclude expired certificates"
13
- def crtsh(query)
14
- with_error_handling do
15
- run_analyzer Analyzers::Crtsh, query: query, options: options
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Commands
5
- module DNPedia
6
- def self.included(thor)
7
- thor.class_eval do
8
- desc "dnpedia [QUERY]", "DNPedia domain search"
9
- method_option :title, type: :string, desc: "title"
10
- method_option :description, type: :string, desc: "description"
11
- method_option :tags, type: :array, desc: "tags"
12
- def dnpedia(query)
13
- with_error_handling do
14
- run_analyzer Analyzers::DNPedia, query: query, options: options
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end