mihari 4.1.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +26 -4
  3. data/README.md +1 -1
  4. data/lib/mihari/analyzers/base.rb +18 -10
  5. data/lib/mihari/analyzers/rule.rb +50 -7
  6. data/lib/mihari/cli/base.rb +0 -4
  7. data/lib/mihari/commands/init.rb +1 -1
  8. data/lib/mihari/commands/search.rb +11 -58
  9. data/lib/mihari/commands/validator.rb +1 -2
  10. data/lib/mihari/constants.rb +2 -0
  11. data/lib/mihari/emitters/base.rb +8 -2
  12. data/lib/mihari/emitters/http.rb +127 -0
  13. data/lib/mihari/emitters/slack.rb +40 -4
  14. data/lib/mihari/emitters/webhook.rb +7 -16
  15. data/lib/mihari/enrichers/base.rb +5 -2
  16. data/lib/mihari/enrichers/ipinfo.rb +4 -3
  17. data/lib/mihari/{web/entities → entities}/alert.rb +0 -0
  18. data/lib/mihari/{web/entities → entities}/artifact.rb +0 -0
  19. data/lib/mihari/{web/entities → entities}/autonomous_system.rb +0 -0
  20. data/lib/mihari/{web/entities → entities}/command.rb +0 -0
  21. data/lib/mihari/{web/entities → entities}/config.rb +0 -0
  22. data/lib/mihari/{web/entities → entities}/dns.rb +0 -0
  23. data/lib/mihari/{web/entities → entities}/geolocation.rb +0 -0
  24. data/lib/mihari/{web/entities → entities}/ip_address.rb +0 -0
  25. data/lib/mihari/{web/entities → entities}/message.rb +0 -0
  26. data/lib/mihari/{web/entities → entities}/reverse_dns.rb +0 -0
  27. data/lib/mihari/{web/entities → entities}/rule.rb +5 -0
  28. data/lib/mihari/{web/entities → entities}/source.rb +0 -0
  29. data/lib/mihari/{web/entities → entities}/tag.rb +0 -0
  30. data/lib/mihari/{web/entities → entities}/whois.rb +0 -0
  31. data/lib/mihari/errors.rb +2 -0
  32. data/lib/mihari/feed/reader.rb +16 -58
  33. data/lib/mihari/http.rb +99 -0
  34. data/lib/mihari/mixins/error_notification.rb +20 -0
  35. data/lib/mihari/mixins/retriable.rb +12 -2
  36. data/lib/mihari/mixins/rule.rb +1 -2
  37. data/lib/mihari/schemas/rule.rb +30 -4
  38. data/lib/mihari/structs/ipinfo.rb +2 -3
  39. data/lib/mihari/structs/rule.rb +31 -0
  40. data/lib/mihari/structs/shodan.rb +9 -1
  41. data/lib/mihari/types.rb +11 -3
  42. data/lib/mihari/version.rb +1 -1
  43. data/lib/mihari/web/api.rb +0 -20
  44. data/lib/mihari/web/app.rb +2 -2
  45. data/lib/mihari/web/endpoints/rules.rb +3 -1
  46. data/lib/mihari/web/middleware/error_notification_adapter.rb +19 -0
  47. data/lib/mihari/web/public/index.html +1 -1
  48. data/lib/mihari/web/public/redoc-static.html +1888 -166
  49. data/lib/mihari/web/public/static/css/app.0de4b715.css +1 -0
  50. data/lib/mihari/web/public/static/css/app.43138058.css +1 -0
  51. data/lib/mihari/web/public/static/css/chunk-vendors.3ed9b08e.css +7 -0
  52. data/lib/mihari/web/public/static/css/chunk-vendors.c57bb3fd.css +7 -0
  53. data/lib/mihari/web/public/static/fonts/fa-brands-400.1fd0b4d7.ttf +0 -0
  54. data/lib/mihari/web/public/static/fonts/fa-brands-400.5d5236fb.woff2 +0 -0
  55. data/lib/mihari/web/public/static/fonts/fa-brands-400.edf40f86.woff2 +0 -0
  56. data/lib/mihari/web/public/static/fonts/fa-brands-400.f7223235.ttf +0 -0
  57. data/lib/mihari/web/public/static/fonts/fa-regular-400.3665ebc7.woff2 +0 -0
  58. data/lib/mihari/web/public/static/fonts/fa-regular-400.64b3730e.woff2 +0 -0
  59. data/lib/mihari/web/public/static/fonts/fa-regular-400.95a8a8af.ttf +0 -0
  60. data/lib/mihari/web/public/static/fonts/fa-regular-400.a7fde52b.ttf +0 -0
  61. data/lib/mihari/web/public/static/fonts/fa-solid-900.0d2abd43.woff2 +0 -0
  62. data/lib/mihari/web/public/static/fonts/fa-solid-900.5b03221c.ttf +0 -0
  63. data/lib/mihari/web/public/static/fonts/fa-solid-900.6115ad71.woff2 +0 -0
  64. data/lib/mihari/web/public/static/fonts/fa-solid-900.f0203cfc.ttf +0 -0
  65. data/lib/mihari/web/public/static/fonts/fa-v4compatibility.42932bea.ttf +0 -0
  66. data/lib/mihari/web/public/static/fonts/fa-v4compatibility.e1023515.ttf +0 -0
  67. data/lib/mihari/web/public/static/js/app-legacy.46b666f0.js +2 -0
  68. data/lib/mihari/web/public/static/js/app-legacy.46b666f0.js.map +1 -0
  69. data/lib/mihari/web/public/static/js/app-legacy.e451304b.js +2 -0
  70. data/lib/mihari/web/public/static/js/app-legacy.e451304b.js.map +1 -0
  71. data/lib/mihari/web/public/static/js/app.4818aedd.js +2 -0
  72. data/lib/mihari/web/public/static/js/app.4818aedd.js.map +1 -0
  73. data/lib/mihari/web/public/static/js/app.e74e91d7.js +2 -0
  74. data/lib/mihari/web/public/static/js/app.e74e91d7.js.map +1 -0
  75. data/lib/mihari/web/public/static/js/chunk-vendors-legacy.41357cdf.js +25 -0
  76. data/lib/mihari/web/public/static/js/chunk-vendors-legacy.41357cdf.js.map +1 -0
  77. data/lib/mihari/web/public/static/js/chunk-vendors-legacy.c99e452e.js +17 -0
  78. data/lib/mihari/web/public/static/js/chunk-vendors-legacy.c99e452e.js.map +1 -0
  79. data/lib/mihari/web/public/static/js/chunk-vendors.15e84e22.js +23 -0
  80. data/lib/mihari/web/public/static/js/chunk-vendors.15e84e22.js.map +1 -0
  81. data/lib/mihari/web/public/static/js/chunk-vendors.c5525f1e.js +31 -0
  82. data/lib/mihari/web/public/static/js/chunk-vendors.c5525f1e.js.map +1 -0
  83. data/lib/mihari.rb +71 -21
  84. data/mihari.gemspec +16 -11
  85. data/sig/lib/mihari/constants.rbs +2 -0
  86. data/sig/lib/mihari/emitters/http.rbs +35 -0
  87. data/sig/lib/mihari/emitters/slack.rbs +29 -1
  88. data/sig/lib/mihari/feed/reader.rbs +2 -2
  89. data/sig/lib/mihari/http.rbs +64 -0
  90. data/sig/lib/mihari/mixins/error_notification.rbs +12 -0
  91. data/sig/lib/mihari/structs/rule.rbs +4 -0
  92. data/sig/lib/mihari/types.rbs +2 -0
  93. data/sig/lib/mihari.rbs +4 -8
  94. metadata +137 -62
  95. data/lib/mihari/cli/mixins/utils.rb +0 -72
  96. data/lib/mihari/emitters/stdout.rb +0 -22
  97. data/lib/mihari/notifiers/base.rb +0 -24
  98. data/lib/mihari/notifiers/exception_notifier.rb +0 -126
  99. data/lib/mihari/notifiers/slack.rb +0 -63
  100. data/sig/lib/mihari/cli/mixins/utils.rbs +0 -50
  101. data/sig/lib/mihari/notifiers/base.rbs +0 -18
  102. data/sig/lib/mihari/notifiers/exception_notifier.rbs +0 -75
  103. data/sig/lib/mihari/notifiers/slack.rbs +0 -50
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: 4.1.1
4
+ version: 4.3.0
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-29 00:00:00.000000000 Z
11
+ date: 2022-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.23'
33
+ version: '0.24'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.23'
40
+ version: '0.24'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: fakefs
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -156,42 +156,56 @@ 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
+ - !ruby/object:Gem::Dependency
168
+ name: simplecov-lcov
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.8.0
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.8.0
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: standard
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: '1.7'
187
+ version: '1.8'
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: '1.7'
194
+ version: '1.8'
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: steep
183
197
  requirement: !ruby/object:Gem::Requirement
184
198
  requirements:
185
199
  - - "~>"
186
200
  - !ruby/object:Gem::Version
187
- version: '0.47'
201
+ version: '0.49'
188
202
  type: :development
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
- version: '0.47'
208
+ version: '0.49'
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: timecop
197
211
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +226,14 @@ dependencies:
212
226
  requirements:
213
227
  - - "~>"
214
228
  - !ruby/object:Gem::Version
215
- version: '6.0'
229
+ version: '6.1'
216
230
  type: :development
217
231
  prerelease: false
218
232
  version_requirements: !ruby/object:Gem::Requirement
219
233
  requirements:
220
234
  - - "~>"
221
235
  - !ruby/object:Gem::Version
222
- version: '6.0'
236
+ version: '6.1'
223
237
  - !ruby/object:Gem::Dependency
224
238
  name: webmock
225
239
  requirement: !ruby/object:Gem::Requirement
@@ -240,14 +254,14 @@ dependencies:
240
254
  requirements:
241
255
  - - '='
242
256
  - !ruby/object:Gem::Version
243
- version: 7.0.1
257
+ version: 7.0.2.3
244
258
  type: :runtime
245
259
  prerelease: false
246
260
  version_requirements: !ruby/object:Gem::Requirement
247
261
  requirements:
248
262
  - - '='
249
263
  - !ruby/object:Gem::Version
250
- version: 7.0.1
264
+ version: 7.0.2.3
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: addressable
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -304,20 +318,6 @@ dependencies:
304
318
  - - "~>"
305
319
  - !ruby/object:Gem::Version
306
320
  version: '0.1'
307
- - !ruby/object:Gem::Dependency
308
- name: colorize
309
- requirement: !ruby/object:Gem::Requirement
310
- requirements:
311
- - - "~>"
312
- - !ruby/object:Gem::Version
313
- version: '0.8'
314
- type: :runtime
315
- prerelease: false
316
- version_requirements: !ruby/object:Gem::Requirement
317
- requirements:
318
- - - "~>"
319
- - !ruby/object:Gem::Version
320
- version: '0.8'
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: crtsh-rb
323
323
  requirement: !ruby/object:Gem::Requirement
@@ -430,6 +430,20 @@ dependencies:
430
430
  - - '='
431
431
  - !ruby/object:Gem::Version
432
432
  version: 3.1.1
433
+ - !ruby/object:Gem::Dependency
434
+ name: dry-schema
435
+ requirement: !ruby/object:Gem::Requirement
436
+ requirements:
437
+ - - '='
438
+ - !ruby/object:Gem::Version
439
+ version: 1.9.1
440
+ type: :runtime
441
+ prerelease: false
442
+ version_requirements: !ruby/object:Gem::Requirement
443
+ requirements:
444
+ - - '='
445
+ - !ruby/object:Gem::Version
446
+ version: 1.9.1
433
447
  - !ruby/object:Gem::Dependency
434
448
  name: dry-struct
435
449
  requirement: !ruby/object:Gem::Requirement
@@ -450,14 +464,14 @@ dependencies:
450
464
  requirements:
451
465
  - - '='
452
466
  - !ruby/object:Gem::Version
453
- version: 1.7.0
467
+ version: 1.8.0
454
468
  type: :runtime
455
469
  prerelease: false
456
470
  version_requirements: !ruby/object:Gem::Requirement
457
471
  requirements:
458
472
  - - '='
459
473
  - !ruby/object:Gem::Version
460
- version: 1.7.0
474
+ version: 1.8.0
461
475
  - !ruby/object:Gem::Dependency
462
476
  name: email_address
463
477
  requirement: !ruby/object:Gem::Requirement
@@ -557,19 +571,19 @@ dependencies:
557
571
  - !ruby/object:Gem::Version
558
572
  version: '1.0'
559
573
  - !ruby/object:Gem::Dependency
560
- name: http
574
+ name: insensitive_hash
561
575
  requirement: !ruby/object:Gem::Requirement
562
576
  requirements:
563
577
  - - "~>"
564
578
  - !ruby/object:Gem::Version
565
- version: '5.0'
579
+ version: '0.3'
566
580
  type: :runtime
567
581
  prerelease: false
568
582
  version_requirements: !ruby/object:Gem::Requirement
569
583
  requirements:
570
584
  - - "~>"
571
585
  - !ruby/object:Gem::Version
572
- version: '5.0'
586
+ version: '0.3'
573
587
  - !ruby/object:Gem::Dependency
574
588
  name: jr-cli
575
589
  requirement: !ruby/object:Gem::Requirement
@@ -772,14 +786,14 @@ dependencies:
772
786
  requirements:
773
787
  - - '='
774
788
  - !ruby/object:Gem::Version
775
- version: 5.6.1
789
+ version: 5.6.2
776
790
  type: :runtime
777
791
  prerelease: false
778
792
  version_requirements: !ruby/object:Gem::Requirement
779
793
  requirements:
780
794
  - - '='
781
795
  - !ruby/object:Gem::Version
782
- version: 5.6.1
796
+ version: 5.6.2
783
797
  - !ruby/object:Gem::Dependency
784
798
  name: rack
785
799
  requirement: !ruby/object:Gem::Requirement
@@ -850,6 +864,34 @@ dependencies:
850
864
  - - "~>"
851
865
  - !ruby/object:Gem::Version
852
866
  version: '1.0'
867
+ - !ruby/object:Gem::Dependency
868
+ name: semantic_logger
869
+ requirement: !ruby/object:Gem::Requirement
870
+ requirements:
871
+ - - "~>"
872
+ - !ruby/object:Gem::Version
873
+ version: '4.10'
874
+ type: :runtime
875
+ prerelease: false
876
+ version_requirements: !ruby/object:Gem::Requirement
877
+ requirements:
878
+ - - "~>"
879
+ - !ruby/object:Gem::Version
880
+ version: '4.10'
881
+ - !ruby/object:Gem::Dependency
882
+ name: sentry-ruby
883
+ requirement: !ruby/object:Gem::Requirement
884
+ requirements:
885
+ - - "~>"
886
+ - !ruby/object:Gem::Version
887
+ version: 5.1.1
888
+ type: :runtime
889
+ prerelease: false
890
+ version_requirements: !ruby/object:Gem::Requirement
891
+ requirements:
892
+ - - "~>"
893
+ - !ruby/object:Gem::Version
894
+ version: 5.1.1
853
895
  - !ruby/object:Gem::Dependency
854
896
  name: shodanx
855
897
  requirement: !ruby/object:Gem::Requirement
@@ -912,14 +954,14 @@ dependencies:
912
954
  requirements:
913
955
  - - '='
914
956
  - !ruby/object:Gem::Version
915
- version: 1.1.0
957
+ version: 1.2.1
916
958
  type: :runtime
917
959
  prerelease: false
918
960
  version_requirements: !ruby/object:Gem::Requirement
919
961
  requirements:
920
962
  - - '='
921
963
  - !ruby/object:Gem::Version
922
- version: 1.1.0
964
+ version: 1.2.1
923
965
  - !ruby/object:Gem::Dependency
924
966
  name: thread_safe
925
967
  requirement: !ruby/object:Gem::Requirement
@@ -1080,7 +1122,6 @@ files:
1080
1122
  - lib/mihari/cli/base.rb
1081
1123
  - lib/mihari/cli/init.rb
1082
1124
  - lib/mihari/cli/main.rb
1083
- - lib/mihari/cli/mixins/utils.rb
1084
1125
  - lib/mihari/cli/validator.rb
1085
1126
  - lib/mihari/commands/init.rb
1086
1127
  - lib/mihari/commands/search.rb
@@ -1090,20 +1131,36 @@ files:
1090
1131
  - lib/mihari/database.rb
1091
1132
  - lib/mihari/emitters/base.rb
1092
1133
  - lib/mihari/emitters/database.rb
1134
+ - lib/mihari/emitters/http.rb
1093
1135
  - lib/mihari/emitters/misp.rb
1094
1136
  - lib/mihari/emitters/slack.rb
1095
- - lib/mihari/emitters/stdout.rb
1096
1137
  - lib/mihari/emitters/the_hive.rb
1097
1138
  - lib/mihari/emitters/webhook.rb
1098
1139
  - lib/mihari/enrichers/base.rb
1099
1140
  - lib/mihari/enrichers/ipinfo.rb
1141
+ - lib/mihari/entities/alert.rb
1142
+ - lib/mihari/entities/artifact.rb
1143
+ - lib/mihari/entities/autonomous_system.rb
1144
+ - lib/mihari/entities/command.rb
1145
+ - lib/mihari/entities/config.rb
1146
+ - lib/mihari/entities/dns.rb
1147
+ - lib/mihari/entities/geolocation.rb
1148
+ - lib/mihari/entities/ip_address.rb
1149
+ - lib/mihari/entities/message.rb
1150
+ - lib/mihari/entities/reverse_dns.rb
1151
+ - lib/mihari/entities/rule.rb
1152
+ - lib/mihari/entities/source.rb
1153
+ - lib/mihari/entities/tag.rb
1154
+ - lib/mihari/entities/whois.rb
1100
1155
  - lib/mihari/errors.rb
1101
1156
  - lib/mihari/feed/parser.rb
1102
1157
  - lib/mihari/feed/reader.rb
1158
+ - lib/mihari/http.rb
1103
1159
  - lib/mihari/mixins/autonomous_system.rb
1104
1160
  - lib/mihari/mixins/configurable.rb
1105
1161
  - lib/mihari/mixins/database.rb
1106
1162
  - lib/mihari/mixins/disallowed_data_value.rb
1163
+ - lib/mihari/mixins/error_notification.rb
1107
1164
  - lib/mihari/mixins/refang.rb
1108
1165
  - lib/mihari/mixins/retriable.rb
1109
1166
  - lib/mihari/mixins/rule.rb
@@ -1117,9 +1174,6 @@ files:
1117
1174
  - lib/mihari/models/tag.rb
1118
1175
  - lib/mihari/models/tagging.rb
1119
1176
  - lib/mihari/models/whois.rb
1120
- - lib/mihari/notifiers/base.rb
1121
- - lib/mihari/notifiers/exception_notifier.rb
1122
- - lib/mihari/notifiers/slack.rb
1123
1177
  - lib/mihari/schemas/analyzer.rb
1124
1178
  - lib/mihari/schemas/macros.rb
1125
1179
  - lib/mihari/schemas/rule.rb
@@ -1147,54 +1201,63 @@ files:
1147
1201
  - lib/mihari/web/endpoints/rules.rb
1148
1202
  - lib/mihari/web/endpoints/sources.rb
1149
1203
  - lib/mihari/web/endpoints/tags.rb
1150
- - lib/mihari/web/entities/alert.rb
1151
- - lib/mihari/web/entities/artifact.rb
1152
- - lib/mihari/web/entities/autonomous_system.rb
1153
- - lib/mihari/web/entities/command.rb
1154
- - lib/mihari/web/entities/config.rb
1155
- - lib/mihari/web/entities/dns.rb
1156
- - lib/mihari/web/entities/geolocation.rb
1157
- - lib/mihari/web/entities/ip_address.rb
1158
- - lib/mihari/web/entities/message.rb
1159
- - lib/mihari/web/entities/reverse_dns.rb
1160
- - lib/mihari/web/entities/rule.rb
1161
- - lib/mihari/web/entities/source.rb
1162
- - lib/mihari/web/entities/tag.rb
1163
- - lib/mihari/web/entities/whois.rb
1164
1204
  - lib/mihari/web/middleware/connection_adapter.rb
1205
+ - lib/mihari/web/middleware/error_notification_adapter.rb
1165
1206
  - lib/mihari/web/public/index.html
1166
1207
  - lib/mihari/web/public/redoc-static.html
1208
+ - lib/mihari/web/public/static/css/app.0de4b715.css
1209
+ - lib/mihari/web/public/static/css/app.43138058.css
1210
+ - lib/mihari/web/public/static/css/chunk-vendors.3ed9b08e.css
1211
+ - lib/mihari/web/public/static/css/chunk-vendors.c57bb3fd.css
1167
1212
  - lib/mihari/web/public/static/favicon.ico
1168
1213
  - lib/mihari/web/public/static/fonts/fa-brands-400.099a9556.woff
1169
1214
  - lib/mihari/web/public/static/fonts/fa-brands-400.1a575a41.woff
1215
+ - lib/mihari/web/public/static/fonts/fa-brands-400.1fd0b4d7.ttf
1170
1216
  - lib/mihari/web/public/static/fonts/fa-brands-400.30cc681d.eot
1171
1217
  - lib/mihari/web/public/static/fonts/fa-brands-400.3b89dd10.ttf
1172
1218
  - lib/mihari/web/public/static/fonts/fa-brands-400.513aa607.ttf
1173
1219
  - lib/mihari/web/public/static/fonts/fa-brands-400.592643a8.eot
1220
+ - lib/mihari/web/public/static/fonts/fa-brands-400.5d5236fb.woff2
1174
1221
  - lib/mihari/web/public/static/fonts/fa-brands-400.ed311c7a.woff2
1222
+ - lib/mihari/web/public/static/fonts/fa-brands-400.edf40f86.woff2
1223
+ - lib/mihari/web/public/static/fonts/fa-brands-400.f7223235.ttf
1175
1224
  - lib/mihari/web/public/static/fonts/fa-brands-400.f7307680.woff2
1176
1225
  - lib/mihari/web/public/static/fonts/fa-regular-400.1f77739c.ttf
1226
+ - lib/mihari/web/public/static/fonts/fa-regular-400.3665ebc7.woff2
1227
+ - lib/mihari/web/public/static/fonts/fa-regular-400.64b3730e.woff2
1177
1228
  - lib/mihari/web/public/static/fonts/fa-regular-400.7124eb50.woff
1178
1229
  - lib/mihari/web/public/static/fonts/fa-regular-400.7630483d.eot
1179
1230
  - lib/mihari/web/public/static/fonts/fa-regular-400.766913e6.ttf
1231
+ - lib/mihari/web/public/static/fonts/fa-regular-400.95a8a8af.ttf
1232
+ - lib/mihari/web/public/static/fonts/fa-regular-400.a7fde52b.ttf
1180
1233
  - lib/mihari/web/public/static/fonts/fa-regular-400.b0e2db3b.eot
1181
1234
  - lib/mihari/web/public/static/fonts/fa-regular-400.b91d376b.woff2
1182
1235
  - lib/mihari/web/public/static/fonts/fa-regular-400.d1d7e3b4.woff
1183
1236
  - lib/mihari/web/public/static/fonts/fa-regular-400.f0f82301.woff2
1184
1237
  - lib/mihari/web/public/static/fonts/fa-solid-900.0c6bfc66.eot
1238
+ - lib/mihari/web/public/static/fonts/fa-solid-900.0d2abd43.woff2
1185
1239
  - lib/mihari/web/public/static/fonts/fa-solid-900.1042e8ca.eot
1240
+ - lib/mihari/web/public/static/fonts/fa-solid-900.5b03221c.ttf
1186
1241
  - lib/mihari/web/public/static/fonts/fa-solid-900.605ed792.ttf
1242
+ - lib/mihari/web/public/static/fonts/fa-solid-900.6115ad71.woff2
1187
1243
  - lib/mihari/web/public/static/fonts/fa-solid-900.9fe5a17c.woff
1188
1244
  - lib/mihari/web/public/static/fonts/fa-solid-900.b9625119.ttf
1189
1245
  - lib/mihari/web/public/static/fonts/fa-solid-900.d745348d.woff
1190
1246
  - lib/mihari/web/public/static/fonts/fa-solid-900.d824df7e.woff2
1191
1247
  - lib/mihari/web/public/static/fonts/fa-solid-900.e8a427e1.woff2
1248
+ - lib/mihari/web/public/static/fonts/fa-solid-900.f0203cfc.ttf
1249
+ - lib/mihari/web/public/static/fonts/fa-v4compatibility.42932bea.ttf
1250
+ - lib/mihari/web/public/static/fonts/fa-v4compatibility.e1023515.ttf
1192
1251
  - lib/mihari/web/public/static/img/fa-brands-400.1d5619cd.svg
1193
1252
  - lib/mihari/web/public/static/img/fa-brands-400.ba7ed552.svg
1194
1253
  - lib/mihari/web/public/static/img/fa-regular-400.0bb42845.svg
1195
1254
  - lib/mihari/web/public/static/img/fa-regular-400.c5d109be.svg
1196
1255
  - lib/mihari/web/public/static/img/fa-solid-900.376c1f97.svg
1197
1256
  - lib/mihari/web/public/static/img/fa-solid-900.37bc7099.svg
1257
+ - lib/mihari/web/public/static/js/app-legacy.46b666f0.js
1258
+ - lib/mihari/web/public/static/js/app-legacy.46b666f0.js.map
1259
+ - lib/mihari/web/public/static/js/app-legacy.e451304b.js
1260
+ - lib/mihari/web/public/static/js/app-legacy.e451304b.js.map
1198
1261
  - lib/mihari/web/public/static/js/app.06d5cf1c.js
1199
1262
  - lib/mihari/web/public/static/js/app.06d5cf1c.js.map
1200
1263
  - lib/mihari/web/public/static/js/app.0a0cc502.js
@@ -1205,6 +1268,8 @@ files:
1205
1268
  - lib/mihari/web/public/static/js/app.365f1907.js.map
1206
1269
  - lib/mihari/web/public/static/js/app.378da3dc.js
1207
1270
  - lib/mihari/web/public/static/js/app.378da3dc.js.map
1271
+ - lib/mihari/web/public/static/js/app.4818aedd.js
1272
+ - lib/mihari/web/public/static/js/app.4818aedd.js.map
1208
1273
  - lib/mihari/web/public/static/js/app.49ab738a.js
1209
1274
  - lib/mihari/web/public/static/js/app.49ab738a.js.map
1210
1275
  - lib/mihari/web/public/static/js/app.5dc97aae.js
@@ -1225,12 +1290,22 @@ files:
1225
1290
  - lib/mihari/web/public/static/js/app.cb1fa7be.js.map
1226
1291
  - lib/mihari/web/public/static/js/app.cccddb2b.js
1227
1292
  - lib/mihari/web/public/static/js/app.cccddb2b.js.map
1293
+ - lib/mihari/web/public/static/js/app.e74e91d7.js
1294
+ - lib/mihari/web/public/static/js/app.e74e91d7.js.map
1228
1295
  - lib/mihari/web/public/static/js/app.eb95cfc9.js
1229
1296
  - lib/mihari/web/public/static/js/app.eb95cfc9.js.map
1230
1297
  - lib/mihari/web/public/static/js/app.f2b8890f.js
1231
1298
  - lib/mihari/web/public/static/js/app.f2b8890f.js.map
1232
1299
  - lib/mihari/web/public/static/js/app.fbc19869.js
1233
1300
  - lib/mihari/web/public/static/js/app.fbc19869.js.map
1301
+ - lib/mihari/web/public/static/js/chunk-vendors-legacy.41357cdf.js
1302
+ - lib/mihari/web/public/static/js/chunk-vendors-legacy.41357cdf.js.map
1303
+ - lib/mihari/web/public/static/js/chunk-vendors-legacy.c99e452e.js
1304
+ - lib/mihari/web/public/static/js/chunk-vendors-legacy.c99e452e.js.map
1305
+ - lib/mihari/web/public/static/js/chunk-vendors.15e84e22.js
1306
+ - lib/mihari/web/public/static/js/chunk-vendors.15e84e22.js.map
1307
+ - lib/mihari/web/public/static/js/chunk-vendors.c5525f1e.js
1308
+ - lib/mihari/web/public/static/js/chunk-vendors.c5525f1e.js.map
1234
1309
  - mihari.gemspec
1235
1310
  - renovate.json
1236
1311
  - sig/lib/mihari.rbs
@@ -1257,7 +1332,6 @@ files:
1257
1332
  - sig/lib/mihari/cli/base.rbs
1258
1333
  - sig/lib/mihari/cli/init.rbs
1259
1334
  - sig/lib/mihari/cli/main.rbs
1260
- - sig/lib/mihari/cli/mixins/utils.rbs
1261
1335
  - sig/lib/mihari/cli/validator.rbs
1262
1336
  - sig/lib/mihari/commands/init.rbs
1263
1337
  - sig/lib/mihari/commands/json.rbs
@@ -1268,6 +1342,7 @@ files:
1268
1342
  - sig/lib/mihari/database.rbs
1269
1343
  - sig/lib/mihari/emitters/base.rbs
1270
1344
  - sig/lib/mihari/emitters/database.rbs
1345
+ - sig/lib/mihari/emitters/http.rbs
1271
1346
  - sig/lib/mihari/emitters/misp.rbs
1272
1347
  - sig/lib/mihari/emitters/slack.rbs
1273
1348
  - sig/lib/mihari/emitters/stdout.rbs
@@ -1278,10 +1353,12 @@ files:
1278
1353
  - sig/lib/mihari/errors.rbs
1279
1354
  - sig/lib/mihari/feed/parser.rbs
1280
1355
  - sig/lib/mihari/feed/reader.rbs
1356
+ - sig/lib/mihari/http.rbs
1281
1357
  - sig/lib/mihari/mixins/autonomous_system.rbs
1282
1358
  - sig/lib/mihari/mixins/configurable.rbs
1283
1359
  - sig/lib/mihari/mixins/configuration.rbs
1284
1360
  - sig/lib/mihari/mixins/disallowed_data_value.rbs
1361
+ - sig/lib/mihari/mixins/error_notification.rbs
1285
1362
  - sig/lib/mihari/mixins/hash.rbs
1286
1363
  - sig/lib/mihari/mixins/refang.rbs
1287
1364
  - sig/lib/mihari/mixins/retriable.rbs
@@ -1296,9 +1373,6 @@ files:
1296
1373
  - sig/lib/mihari/models/tag.rbs
1297
1374
  - sig/lib/mihari/models/tagging.rbs
1298
1375
  - sig/lib/mihari/models/whois.rbs
1299
- - sig/lib/mihari/notifiers/base.rbs
1300
- - sig/lib/mihari/notifiers/exception_notifier.rbs
1301
- - sig/lib/mihari/notifiers/slack.rbs
1302
1376
  - sig/lib/mihari/status.rbs
1303
1377
  - sig/lib/mihari/structs/alert.rbs
1304
1378
  - sig/lib/mihari/structs/censys.rbs
@@ -1316,7 +1390,8 @@ files:
1316
1390
  homepage: https://github.com/ninoseki/mihari
1317
1391
  licenses:
1318
1392
  - MIT
1319
- metadata: {}
1393
+ metadata:
1394
+ rubygems_mfa_required: 'true'
1320
1395
  post_install_message:
1321
1396
  rdoc_options: []
1322
1397
  require_paths:
@@ -1332,7 +1407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1332
1407
  - !ruby/object:Gem::Version
1333
1408
  version: '0'
1334
1409
  requirements: []
1335
- rubygems_version: 3.2.22
1410
+ rubygems_version: 3.3.7
1336
1411
  signing_key:
1337
1412
  specification_version: 4
1338
1413
  summary: A framework for continuous OSINT based threat hunting
@@ -1,72 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module CLI
5
- module Mixins
6
- module Utils
7
- #
8
- # Send an exception notification if there is any error in a block
9
- #
10
- # @return [Nil]
11
- #
12
- def with_error_handling
13
- yield
14
- rescue StandardError => e
15
- notifier = Notifiers::ExceptionNotifier.new
16
- notifier.notify e
17
- end
18
-
19
- #
20
- # Check required keys in JSON
21
- #
22
- # @param [Hash] json
23
- #
24
- # @return [Boolean]
25
- #
26
- def required_alert_keys?(json)
27
- %w[title description artifacts].all? { |key| json.key? key }
28
- end
29
-
30
- #
31
- # Run analyzer
32
- #
33
- # @param [Class<Mihari::Analyzers::Base>] analyzer_class
34
- # @param [String] query
35
- # @param [Hash] options
36
- #
37
- # @return [nil]
38
- #
39
- def run_analyzer(analyzer_class, query:, options:)
40
- # options = Thor::CoreExt::HashWithIndifferentAccess
41
- # ref. https://www.rubydoc.info/github/wycats/thor/Thor/CoreExt/HashWithIndifferentAccess
42
- # so need to covert it to a plain hash
43
- hash_options = options.to_hash
44
-
45
- hash_options = hash_options.symbolize_keys
46
- hash_options = normalize_options(hash_options)
47
-
48
- analyzer = analyzer_class.new(query, **hash_options)
49
-
50
- analyzer.ignore_old_artifacts = options[:ignore_old_artifacts] || false
51
- analyzer.ignore_threshold = options[:ignore_threshold] || 0
52
-
53
- analyzer.run
54
- end
55
-
56
- #
57
- # Normalize options (reject keys not for analyzers)
58
- #
59
- # @param [Hash] options
60
- #
61
- # @return [Hash]
62
- #
63
- def normalize_options(options)
64
- [:ignore_old_artifacts, :ignore_threshold].each do |ignore_key|
65
- options.delete(ignore_key)
66
- end
67
- options
68
- end
69
- end
70
- end
71
- end
72
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Emitters
5
- class StandardOutput < Base
6
- def valid?
7
- true
8
- end
9
-
10
- def emit(title:, description:, artifacts:, source:, tags:)
11
- h = {
12
- title: title,
13
- description: description,
14
- artifacts: artifacts.map(&:data),
15
- source: source,
16
- tags: tags
17
- }
18
- puts JSON.pretty_generate(h)
19
- end
20
- end
21
- end
22
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Notifiers
5
- class Base
6
- # Validate notifier availability
7
- #
8
- # @return [Boolean]
9
- #
10
- def valid?
11
- raise NotImplementedError, "You must implement #{self.class}##{__method__}"
12
- end
13
-
14
- #
15
- # Send a notification
16
- #
17
- # @return [nil]
18
- #
19
- def notify
20
- raise NotImplementedError, "You must implement #{self.class}##{__method__}"
21
- end
22
- end
23
- end
24
- end