mihari 5.4.0 → 5.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/frontend/package-lock.json +145 -146
  3. data/frontend/package.json +8 -8
  4. data/frontend/src/swagger.yaml +306 -272
  5. data/lib/mihari/analyzers/binaryedge.rb +4 -4
  6. data/lib/mihari/analyzers/censys.rb +2 -2
  7. data/lib/mihari/analyzers/circl.rb +2 -2
  8. data/lib/mihari/analyzers/greynoise.rb +2 -2
  9. data/lib/mihari/analyzers/hunterhow.rb +5 -5
  10. data/lib/mihari/analyzers/onyphe.rb +4 -4
  11. data/lib/mihari/analyzers/otx.rb +2 -2
  12. data/lib/mihari/analyzers/passivetotal.rb +2 -2
  13. data/lib/mihari/analyzers/pulsedive.rb +2 -2
  14. data/lib/mihari/analyzers/rule.rb +13 -12
  15. data/lib/mihari/analyzers/securitytrails.rb +2 -2
  16. data/lib/mihari/analyzers/shodan.rb +4 -4
  17. data/lib/mihari/analyzers/urlscan.rb +2 -2
  18. data/lib/mihari/analyzers/virustotal.rb +2 -2
  19. data/lib/mihari/analyzers/virustotal_intelligence.rb +2 -2
  20. data/lib/mihari/analyzers/zoomeye.rb +4 -4
  21. data/lib/mihari/cli/alert.rb +11 -0
  22. data/lib/mihari/cli/main.rb +6 -1
  23. data/lib/mihari/commands/alert.rb +42 -0
  24. data/lib/mihari/commands/rule.rb +2 -2
  25. data/lib/mihari/commands/search.rb +20 -59
  26. data/lib/mihari/config.rb +2 -2
  27. data/lib/mihari/emitters/base.rb +1 -1
  28. data/lib/mihari/emitters/database.rb +2 -2
  29. data/lib/mihari/errors.rb +23 -2
  30. data/lib/mihari/http.rb +7 -1
  31. data/lib/mihari/schemas/alert.rb +14 -0
  32. data/lib/mihari/services/alert_proxy.rb +106 -0
  33. data/lib/mihari/services/alert_runner.rb +22 -0
  34. data/lib/mihari/services/{rule.rb → rule_proxy.rb} +10 -6
  35. data/lib/mihari/services/rule_runner.rb +49 -0
  36. data/lib/mihari/version.rb +1 -1
  37. data/lib/mihari/web/endpoints/alerts.rb +22 -0
  38. data/lib/mihari/web/endpoints/rules.rb +8 -8
  39. data/lib/mihari/web/public/assets/{index-61dc587c.js → index-4d7eda9f.js} +1 -1
  40. data/lib/mihari/web/public/index.html +1 -1
  41. data/lib/mihari/web/public/redoc-static.html +29 -27
  42. data/lib/mihari.rb +6 -1
  43. data/mihari.gemspec +2 -3
  44. metadata +14 -23
  45. data/Steepfile +0 -31
data/lib/mihari.rb CHANGED
@@ -114,7 +114,11 @@ require "mihari/type_checker"
114
114
  require "mihari/http"
115
115
 
116
116
  # Services
117
- require "mihari/services/rule"
117
+ require "mihari/services/rule_proxy"
118
+ require "mihari/services/rule_runner"
119
+
120
+ require "mihari/services/alert_proxy"
121
+ require "mihari/services/alert_runner"
118
122
 
119
123
  # Structs
120
124
  require "mihari/structs/censys"
@@ -132,6 +136,7 @@ require "mihari/structs/virustotal_intelligence"
132
136
  # Schemas
133
137
  require "mihari/schemas/macros"
134
138
 
139
+ require "mihari/schemas/alert"
135
140
  require "mihari/schemas/analyzer"
136
141
  require "mihari/schemas/rule"
137
142
 
data/mihari.gemspec CHANGED
@@ -48,7 +48,7 @@ Gem::Specification.new do |spec|
48
48
  spec.add_development_dependency "rerun", "~> 0.14"
49
49
  spec.add_development_dependency "rspec", "~> 3.12"
50
50
  spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
51
- spec.add_development_dependency "standard", "~> 1.30"
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
54
  spec.add_development_dependency "webmock", "~> 3.18"
@@ -56,7 +56,6 @@ Gem::Specification.new do |spec|
56
56
  unless ci_env?
57
57
  spec.add_development_dependency "lefthook", "~> 1.4"
58
58
  spec.add_development_dependency "solargraph", "~> 0.49"
59
- spec.add_development_dependency "steep", "~> 1.4"
60
59
  end
61
60
 
62
61
  spec.add_dependency "activerecord", "7.0.7"
@@ -82,7 +81,7 @@ Gem::Specification.new do |spec|
82
81
  spec.add_dependency "parallel", "1.23.0"
83
82
  spec.add_dependency "plissken", "2.0.1"
84
83
  spec.add_dependency "public_suffix", "5.0.3"
85
- spec.add_dependency "puma", "6.3.0"
84
+ spec.add_dependency "puma", "6.3.1"
86
85
  spec.add_dependency "rack", "3.0.8"
87
86
  spec.add_dependency "rack-cors", "2.0.1"
88
87
  spec.add_dependency "rackup", "2.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.0
4
+ version: 5.4.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: 2023-08-11 00:00:00.000000000 Z
11
+ date: 2023-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '1.30'
187
+ version: '1.31'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '1.30'
194
+ version: '1.31'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: timecop
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -262,20 +262,6 @@ dependencies:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0.49'
265
- - !ruby/object:Gem::Dependency
266
- name: steep
267
- requirement: !ruby/object:Gem::Requirement
268
- requirements:
269
- - - "~>"
270
- - !ruby/object:Gem::Version
271
- version: '1.4'
272
- type: :development
273
- prerelease: false
274
- version_requirements: !ruby/object:Gem::Requirement
275
- requirements:
276
- - - "~>"
277
- - !ruby/object:Gem::Version
278
- version: '1.4'
279
265
  - !ruby/object:Gem::Dependency
280
266
  name: activerecord
281
267
  requirement: !ruby/object:Gem::Requirement
@@ -604,14 +590,14 @@ dependencies:
604
590
  requirements:
605
591
  - - '='
606
592
  - !ruby/object:Gem::Version
607
- version: 6.3.0
593
+ version: 6.3.1
608
594
  type: :runtime
609
595
  prerelease: false
610
596
  version_requirements: !ruby/object:Gem::Requirement
611
597
  requirements:
612
598
  - - '='
613
599
  - !ruby/object:Gem::Version
614
- version: 6.3.0
600
+ version: 6.3.1
615
601
  - !ruby/object:Gem::Dependency
616
602
  name: rack
617
603
  requirement: !ruby/object:Gem::Requirement
@@ -782,7 +768,6 @@ files:
782
768
  - LICENSE
783
769
  - README.md
784
770
  - Rakefile
785
- - Steepfile
786
771
  - bin/console
787
772
  - bin/setup
788
773
  - build_frontend.sh
@@ -896,6 +881,7 @@ files:
896
881
  - lib/mihari/analyzers/virustotal.rb
897
882
  - lib/mihari/analyzers/virustotal_intelligence.rb
898
883
  - lib/mihari/analyzers/zoomeye.rb
884
+ - lib/mihari/cli/alert.rb
899
885
  - lib/mihari/cli/base.rb
900
886
  - lib/mihari/cli/database.rb
901
887
  - lib/mihari/cli/main.rb
@@ -919,6 +905,7 @@ files:
919
905
  - lib/mihari/clients/urlscan.rb
920
906
  - lib/mihari/clients/virustotal.rb
921
907
  - lib/mihari/clients/zoomeye.rb
908
+ - lib/mihari/commands/alert.rb
922
909
  - lib/mihari/commands/database.rb
923
910
  - lib/mihari/commands/rule.rb
924
911
  - lib/mihari/commands/search.rb
@@ -974,12 +961,16 @@ files:
974
961
  - lib/mihari/models/tag.rb
975
962
  - lib/mihari/models/tagging.rb
976
963
  - lib/mihari/models/whois.rb
964
+ - lib/mihari/schemas/alert.rb
977
965
  - lib/mihari/schemas/analyzer.rb
978
966
  - lib/mihari/schemas/emitter.rb
979
967
  - lib/mihari/schemas/enricher.rb
980
968
  - lib/mihari/schemas/macros.rb
981
969
  - lib/mihari/schemas/rule.rb
982
- - lib/mihari/services/rule.rb
970
+ - lib/mihari/services/alert_proxy.rb
971
+ - lib/mihari/services/alert_runner.rb
972
+ - lib/mihari/services/rule_proxy.rb
973
+ - lib/mihari/services/rule_runner.rb
983
974
  - lib/mihari/structs/censys.rb
984
975
  - lib/mihari/structs/config.rb
985
976
  - lib/mihari/structs/filters.rb
@@ -1006,7 +997,7 @@ files:
1006
997
  - lib/mihari/web/middleware/connection_adapter.rb
1007
998
  - lib/mihari/web/middleware/error_notification_adapter.rb
1008
999
  - lib/mihari/web/public/assets/index-33165282.css
1009
- - lib/mihari/web/public/assets/index-61dc587c.js
1000
+ - lib/mihari/web/public/assets/index-4d7eda9f.js
1010
1001
  - lib/mihari/web/public/assets/mode-yaml-a21faa53.js
1011
1002
  - lib/mihari/web/public/favicon.ico
1012
1003
  - lib/mihari/web/public/index.html
data/Steepfile DELETED
@@ -1,31 +0,0 @@
1
- target :lib do
2
- check "lib"
3
-
4
- repo_path "vendor/rbs/gem_rbs_collection/gems"
5
-
6
- library "date"
7
- library "json"
8
- library "logger"
9
- library "monitor"
10
- library "mutex_m"
11
- library "pathname"
12
- library "securerandom"
13
- library "singleton"
14
- library "time"
15
- library "tsort"
16
- library "uri"
17
- library "resolv"
18
- library "timeout"
19
- library "socket"
20
-
21
- library "rack"
22
-
23
- library "actionpack"
24
- library "actionview"
25
- library "activejob"
26
- library "activemodel"
27
- library "activerecord"
28
- library "activesupport"
29
- library "parallel"
30
- library "railties"
31
- end