mihari 3.9.0 → 3.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +6 -7
  3. data/README.md +1 -0
  4. data/config.ru +1 -1
  5. data/lib/mihari/analyzers/greynoise.rb +65 -0
  6. data/lib/mihari/analyzers/rule.rb +1 -0
  7. data/lib/mihari/analyzers/shodan.rb +11 -5
  8. data/lib/mihari/cli/analyzer.rb +2 -0
  9. data/lib/mihari/commands/greynoise.rb +21 -0
  10. data/lib/mihari/commands/search.rb +3 -2
  11. data/lib/mihari/errors.rb +2 -0
  12. data/lib/mihari/mixins/configuration.rb +12 -2
  13. data/lib/mihari/models/alert.rb +1 -8
  14. data/lib/mihari/models/artifact.rb +3 -0
  15. data/lib/mihari/schemas/configuration.rb +3 -2
  16. data/lib/mihari/structs/greynoise.rb +55 -0
  17. data/lib/mihari/structs/ipinfo.rb +3 -4
  18. data/lib/mihari/structs/shodan.rb +6 -6
  19. data/lib/mihari/types.rb +1 -0
  20. data/lib/mihari/version.rb +1 -1
  21. data/lib/mihari/web/api.rb +43 -0
  22. data/lib/mihari/web/app.rb +47 -29
  23. data/lib/mihari/web/endpoints/alerts.rb +74 -0
  24. data/lib/mihari/web/endpoints/artifacts.rb +92 -0
  25. data/lib/mihari/web/endpoints/command.rb +32 -0
  26. data/lib/mihari/web/endpoints/configs.rb +22 -0
  27. data/lib/mihari/web/endpoints/ip_addresses.rb +27 -0
  28. data/lib/mihari/web/endpoints/sources.rb +18 -0
  29. data/lib/mihari/web/endpoints/tags.rb +38 -0
  30. data/lib/mihari/web/entities/alert.rb +23 -0
  31. data/lib/mihari/web/entities/artifact.rb +24 -0
  32. data/lib/mihari/web/entities/autonomous_system.rb +9 -0
  33. data/lib/mihari/web/entities/command.rb +14 -0
  34. data/lib/mihari/web/entities/config.rb +16 -0
  35. data/lib/mihari/web/entities/dns.rb +10 -0
  36. data/lib/mihari/web/entities/geolocation.rb +10 -0
  37. data/lib/mihari/web/entities/ip_address.rb +13 -0
  38. data/lib/mihari/web/entities/message.rb +9 -0
  39. data/lib/mihari/web/entities/reverse_dns.rb +9 -0
  40. data/lib/mihari/web/entities/source.rb +9 -0
  41. data/lib/mihari/web/entities/tag.rb +13 -0
  42. data/lib/mihari/web/entities/whois.rb +16 -0
  43. data/lib/mihari/web/public/grape.rb +73 -0
  44. data/lib/mihari/web/public/index.html +1 -1
  45. data/lib/mihari/web/public/redoc-static.html +54 -28
  46. data/lib/mihari/web/public/static/js/app.0a0cc502.js +21 -0
  47. data/lib/mihari/web/public/static/js/app.0a0cc502.js.map +1 -0
  48. data/lib/mihari/web/public/static/js/app.14008741.js +21 -0
  49. data/lib/mihari/web/public/static/js/app.14008741.js.map +1 -0
  50. data/lib/mihari/web/public/static/js/app.6b636b62.js +50 -0
  51. data/lib/mihari/web/public/static/js/app.6b636b62.js.map +1 -0
  52. data/lib/mihari/web/public/static/js/app.fbc19869.js +21 -0
  53. data/lib/mihari/web/public/static/js/app.fbc19869.js.map +1 -0
  54. data/lib/mihari.rb +7 -14
  55. data/mihari.gemspec +9 -5
  56. data/sig/lib/mihari/structs/greynoise.rbs +30 -0
  57. data/sig/lib/mihari/structs/shodan.rbs +3 -3
  58. data/sig/lib/mihari/web/app.rbs +1 -1
  59. metadata +146 -74
  60. data/lib/mihari/serializers/alert.rb +0 -14
  61. data/lib/mihari/serializers/artifact.rb +0 -18
  62. data/lib/mihari/serializers/autonomous_system.rb +0 -9
  63. data/lib/mihari/serializers/dns.rb +0 -11
  64. data/lib/mihari/serializers/geolocation.rb +0 -11
  65. data/lib/mihari/serializers/reverse_dns.rb +0 -11
  66. data/lib/mihari/serializers/tag.rb +0 -11
  67. data/lib/mihari/serializers/whois.rb +0 -11
  68. data/lib/mihari/web/controllers/alerts_controller.rb +0 -67
  69. data/lib/mihari/web/controllers/analyzers_controller.rb +0 -38
  70. data/lib/mihari/web/controllers/artifacts_controller.rb +0 -94
  71. data/lib/mihari/web/controllers/base_controller.rb +0 -22
  72. data/lib/mihari/web/controllers/command_controller.rb +0 -26
  73. data/lib/mihari/web/controllers/config_controller.rb +0 -13
  74. data/lib/mihari/web/controllers/ip_address_controller.rb +0 -21
  75. data/lib/mihari/web/controllers/sources_controller.rb +0 -12
  76. data/lib/mihari/web/controllers/tags_controller.rb +0 -30
  77. data/lib/mihari/web/helpers/json.rb +0 -53
data/lib/mihari.rb CHANGED
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "awrence"
3
4
  require "colorize"
4
5
  require "dry/configurable"
5
6
  require "dry/files"
6
7
  require "mem"
8
+ require "plissken"
7
9
  require "yaml"
8
10
 
9
11
  # Load .env
@@ -35,6 +37,8 @@ module Mihari
35
37
  setting :censys_secret, default: ENV["CENSYS_SECRET"]
36
38
  setting :circl_passive_password, default: ENV["CIRCL_PASSIVE_PASSWORD"]
37
39
  setting :circl_passive_username, default: ENV["CIRCL_PASSIVE_USERNAME"]
40
+ setting :database, default: ENV["DATABASE"] || "mihari.db"
41
+ setting :greynoise_api_key, default: ENV["GREYNOISE_API_KEY"]
38
42
  setting :ipinfo_api_key, default: ENV["IPINFO_API_KEY"]
39
43
  setting :misp_api_endpoint, default: ENV["MISP_API_ENDPOINT"]
40
44
  setting :misp_api_key, default: ENV["MISP_API_KEY"]
@@ -52,10 +56,9 @@ module Mihari
52
56
  setting :thehive_api_key, default: ENV["THEHIVE_API_KEY"]
53
57
  setting :urlscan_api_key, default: ENV["URLSCAN_API_KEY"]
54
58
  setting :virustotal_api_key, default: ENV["VIRUSTOTAL_API_KEY"]
55
- setting :zoomeye_api_key, default: ENV["ZOOMEYE_API_KEY"]
56
59
  setting :webhook_url, default: ENV["WEBHOOK_URL"]
57
60
  setting :webhook_use_json_body, constructor: ->(value = ENV["WEBHOOK_USE_JSON_BODY"]) { truthy?(value) }
58
- setting :database, default: ENV["DATABASE"] || "mihari.db"
61
+ setting :zoomeye_api_key, default: ENV["ZOOMEYE_API_KEY"]
59
62
 
60
63
  class << self
61
64
  include Mem
@@ -110,6 +113,7 @@ require "mihari/types"
110
113
  # Structs
111
114
  require "mihari/structs/alert"
112
115
  require "mihari/structs/censys"
116
+ require "mihari/structs/greynoise"
113
117
  require "mihari/structs/ipinfo"
114
118
  require "mihari/structs/onyphe"
115
119
  require "mihari/structs/shodan"
@@ -135,18 +139,6 @@ require "mihari/models/tag"
135
139
  require "mihari/models/tagging"
136
140
  require "mihari/models/whois"
137
141
 
138
- # Serializers
139
- require "mihari/serializers/autonomous_system"
140
- require "mihari/serializers/dns"
141
- require "mihari/serializers/geolocation"
142
- require "mihari/serializers/reverse_dns"
143
- require "mihari/serializers/tag"
144
- require "mihari/serializers/whois"
145
-
146
- require "mihari/serializers/artifact"
147
-
148
- require "mihari/serializers/alert"
149
-
150
142
  # Analyzers
151
143
  require "mihari/analyzers/base"
152
144
  require "mihari/analyzers/basic"
@@ -157,6 +149,7 @@ require "mihari/analyzers/circl"
157
149
  require "mihari/analyzers/crtsh"
158
150
  require "mihari/analyzers/dnpedia"
159
151
  require "mihari/analyzers/dnstwister"
152
+ require "mihari/analyzers/greynoise"
160
153
  require "mihari/analyzers/onyphe"
161
154
  require "mihari/analyzers/otx"
162
155
  require "mihari/analyzers/passivetotal"
data/mihari.gemspec CHANGED
@@ -42,7 +42,6 @@ Gem::Specification.new do |spec|
42
42
  spec.add_development_dependency "vcr", "~> 6.0"
43
43
  spec.add_development_dependency "webmock", "~> 3.14"
44
44
 
45
- spec.add_dependency "active_model_serializers", "~> 0.10"
46
45
  spec.add_dependency "activerecord", "~> 6.1"
47
46
  spec.add_dependency "activerecord-filter", "~> 6.1"
48
47
  spec.add_dependency "addressable", "~> 2.8"
@@ -56,11 +55,17 @@ Gem::Specification.new do |spec|
56
55
  spec.add_dependency "dnstwister", "~> 0.1"
57
56
  spec.add_dependency "dotenv", "~> 2.7"
58
57
  spec.add_dependency "dry-configurable", "~> 0.13"
58
+ spec.add_dependency "dry-container", "~> 0.9"
59
59
  spec.add_dependency "dry-files", "~> 0.1"
60
60
  spec.add_dependency "dry-initializer", "~> 3.0"
61
61
  spec.add_dependency "dry-struct", "~> 1.4"
62
62
  spec.add_dependency "dry-validation", "~> 1.7"
63
63
  spec.add_dependency "email_address", "~> 0.2"
64
+ spec.add_dependency "grape", "~> 1.6"
65
+ spec.add_dependency "grape-entity", "~> 0.10"
66
+ spec.add_dependency "grape-swagger", "~> 1.4"
67
+ spec.add_dependency "grape-swagger-entity", "~> 0.5"
68
+ spec.add_dependency "greynoise", "~> 0.1"
64
69
  spec.add_dependency "hachi", "~> 1.0"
65
70
  spec.add_dependency "http", "~> 5.0"
66
71
  spec.add_dependency "launchy", "~> 2.5"
@@ -71,20 +76,19 @@ Gem::Specification.new do |spec|
71
76
  spec.add_dependency "normalize_country", "0.3"
72
77
  spec.add_dependency "onyphe", "~> 2.0"
73
78
  spec.add_dependency "otx_ruby", "~> 0.9"
74
- spec.add_dependency "parallel", "~> 1.20"
79
+ spec.add_dependency "parallel", "~> 1.21"
75
80
  spec.add_dependency "passive_circl", "~> 0.1"
76
81
  spec.add_dependency "passivetotalx", "~> 0.1"
82
+ spec.add_dependency "plissken", "~> 1.4"
77
83
  spec.add_dependency "public_suffix", "~> 4.0"
78
84
  spec.add_dependency "pulsedive", "~> 0.1"
79
85
  spec.add_dependency "puma", "~> 5.5"
80
86
  spec.add_dependency "rack", "~> 2.2"
81
87
  spec.add_dependency "rack-contrib", "~> 2.3"
88
+ spec.add_dependency "rack-cors", "~> 1.1"
82
89
  spec.add_dependency "safe_shell", "~> 1.1"
83
90
  spec.add_dependency "securitytrails", "~> 1.0"
84
91
  spec.add_dependency "shodanx", "~> 0.2"
85
- spec.add_dependency "sinatra", "~> 2.1"
86
- spec.add_dependency "sinatra-contrib", "~> 2.1"
87
- spec.add_dependency "sinatra-param", "~> 1.6"
88
92
  spec.add_dependency "slack-notifier", "~> 2.4"
89
93
  spec.add_dependency "spysex", "~> 0.2"
90
94
  spec.add_dependency "sqlite3", "~> 1.4"
@@ -0,0 +1,30 @@
1
+ module Mihari
2
+ module Structs
3
+ module GreyNoise
4
+ class Metadata < Dry::Struct
5
+ attr_reader country: String
6
+ attr_reader country_code: String
7
+ attr_reader asn: String
8
+
9
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> untyped
10
+ end
11
+
12
+ class Datum < Dry::Struct
13
+ attr_reader ip: String
14
+ attr_reader metadata: Mihari::Structs::GreyNoise::Metadata
15
+
16
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> untyped
17
+ end
18
+
19
+ class Response < Dry::Struct
20
+ attr_reader complete: Boolean
21
+ attr_reader count: Integer
22
+ attr_reader data: Array[Mihari::Structs::GreyNoise::Danum]
23
+ attr_reader message: String
24
+ attr_reader query: String
25
+
26
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> untyped
27
+ end
28
+ end
29
+ end
30
+ end
@@ -2,14 +2,14 @@ module Mihari
2
2
  module Structs
3
3
  module Shodan
4
4
  class Location
5
- attr_reader country_code: String
6
- attr_reader country_name: String
5
+ attr_reader country_code: String?
6
+ attr_reader country_name: String?
7
7
 
8
8
  def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Shodan::Location
9
9
  end
10
10
 
11
11
  class Match
12
- attr_reader asn: String
12
+ attr_reader asn: String?
13
13
  attr_reader hostnames: Array[String]
14
14
  attr_reader location: Mihari::Structs::Shodan::Location
15
15
  attr_reader domains: Array[String]
@@ -1,5 +1,5 @@
1
1
  module Mihari
2
- class App # < Sinatra::Base
2
+ class App
3
3
  def self.run!: (?port: ::Integer port, ?host: ::String host, ?threads: ::String threads, ?verbose: bool verbose) -> void
4
4
  end
5
5
  end
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.9.0
4
+ version: 3.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-23 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -234,20 +234,6 @@ dependencies:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
236
  version: '3.14'
237
- - !ruby/object:Gem::Dependency
238
- name: active_model_serializers
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - "~>"
242
- - !ruby/object:Gem::Version
243
- version: '0.10'
244
- type: :runtime
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - "~>"
249
- - !ruby/object:Gem::Version
250
- version: '0.10'
251
237
  - !ruby/object:Gem::Dependency
252
238
  name: activerecord
253
239
  requirement: !ruby/object:Gem::Requirement
@@ -430,6 +416,20 @@ dependencies:
430
416
  - - "~>"
431
417
  - !ruby/object:Gem::Version
432
418
  version: '0.13'
419
+ - !ruby/object:Gem::Dependency
420
+ name: dry-container
421
+ requirement: !ruby/object:Gem::Requirement
422
+ requirements:
423
+ - - "~>"
424
+ - !ruby/object:Gem::Version
425
+ version: '0.9'
426
+ type: :runtime
427
+ prerelease: false
428
+ version_requirements: !ruby/object:Gem::Requirement
429
+ requirements:
430
+ - - "~>"
431
+ - !ruby/object:Gem::Version
432
+ version: '0.9'
433
433
  - !ruby/object:Gem::Dependency
434
434
  name: dry-files
435
435
  requirement: !ruby/object:Gem::Requirement
@@ -500,6 +500,76 @@ dependencies:
500
500
  - - "~>"
501
501
  - !ruby/object:Gem::Version
502
502
  version: '0.2'
503
+ - !ruby/object:Gem::Dependency
504
+ name: grape
505
+ requirement: !ruby/object:Gem::Requirement
506
+ requirements:
507
+ - - "~>"
508
+ - !ruby/object:Gem::Version
509
+ version: '1.6'
510
+ type: :runtime
511
+ prerelease: false
512
+ version_requirements: !ruby/object:Gem::Requirement
513
+ requirements:
514
+ - - "~>"
515
+ - !ruby/object:Gem::Version
516
+ version: '1.6'
517
+ - !ruby/object:Gem::Dependency
518
+ name: grape-entity
519
+ requirement: !ruby/object:Gem::Requirement
520
+ requirements:
521
+ - - "~>"
522
+ - !ruby/object:Gem::Version
523
+ version: '0.10'
524
+ type: :runtime
525
+ prerelease: false
526
+ version_requirements: !ruby/object:Gem::Requirement
527
+ requirements:
528
+ - - "~>"
529
+ - !ruby/object:Gem::Version
530
+ version: '0.10'
531
+ - !ruby/object:Gem::Dependency
532
+ name: grape-swagger
533
+ requirement: !ruby/object:Gem::Requirement
534
+ requirements:
535
+ - - "~>"
536
+ - !ruby/object:Gem::Version
537
+ version: '1.4'
538
+ type: :runtime
539
+ prerelease: false
540
+ version_requirements: !ruby/object:Gem::Requirement
541
+ requirements:
542
+ - - "~>"
543
+ - !ruby/object:Gem::Version
544
+ version: '1.4'
545
+ - !ruby/object:Gem::Dependency
546
+ name: grape-swagger-entity
547
+ requirement: !ruby/object:Gem::Requirement
548
+ requirements:
549
+ - - "~>"
550
+ - !ruby/object:Gem::Version
551
+ version: '0.5'
552
+ type: :runtime
553
+ prerelease: false
554
+ version_requirements: !ruby/object:Gem::Requirement
555
+ requirements:
556
+ - - "~>"
557
+ - !ruby/object:Gem::Version
558
+ version: '0.5'
559
+ - !ruby/object:Gem::Dependency
560
+ name: greynoise
561
+ requirement: !ruby/object:Gem::Requirement
562
+ requirements:
563
+ - - "~>"
564
+ - !ruby/object:Gem::Version
565
+ version: '0.1'
566
+ type: :runtime
567
+ prerelease: false
568
+ version_requirements: !ruby/object:Gem::Requirement
569
+ requirements:
570
+ - - "~>"
571
+ - !ruby/object:Gem::Version
572
+ version: '0.1'
503
573
  - !ruby/object:Gem::Dependency
504
574
  name: hachi
505
575
  requirement: !ruby/object:Gem::Requirement
@@ -646,14 +716,14 @@ dependencies:
646
716
  requirements:
647
717
  - - "~>"
648
718
  - !ruby/object:Gem::Version
649
- version: '1.20'
719
+ version: '1.21'
650
720
  type: :runtime
651
721
  prerelease: false
652
722
  version_requirements: !ruby/object:Gem::Requirement
653
723
  requirements:
654
724
  - - "~>"
655
725
  - !ruby/object:Gem::Version
656
- version: '1.20'
726
+ version: '1.21'
657
727
  - !ruby/object:Gem::Dependency
658
728
  name: passive_circl
659
729
  requirement: !ruby/object:Gem::Requirement
@@ -682,6 +752,20 @@ dependencies:
682
752
  - - "~>"
683
753
  - !ruby/object:Gem::Version
684
754
  version: '0.1'
755
+ - !ruby/object:Gem::Dependency
756
+ name: plissken
757
+ requirement: !ruby/object:Gem::Requirement
758
+ requirements:
759
+ - - "~>"
760
+ - !ruby/object:Gem::Version
761
+ version: '1.4'
762
+ type: :runtime
763
+ prerelease: false
764
+ version_requirements: !ruby/object:Gem::Requirement
765
+ requirements:
766
+ - - "~>"
767
+ - !ruby/object:Gem::Version
768
+ version: '1.4'
685
769
  - !ruby/object:Gem::Dependency
686
770
  name: public_suffix
687
771
  requirement: !ruby/object:Gem::Requirement
@@ -753,7 +837,7 @@ dependencies:
753
837
  - !ruby/object:Gem::Version
754
838
  version: '2.3'
755
839
  - !ruby/object:Gem::Dependency
756
- name: safe_shell
840
+ name: rack-cors
757
841
  requirement: !ruby/object:Gem::Requirement
758
842
  requirements:
759
843
  - - "~>"
@@ -767,75 +851,47 @@ dependencies:
767
851
  - !ruby/object:Gem::Version
768
852
  version: '1.1'
769
853
  - !ruby/object:Gem::Dependency
770
- name: securitytrails
771
- requirement: !ruby/object:Gem::Requirement
772
- requirements:
773
- - - "~>"
774
- - !ruby/object:Gem::Version
775
- version: '1.0'
776
- type: :runtime
777
- prerelease: false
778
- version_requirements: !ruby/object:Gem::Requirement
779
- requirements:
780
- - - "~>"
781
- - !ruby/object:Gem::Version
782
- version: '1.0'
783
- - !ruby/object:Gem::Dependency
784
- name: shodanx
785
- requirement: !ruby/object:Gem::Requirement
786
- requirements:
787
- - - "~>"
788
- - !ruby/object:Gem::Version
789
- version: '0.2'
790
- type: :runtime
791
- prerelease: false
792
- version_requirements: !ruby/object:Gem::Requirement
793
- requirements:
794
- - - "~>"
795
- - !ruby/object:Gem::Version
796
- version: '0.2'
797
- - !ruby/object:Gem::Dependency
798
- name: sinatra
854
+ name: safe_shell
799
855
  requirement: !ruby/object:Gem::Requirement
800
856
  requirements:
801
857
  - - "~>"
802
858
  - !ruby/object:Gem::Version
803
- version: '2.1'
859
+ version: '1.1'
804
860
  type: :runtime
805
861
  prerelease: false
806
862
  version_requirements: !ruby/object:Gem::Requirement
807
863
  requirements:
808
864
  - - "~>"
809
865
  - !ruby/object:Gem::Version
810
- version: '2.1'
866
+ version: '1.1'
811
867
  - !ruby/object:Gem::Dependency
812
- name: sinatra-contrib
868
+ name: securitytrails
813
869
  requirement: !ruby/object:Gem::Requirement
814
870
  requirements:
815
871
  - - "~>"
816
872
  - !ruby/object:Gem::Version
817
- version: '2.1'
873
+ version: '1.0'
818
874
  type: :runtime
819
875
  prerelease: false
820
876
  version_requirements: !ruby/object:Gem::Requirement
821
877
  requirements:
822
878
  - - "~>"
823
879
  - !ruby/object:Gem::Version
824
- version: '2.1'
880
+ version: '1.0'
825
881
  - !ruby/object:Gem::Dependency
826
- name: sinatra-param
882
+ name: shodanx
827
883
  requirement: !ruby/object:Gem::Requirement
828
884
  requirements:
829
885
  - - "~>"
830
886
  - !ruby/object:Gem::Version
831
- version: '1.6'
887
+ version: '0.2'
832
888
  type: :runtime
833
889
  prerelease: false
834
890
  version_requirements: !ruby/object:Gem::Requirement
835
891
  requirements:
836
892
  - - "~>"
837
893
  - !ruby/object:Gem::Version
838
- version: '1.6'
894
+ version: '0.2'
839
895
  - !ruby/object:Gem::Dependency
840
896
  name: slack-notifier
841
897
  requirement: !ruby/object:Gem::Requirement
@@ -1036,6 +1092,7 @@ files:
1036
1092
  - lib/mihari/analyzers/crtsh.rb
1037
1093
  - lib/mihari/analyzers/dnpedia.rb
1038
1094
  - lib/mihari/analyzers/dnstwister.rb
1095
+ - lib/mihari/analyzers/greynoise.rb
1039
1096
  - lib/mihari/analyzers/onyphe.rb
1040
1097
  - lib/mihari/analyzers/otx.rb
1041
1098
  - lib/mihari/analyzers/passivetotal.rb
@@ -1060,6 +1117,7 @@ files:
1060
1117
  - lib/mihari/commands/crtsh.rb
1061
1118
  - lib/mihari/commands/dnpedia.rb
1062
1119
  - lib/mihari/commands/dnstwister.rb
1120
+ - lib/mihari/commands/greynoise.rb
1063
1121
  - lib/mihari/commands/init.rb
1064
1122
  - lib/mihari/commands/json.rb
1065
1123
  - lib/mihari/commands/onyphe.rb
@@ -1112,17 +1170,10 @@ files:
1112
1170
  - lib/mihari/schemas/configuration.rb
1113
1171
  - lib/mihari/schemas/macros.rb
1114
1172
  - lib/mihari/schemas/rule.rb
1115
- - lib/mihari/serializers/alert.rb
1116
- - lib/mihari/serializers/artifact.rb
1117
- - lib/mihari/serializers/autonomous_system.rb
1118
- - lib/mihari/serializers/dns.rb
1119
- - lib/mihari/serializers/geolocation.rb
1120
- - lib/mihari/serializers/reverse_dns.rb
1121
- - lib/mihari/serializers/tag.rb
1122
- - lib/mihari/serializers/whois.rb
1123
1173
  - lib/mihari/status.rb
1124
1174
  - lib/mihari/structs/alert.rb
1125
1175
  - lib/mihari/structs/censys.rb
1176
+ - lib/mihari/structs/greynoise.rb
1126
1177
  - lib/mihari/structs/ipinfo.rb
1127
1178
  - lib/mihari/structs/onyphe.rb
1128
1179
  - lib/mihari/structs/shodan.rb
@@ -1131,17 +1182,29 @@ files:
1131
1182
  - lib/mihari/type_checker.rb
1132
1183
  - lib/mihari/types.rb
1133
1184
  - lib/mihari/version.rb
1185
+ - lib/mihari/web/api.rb
1134
1186
  - lib/mihari/web/app.rb
1135
- - lib/mihari/web/controllers/alerts_controller.rb
1136
- - lib/mihari/web/controllers/analyzers_controller.rb
1137
- - lib/mihari/web/controllers/artifacts_controller.rb
1138
- - lib/mihari/web/controllers/base_controller.rb
1139
- - lib/mihari/web/controllers/command_controller.rb
1140
- - lib/mihari/web/controllers/config_controller.rb
1141
- - lib/mihari/web/controllers/ip_address_controller.rb
1142
- - lib/mihari/web/controllers/sources_controller.rb
1143
- - lib/mihari/web/controllers/tags_controller.rb
1144
- - lib/mihari/web/helpers/json.rb
1187
+ - lib/mihari/web/endpoints/alerts.rb
1188
+ - lib/mihari/web/endpoints/artifacts.rb
1189
+ - lib/mihari/web/endpoints/command.rb
1190
+ - lib/mihari/web/endpoints/configs.rb
1191
+ - lib/mihari/web/endpoints/ip_addresses.rb
1192
+ - lib/mihari/web/endpoints/sources.rb
1193
+ - lib/mihari/web/endpoints/tags.rb
1194
+ - lib/mihari/web/entities/alert.rb
1195
+ - lib/mihari/web/entities/artifact.rb
1196
+ - lib/mihari/web/entities/autonomous_system.rb
1197
+ - lib/mihari/web/entities/command.rb
1198
+ - lib/mihari/web/entities/config.rb
1199
+ - lib/mihari/web/entities/dns.rb
1200
+ - lib/mihari/web/entities/geolocation.rb
1201
+ - lib/mihari/web/entities/ip_address.rb
1202
+ - lib/mihari/web/entities/message.rb
1203
+ - lib/mihari/web/entities/reverse_dns.rb
1204
+ - lib/mihari/web/entities/source.rb
1205
+ - lib/mihari/web/entities/tag.rb
1206
+ - lib/mihari/web/entities/whois.rb
1207
+ - lib/mihari/web/public/grape.rb
1145
1208
  - lib/mihari/web/public/index.html
1146
1209
  - lib/mihari/web/public/redoc-static.html
1147
1210
  - lib/mihari/web/public/static/favicon.ico
@@ -1177,10 +1240,16 @@ files:
1177
1240
  - lib/mihari/web/public/static/img/fa-solid-900.37bc7099.svg
1178
1241
  - lib/mihari/web/public/static/js/app.06d5cf1c.js
1179
1242
  - lib/mihari/web/public/static/js/app.06d5cf1c.js.map
1243
+ - lib/mihari/web/public/static/js/app.0a0cc502.js
1244
+ - lib/mihari/web/public/static/js/app.0a0cc502.js.map
1245
+ - lib/mihari/web/public/static/js/app.14008741.js
1246
+ - lib/mihari/web/public/static/js/app.14008741.js.map
1180
1247
  - lib/mihari/web/public/static/js/app.365f1907.js
1181
1248
  - lib/mihari/web/public/static/js/app.365f1907.js.map
1182
1249
  - lib/mihari/web/public/static/js/app.378da3dc.js
1183
1250
  - lib/mihari/web/public/static/js/app.378da3dc.js.map
1251
+ - lib/mihari/web/public/static/js/app.6b636b62.js
1252
+ - lib/mihari/web/public/static/js/app.6b636b62.js.map
1184
1253
  - lib/mihari/web/public/static/js/app.8e3e5150.js
1185
1254
  - lib/mihari/web/public/static/js/app.8e3e5150.js.map
1186
1255
  - lib/mihari/web/public/static/js/app.a862ebca.js
@@ -1191,6 +1260,8 @@ files:
1191
1260
  - lib/mihari/web/public/static/js/app.b5914c39.js.map
1192
1261
  - lib/mihari/web/public/static/js/app.cccddb2b.js
1193
1262
  - lib/mihari/web/public/static/js/app.cccddb2b.js.map
1263
+ - lib/mihari/web/public/static/js/app.fbc19869.js
1264
+ - lib/mihari/web/public/static/js/app.fbc19869.js.map
1194
1265
  - mihari.gemspec
1195
1266
  - renovate.json
1196
1267
  - sig/lib/mihari.rbs
@@ -1276,6 +1347,7 @@ files:
1276
1347
  - sig/lib/mihari/status.rbs
1277
1348
  - sig/lib/mihari/structs/alert.rbs
1278
1349
  - sig/lib/mihari/structs/censys.rbs
1350
+ - sig/lib/mihari/structs/greynoise.rbs
1279
1351
  - sig/lib/mihari/structs/ipinfo.rbs
1280
1352
  - sig/lib/mihari/structs/onyphe.rbs
1281
1353
  - sig/lib/mihari/structs/shodan.rbs
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class AlertSerializer < ActiveModel::Serializer
8
- attributes :id, :title, :description, :source, :created_at
9
-
10
- has_many :artifacts, serializer: ArtifactSerializer
11
- has_many :tags, through: :taggings, serializer: TagSerializer
12
- end
13
- end
14
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class ArtifactSerializer < ActiveModel::Serializer
8
- attributes :id, :data, :data_type, :source
9
-
10
- has_one :autonomous_system, serializer: AutonomousSystemSerializer
11
- has_one :geolocation, serializer: GeolocationSerializer
12
- has_one :whois_record, serializer: WhoisRecordSerializer
13
-
14
- has_many :dns_records, serializer: DnsRecordSerializer
15
- has_many :reverse_dns_names, serializer: ReverseDnsNameSerializer
16
- end
17
- end
18
- end
@@ -1,9 +0,0 @@
1
- require "active_model_serializers"
2
-
3
- module Mihari
4
- module Serializers
5
- class AutonomousSystemSerializer < ActiveModel::Serializer
6
- attributes :asn
7
- end
8
- end
9
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class DnsRecordSerializer < ActiveModel::Serializer
8
- attributes :resource, :value
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class GeolocationSerializer < ActiveModel::Serializer
8
- attributes :country, :country_code
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class ReverseDnsNameSerializer < ActiveModel::Serializer
8
- attributes :name
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class TagSerializer < ActiveModel::Serializer
8
- attributes :id, :name
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_model_serializers"
4
-
5
- module Mihari
6
- module Serializers
7
- class WhoisRecordSerializer < ActiveModel::Serializer
8
- attributes :domain, :created_on, :updated_on, :expires_on, :registrar, :contacts
9
- end
10
- end
11
- end