mihari 5.4.2 → 5.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/frontend/package-lock.json +2399 -1504
  3. data/frontend/package.json +22 -22
  4. data/lib/mihari/analyzers/base.rb +25 -14
  5. data/lib/mihari/analyzers/binaryedge.rb +2 -48
  6. data/lib/mihari/analyzers/censys.rb +4 -20
  7. data/lib/mihari/analyzers/circl.rb +3 -27
  8. data/lib/mihari/analyzers/crtsh.rb +2 -17
  9. data/lib/mihari/analyzers/dnstwister.rb +2 -4
  10. data/lib/mihari/analyzers/greynoise.rb +5 -4
  11. data/lib/mihari/analyzers/hunterhow.rb +8 -23
  12. data/lib/mihari/analyzers/onyphe.rb +5 -39
  13. data/lib/mihari/analyzers/otx.rb +3 -39
  14. data/lib/mihari/analyzers/passivetotal.rb +4 -42
  15. data/lib/mihari/analyzers/pulsedive.rb +1 -1
  16. data/lib/mihari/analyzers/rule.rb +18 -13
  17. data/lib/mihari/analyzers/securitytrails.rb +4 -42
  18. data/lib/mihari/analyzers/shodan.rb +7 -39
  19. data/lib/mihari/analyzers/urlscan.rb +3 -39
  20. data/lib/mihari/analyzers/virustotal.rb +1 -1
  21. data/lib/mihari/analyzers/virustotal_intelligence.rb +2 -25
  22. data/lib/mihari/analyzers/zoomeye.rb +18 -84
  23. data/lib/mihari/clients/base.rb +9 -1
  24. data/lib/mihari/clients/binaryedge.rb +26 -4
  25. data/lib/mihari/clients/censys.rb +32 -2
  26. data/lib/mihari/clients/circl.rb +28 -1
  27. data/lib/mihari/clients/crtsh.rb +7 -2
  28. data/lib/mihari/clients/dnstwister.rb +4 -2
  29. data/lib/mihari/clients/greynoise.rb +31 -4
  30. data/lib/mihari/clients/hunterhow.rb +41 -3
  31. data/lib/mihari/clients/onyphe.rb +25 -3
  32. data/lib/mihari/clients/otx.rb +40 -0
  33. data/lib/mihari/clients/passivetotal.rb +33 -15
  34. data/lib/mihari/clients/publsedive.rb +1 -1
  35. data/lib/mihari/clients/securitytrails.rb +44 -0
  36. data/lib/mihari/clients/shodan.rb +31 -3
  37. data/lib/mihari/clients/urlscan.rb +32 -6
  38. data/lib/mihari/clients/virustotal.rb +29 -4
  39. data/lib/mihari/clients/zoomeye.rb +53 -2
  40. data/lib/mihari/commands/alert.rb +42 -13
  41. data/lib/mihari/commands/rule.rb +11 -7
  42. data/lib/mihari/commands/search.rb +54 -22
  43. data/lib/mihari/commands/web.rb +1 -1
  44. data/lib/mihari/config.rb +6 -1
  45. data/lib/mihari/emitters/base.rb +9 -3
  46. data/lib/mihari/emitters/slack.rb +1 -1
  47. data/lib/mihari/enrichers/base.rb +13 -0
  48. data/lib/mihari/enrichers/google_public_dns.rb +16 -1
  49. data/lib/mihari/enrichers/ipinfo.rb +9 -13
  50. data/lib/mihari/enrichers/shodan.rb +1 -2
  51. data/lib/mihari/enrichers/whois.rb +2 -2
  52. data/lib/mihari/errors.rb +16 -10
  53. data/lib/mihari/feed/parser.rb +2 -2
  54. data/lib/mihari/models/artifact.rb +1 -1
  55. data/lib/mihari/models/autonomous_system.rb +11 -5
  56. data/lib/mihari/models/cpe.rb +10 -4
  57. data/lib/mihari/models/dns.rb +11 -16
  58. data/lib/mihari/models/geolocation.rb +11 -5
  59. data/lib/mihari/models/port.rb +10 -4
  60. data/lib/mihari/models/reverse_dns.rb +10 -4
  61. data/lib/mihari/models/whois.rb +4 -1
  62. data/lib/mihari/schemas/analyzer.rb +1 -0
  63. data/lib/mihari/services/alert_builder.rb +43 -0
  64. data/lib/mihari/services/alert_proxy.rb +7 -25
  65. data/lib/mihari/services/alert_runner.rb +9 -0
  66. data/lib/mihari/services/rule_builder.rb +47 -0
  67. data/lib/mihari/services/rule_proxy.rb +5 -61
  68. data/lib/mihari/services/rule_runner.rb +9 -4
  69. data/lib/mihari/structs/binaryedge.rb +89 -0
  70. data/lib/mihari/structs/censys.rb +11 -11
  71. data/lib/mihari/structs/greynoise.rb +17 -8
  72. data/lib/mihari/structs/onyphe.rb +7 -7
  73. data/lib/mihari/structs/shodan.rb +7 -6
  74. data/lib/mihari/structs/urlscan.rb +4 -6
  75. data/lib/mihari/structs/virustotal_intelligence.rb +4 -6
  76. data/lib/mihari/type_checker.rb +1 -1
  77. data/lib/mihari/version.rb +1 -1
  78. data/lib/mihari/web/endpoints/alerts.rb +33 -15
  79. data/lib/mihari/web/endpoints/artifacts.rb +53 -25
  80. data/lib/mihari/web/endpoints/configs.rb +2 -2
  81. data/lib/mihari/web/endpoints/ip_addresses.rb +3 -5
  82. data/lib/mihari/web/endpoints/rules.rb +97 -71
  83. data/lib/mihari/web/endpoints/tags.rb +15 -5
  84. data/lib/mihari/web/public/assets/index-ef33a6cd.js +1738 -0
  85. data/lib/mihari/web/public/index.html +1 -1
  86. data/lib/mihari/web/public/redoc-static.html +419 -382
  87. data/lib/mihari.rb +4 -0
  88. data/mihari.gemspec +10 -9
  89. metadata +38 -21
  90. data/lib/mihari/web/public/assets/index-4d7eda9f.js +0 -1738
data/lib/mihari.rb CHANGED
@@ -20,6 +20,7 @@ require "active_record"
20
20
 
21
21
  # dry-rb
22
22
  require "dry/files"
23
+ require "dry/monads"
23
24
  require "dry/schema"
24
25
  require "dry/struct"
25
26
  require "dry/types"
@@ -114,13 +115,16 @@ require "mihari/type_checker"
114
115
  require "mihari/http"
115
116
 
116
117
  # Services
118
+ require "mihari/services/rule_builder"
117
119
  require "mihari/services/rule_proxy"
118
120
  require "mihari/services/rule_runner"
119
121
 
122
+ require "mihari/services/alert_builder"
120
123
  require "mihari/services/alert_proxy"
121
124
  require "mihari/services/alert_runner"
122
125
 
123
126
  # Structs
127
+ require "mihari/structs/binaryedge"
124
128
  require "mihari/structs/censys"
125
129
  require "mihari/structs/config"
126
130
  require "mihari/structs/filters"
data/mihari.gemspec CHANGED
@@ -47,28 +47,29 @@ Gem::Specification.new do |spec|
47
47
  spec.add_development_dependency "rb-fsevent", "~> 0.11"
48
48
  spec.add_development_dependency "rerun", "~> 0.14"
49
49
  spec.add_development_dependency "rspec", "~> 3.12"
50
- spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
50
+ spec.add_development_dependency "simplecov-lcov", "~> 0.8"
51
51
  spec.add_development_dependency "standard", "~> 1.31"
52
52
  spec.add_development_dependency "timecop", "~> 0.9"
53
53
  spec.add_development_dependency "vcr", "~> 6.2"
54
- spec.add_development_dependency "webmock", "~> 3.18"
54
+ spec.add_development_dependency "webmock", "~> 3.19"
55
55
 
56
56
  unless ci_env?
57
- spec.add_development_dependency "lefthook", "~> 1.4"
57
+ spec.add_development_dependency "lefthook", "~> 1.5"
58
58
  spec.add_development_dependency "solargraph", "~> 0.49"
59
59
  end
60
60
 
61
- spec.add_dependency "activerecord", "7.0.7"
61
+ spec.add_dependency "activerecord", "7.0.8"
62
62
  spec.add_dependency "addressable", "2.8.5"
63
63
  spec.add_dependency "awrence", "2.0.1"
64
64
  spec.add_dependency "dotenv", "2.8.1"
65
65
  spec.add_dependency "dry-container", "0.11.0"
66
66
  spec.add_dependency "dry-files", "1.0.1"
67
- spec.add_dependency "dry-schema", "1.13.2"
67
+ spec.add_dependency "dry-monads", "1.6.0"
68
+ spec.add_dependency "dry-schema", "1.13.3"
68
69
  spec.add_dependency "dry-struct", "1.6.0"
69
70
  spec.add_dependency "dry-validation", "1.10.0"
70
71
  spec.add_dependency "email_address", "0.2.4"
71
- spec.add_dependency "grape", "1.7.0"
72
+ spec.add_dependency "grape", "1.8.0"
72
73
  spec.add_dependency "grape-entity", "1.0.0"
73
74
  spec.add_dependency "grape-swagger", "1.6.1"
74
75
  spec.add_dependency "grape-swagger-entity", "0.5.2"
@@ -81,14 +82,14 @@ Gem::Specification.new do |spec|
81
82
  spec.add_dependency "parallel", "1.23.0"
82
83
  spec.add_dependency "plissken", "2.0.1"
83
84
  spec.add_dependency "public_suffix", "5.0.3"
84
- spec.add_dependency "puma", "6.3.1"
85
+ spec.add_dependency "puma", "6.4.0"
85
86
  spec.add_dependency "rack", "3.0.8"
86
87
  spec.add_dependency "rack-cors", "2.0.1"
87
88
  spec.add_dependency "rackup", "2.1.0"
88
89
  spec.add_dependency "semantic_logger", "4.14.0"
89
- spec.add_dependency "sentry-ruby", "5.10.0"
90
+ spec.add_dependency "sentry-ruby", "5.11.0"
90
91
  spec.add_dependency "slack-notifier", "2.4.0"
91
- spec.add_dependency "sqlite3", "1.6.3"
92
+ spec.add_dependency "sqlite3", "1.6.6"
92
93
  spec.add_dependency "thor", "1.2.2"
93
94
  spec.add_dependency "uuidtools", "2.2.0"
94
95
  spec.add_dependency "whois", "5.1.0"
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.4.2
4
+ version: 5.4.4
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-08-20 00:00:00.000000000 Z
11
+ date: 2023-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.8.0
173
+ version: '0.8'
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: 0.8.0
180
+ version: '0.8'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: standard
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -226,28 +226,28 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '3.18'
229
+ version: '3.19'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '3.18'
236
+ version: '3.19'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: lefthook
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '1.4'
243
+ version: '1.5'
244
244
  type: :development
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: '1.4'
250
+ version: '1.5'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: solargraph
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: 7.0.7
271
+ version: 7.0.8
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: 7.0.7
278
+ version: 7.0.8
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: addressable
281
281
  requirement: !ruby/object:Gem::Requirement
@@ -346,20 +346,34 @@ dependencies:
346
346
  - - '='
347
347
  - !ruby/object:Gem::Version
348
348
  version: 1.0.1
349
+ - !ruby/object:Gem::Dependency
350
+ name: dry-monads
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - '='
354
+ - !ruby/object:Gem::Version
355
+ version: 1.6.0
356
+ type: :runtime
357
+ prerelease: false
358
+ version_requirements: !ruby/object:Gem::Requirement
359
+ requirements:
360
+ - - '='
361
+ - !ruby/object:Gem::Version
362
+ version: 1.6.0
349
363
  - !ruby/object:Gem::Dependency
350
364
  name: dry-schema
351
365
  requirement: !ruby/object:Gem::Requirement
352
366
  requirements:
353
367
  - - '='
354
368
  - !ruby/object:Gem::Version
355
- version: 1.13.2
369
+ version: 1.13.3
356
370
  type: :runtime
357
371
  prerelease: false
358
372
  version_requirements: !ruby/object:Gem::Requirement
359
373
  requirements:
360
374
  - - '='
361
375
  - !ruby/object:Gem::Version
362
- version: 1.13.2
376
+ version: 1.13.3
363
377
  - !ruby/object:Gem::Dependency
364
378
  name: dry-struct
365
379
  requirement: !ruby/object:Gem::Requirement
@@ -408,14 +422,14 @@ dependencies:
408
422
  requirements:
409
423
  - - '='
410
424
  - !ruby/object:Gem::Version
411
- version: 1.7.0
425
+ version: 1.8.0
412
426
  type: :runtime
413
427
  prerelease: false
414
428
  version_requirements: !ruby/object:Gem::Requirement
415
429
  requirements:
416
430
  - - '='
417
431
  - !ruby/object:Gem::Version
418
- version: 1.7.0
432
+ version: 1.8.0
419
433
  - !ruby/object:Gem::Dependency
420
434
  name: grape-entity
421
435
  requirement: !ruby/object:Gem::Requirement
@@ -590,14 +604,14 @@ dependencies:
590
604
  requirements:
591
605
  - - '='
592
606
  - !ruby/object:Gem::Version
593
- version: 6.3.1
607
+ version: 6.4.0
594
608
  type: :runtime
595
609
  prerelease: false
596
610
  version_requirements: !ruby/object:Gem::Requirement
597
611
  requirements:
598
612
  - - '='
599
613
  - !ruby/object:Gem::Version
600
- version: 6.3.1
614
+ version: 6.4.0
601
615
  - !ruby/object:Gem::Dependency
602
616
  name: rack
603
617
  requirement: !ruby/object:Gem::Requirement
@@ -660,14 +674,14 @@ dependencies:
660
674
  requirements:
661
675
  - - '='
662
676
  - !ruby/object:Gem::Version
663
- version: 5.10.0
677
+ version: 5.11.0
664
678
  type: :runtime
665
679
  prerelease: false
666
680
  version_requirements: !ruby/object:Gem::Requirement
667
681
  requirements:
668
682
  - - '='
669
683
  - !ruby/object:Gem::Version
670
- version: 5.10.0
684
+ version: 5.11.0
671
685
  - !ruby/object:Gem::Dependency
672
686
  name: slack-notifier
673
687
  requirement: !ruby/object:Gem::Requirement
@@ -688,14 +702,14 @@ dependencies:
688
702
  requirements:
689
703
  - - '='
690
704
  - !ruby/object:Gem::Version
691
- version: 1.6.3
705
+ version: 1.6.6
692
706
  type: :runtime
693
707
  prerelease: false
694
708
  version_requirements: !ruby/object:Gem::Requirement
695
709
  requirements:
696
710
  - - '='
697
711
  - !ruby/object:Gem::Version
698
- version: 1.6.3
712
+ version: 1.6.6
699
713
  - !ruby/object:Gem::Dependency
700
714
  name: thor
701
715
  requirement: !ruby/object:Gem::Requirement
@@ -967,10 +981,13 @@ files:
967
981
  - lib/mihari/schemas/enricher.rb
968
982
  - lib/mihari/schemas/macros.rb
969
983
  - lib/mihari/schemas/rule.rb
984
+ - lib/mihari/services/alert_builder.rb
970
985
  - lib/mihari/services/alert_proxy.rb
971
986
  - lib/mihari/services/alert_runner.rb
987
+ - lib/mihari/services/rule_builder.rb
972
988
  - lib/mihari/services/rule_proxy.rb
973
989
  - lib/mihari/services/rule_runner.rb
990
+ - lib/mihari/structs/binaryedge.rb
974
991
  - lib/mihari/structs/censys.rb
975
992
  - lib/mihari/structs/config.rb
976
993
  - lib/mihari/structs/filters.rb
@@ -997,7 +1014,7 @@ files:
997
1014
  - lib/mihari/web/middleware/connection_adapter.rb
998
1015
  - lib/mihari/web/middleware/error_notification_adapter.rb
999
1016
  - lib/mihari/web/public/assets/index-33165282.css
1000
- - lib/mihari/web/public/assets/index-4d7eda9f.js
1017
+ - lib/mihari/web/public/assets/index-ef33a6cd.js
1001
1018
  - lib/mihari/web/public/assets/mode-yaml-a21faa53.js
1002
1019
  - lib/mihari/web/public/favicon.ico
1003
1020
  - lib/mihari/web/public/index.html