mihari 3.8.1 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mihari.rb CHANGED
@@ -108,6 +108,7 @@ require "mihari/constants"
108
108
  require "mihari/types"
109
109
 
110
110
  # Structs
111
+ require "mihari/structs/alert"
111
112
  require "mihari/structs/censys"
112
113
  require "mihari/structs/ipinfo"
113
114
  require "mihari/structs/onyphe"
data/mihari.gemspec CHANGED
@@ -76,7 +76,7 @@ Gem::Specification.new do |spec|
76
76
  spec.add_dependency "passivetotalx", "~> 0.1"
77
77
  spec.add_dependency "public_suffix", "~> 4.0"
78
78
  spec.add_dependency "pulsedive", "~> 0.1"
79
- spec.add_dependency "puma", "~> 5.4"
79
+ spec.add_dependency "puma", "~> 5.5"
80
80
  spec.add_dependency "rack", "~> 2.2"
81
81
  spec.add_dependency "rack-contrib", "~> 2.3"
82
82
  spec.add_dependency "safe_shell", "~> 1.1"
@@ -21,7 +21,7 @@ module Mihari
21
21
  #
22
22
  # @return [Array<Mihari::Artifact>]
23
23
  #
24
- def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
24
+ def artifacts: () -> (Array[Mihari::Artifact])
25
25
 
26
26
  #
27
27
  # Normalize artifacts
@@ -7,40 +7,12 @@ module Mihari
7
7
  attr_accessor artifacts(): Array[Mihari::Artifact]
8
8
  attr_accessor Tags(): Array[Mihari::Tag]
9
9
 
10
- #
11
- # Search alerts
12
- #
13
- # @param [String, nil] artifact_data
14
- # @param [String, nil] description
15
- # @param [String, nil] source
16
- # @param [String, nil] tag_name
17
- # @param [String, nil] title
18
- # @param [DateTime, nil] from_at
19
- # @param [DateTime, nil] to_at
20
- # @param [Integer, nil] limit
21
- # @param [Integer, nil] page
22
- #
23
- # @return [Array<Hash>]
24
- #
25
- def self.search: (?artifact_data: String? artifact_data, ?description: String? description, ?source: String? source, ?tag_name: String? tag_name, ?title: String? title, ?from_at: DateTime? from_at, ?to_at: DateTime? to_at, ?limit: ::Integer limit, ?page: ::Integer page) -> Array[Hash[(String | Symbol), untyped]]
10
+ def self.search: (Mihari::Structs::Alert::SearchFilterWithPagination filter) -> Array[Hash[(String | Symbol), untyped]]
26
11
 
27
- #
28
- # Count alerts
29
- #
30
- # @param [String, nil] artifact_data
31
- # @param [String, nil] description
32
- # @param [String, nil] source
33
- # @param [String, nil] tag_name
34
- # @param [String, nil] title
35
- # @param [DateTime, nil] from_at
36
- # @param [DateTime, nil] to_at
37
- #
38
- # @return [Integer]
39
- #
40
- def self.count: (?artifact_data: String? artifact_data, ?description: String? description, ?source: String? source, ?tag_name: String? tag_name, ?title: String? title, ?from_at: DateTime? from_at, ?to_at: DateTime? to_at) -> Integer
12
+ def self.count: (Mihari::Structs::Alert::SearchFilter filter) -> Integer
41
13
 
42
14
  private
43
15
 
44
- def self.build_relation: (?artifact_data: String? artifact_data, ?title: String? title, ?description: String? description, ?source: String? source, ?tag_name: String? tag_name, ?from_at: DateTime? from_at, ?to_at: DateTime? to_at) -> Mihari::Alert
16
+ def self.build_relation: (Mihari::Structs::Alert::SearchFilter filter) -> Mihari::Alert
45
17
  end
46
18
  end
@@ -0,0 +1,27 @@
1
+ module Mihari
2
+ module Structs
3
+ module Alert
4
+ class SearchFilter
5
+ attr_reader artifact_data: String?
6
+ attr_reader description: String?
7
+ attr_reader source: String?
8
+ attr_reader tag_name: String?
9
+ attr_reader title: String?
10
+ attr_reader from_at: DateTime?
11
+ attr_reader to_at: DateTime?
12
+ attr_reader asn: Integer?
13
+ attr_reader dns_record: String?
14
+ attr_reader reverse_dns_name: String?
15
+
16
+ def has_valid_artifact_filters: () -> bool
17
+ end
18
+
19
+ class SearchFilterWithPagination
20
+ attr_reader page: Integer
21
+ attr_reader limit: Integer
22
+
23
+ def without_pagination: () -> Mihari::Structs::Alert::SearchFilter
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,5 @@
1
1
  module Mihari
2
2
  class App # < Sinatra::Base
3
- def self.run!: (?port: ::Integer port, ?host: ::String host) -> void
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.8.1
4
+ version: 3.9.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: 2021-09-19 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -716,14 +716,14 @@ dependencies:
716
716
  requirements:
717
717
  - - "~>"
718
718
  - !ruby/object:Gem::Version
719
- version: '5.4'
719
+ version: '5.5'
720
720
  type: :runtime
721
721
  prerelease: false
722
722
  version_requirements: !ruby/object:Gem::Requirement
723
723
  requirements:
724
724
  - - "~>"
725
725
  - !ruby/object:Gem::Version
726
- version: '5.4'
726
+ version: '5.5'
727
727
  - !ruby/object:Gem::Dependency
728
728
  name: rack
729
729
  requirement: !ruby/object:Gem::Requirement
@@ -1121,6 +1121,7 @@ files:
1121
1121
  - lib/mihari/serializers/tag.rb
1122
1122
  - lib/mihari/serializers/whois.rb
1123
1123
  - lib/mihari/status.rb
1124
+ - lib/mihari/structs/alert.rb
1124
1125
  - lib/mihari/structs/censys.rb
1125
1126
  - lib/mihari/structs/ipinfo.rb
1126
1127
  - lib/mihari/structs/onyphe.rb
@@ -1178,6 +1179,8 @@ files:
1178
1179
  - lib/mihari/web/public/static/js/app.06d5cf1c.js.map
1179
1180
  - lib/mihari/web/public/static/js/app.365f1907.js
1180
1181
  - lib/mihari/web/public/static/js/app.365f1907.js.map
1182
+ - lib/mihari/web/public/static/js/app.378da3dc.js
1183
+ - lib/mihari/web/public/static/js/app.378da3dc.js.map
1181
1184
  - lib/mihari/web/public/static/js/app.8e3e5150.js
1182
1185
  - lib/mihari/web/public/static/js/app.8e3e5150.js.map
1183
1186
  - lib/mihari/web/public/static/js/app.a862ebca.js
@@ -1271,6 +1274,7 @@ files:
1271
1274
  - sig/lib/mihari/notifiers/exception_notifier.rbs
1272
1275
  - sig/lib/mihari/notifiers/slack.rbs
1273
1276
  - sig/lib/mihari/status.rbs
1277
+ - sig/lib/mihari/structs/alert.rbs
1274
1278
  - sig/lib/mihari/structs/censys.rbs
1275
1279
  - sig/lib/mihari/structs/ipinfo.rbs
1276
1280
  - sig/lib/mihari/structs/onyphe.rbs