mihari 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mihari/analyzers/binaryedge.rb +10 -1
- data/lib/mihari/analyzers/censys.rb +26 -1
- data/lib/mihari/analyzers/circl.rb +23 -1
- data/lib/mihari/analyzers/greynoise.rb +10 -1
- data/lib/mihari/analyzers/onyphe.rb +10 -1
- data/lib/mihari/analyzers/otx.rb +8 -2
- data/lib/mihari/analyzers/passivetotal.rb +25 -3
- data/lib/mihari/analyzers/pulsedive.rb +7 -1
- data/lib/mihari/analyzers/securitytrails.rb +7 -1
- data/lib/mihari/analyzers/shodan.rb +10 -1
- data/lib/mihari/analyzers/spyse.rb +10 -1
- data/lib/mihari/analyzers/urlscan.rb +6 -1
- data/lib/mihari/analyzers/virustotal.rb +7 -2
- data/lib/mihari/analyzers/virustotal_intelligence.rb +6 -1
- data/lib/mihari/analyzers/zoomeye.rb +16 -2
- data/lib/mihari/cli/main.rb +2 -0
- data/lib/mihari/commands/search.rb +14 -0
- data/lib/mihari/commands/version.rb +18 -0
- data/lib/mihari/database.rb +10 -2
- data/lib/mihari/emitters/misp.rb +14 -8
- data/lib/mihari/emitters/slack.rb +20 -28
- data/lib/mihari/emitters/the_hive.rb +18 -6
- data/lib/mihari/entities/rule.rb +1 -12
- data/lib/mihari/errors.rb +2 -0
- data/lib/mihari/mixins/configurable.rb +12 -1
- data/lib/mihari/mixins/rule.rb +16 -19
- data/lib/mihari/models/artifact.rb +7 -2
- data/lib/mihari/models/rule.rb +12 -3
- data/lib/mihari/schemas/analyzer.rb +89 -10
- data/lib/mihari/schemas/emitter.rb +35 -0
- data/lib/mihari/schemas/rule.rb +5 -62
- data/lib/mihari/structs/rule.rb +33 -5
- data/lib/mihari/types.rb +0 -25
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/endpoints/rules.rb +20 -3
- data/lib/mihari/web/public/index.html +1 -1
- data/lib/mihari/web/public/redoc-static.html +11 -11
- data/lib/mihari/web/public/static/css/app.de5845d8.css +1 -0
- data/lib/mihari/web/public/static/css/chunk-vendors.da2a7bfc.css +7 -0
- data/lib/mihari/web/public/static/js/app-legacy.f550d6ae.js +2 -0
- data/lib/mihari/web/public/static/js/app-legacy.f550d6ae.js.map +1 -0
- data/lib/mihari/web/public/static/js/app.40749592.js +2 -0
- data/lib/mihari/web/public/static/js/app.40749592.js.map +1 -0
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.d6b76c57.js +25 -0
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.d6b76c57.js.map +1 -0
- data/lib/mihari/web/public/static/js/chunk-vendors.3bdbaffb.js +31 -0
- data/lib/mihari/web/public/static/js/chunk-vendors.3bdbaffb.js.map +1 -0
- data/mihari.gemspec +2 -2
- data/sig/lib/mihari/analyzers/binaryedge.rbs +2 -0
- data/sig/lib/mihari/analyzers/censys.rbs +4 -0
- data/sig/lib/mihari/analyzers/circl.rbs +5 -1
- data/sig/lib/mihari/analyzers/onyphe.rbs +2 -0
- data/sig/lib/mihari/analyzers/otx.rbs +3 -1
- data/sig/lib/mihari/analyzers/passivetotal.rbs +5 -1
- data/sig/lib/mihari/analyzers/pulsedive.rbs +3 -1
- data/sig/lib/mihari/analyzers/securitytrails.rbs +3 -1
- data/sig/lib/mihari/analyzers/shodan.rbs +2 -0
- data/sig/lib/mihari/analyzers/spyse.rbs +3 -1
- data/sig/lib/mihari/analyzers/urlscan.rbs +2 -0
- data/sig/lib/mihari/analyzers/virustotal.rbs +3 -1
- data/sig/lib/mihari/analyzers/virustotal_intelligence.rbs +2 -0
- data/sig/lib/mihari/analyzers/zoomeye.rbs +3 -1
- data/sig/lib/mihari/emitters/misp.rbs +6 -0
- data/sig/lib/mihari/emitters/slack.rbs +8 -20
- data/sig/lib/mihari/emitters/the_hive.rbs +4 -0
- data/sig/lib/mihari/mixins/configurable.rbs +4 -0
- data/sig/lib/mihari/mixins/rule.rbs +2 -0
- data/sig/lib/mihari/models/rule.rbs +3 -0
- data/sig/lib/mihari/structs/rule.rbs +5 -1
- metadata +18 -6
data/mihari.gemspec
CHANGED
@@ -39,8 +39,8 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_development_dependency "rerun", "~> 0.13"
|
40
40
|
spec.add_development_dependency "rspec", "~> 3.11"
|
41
41
|
spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
|
42
|
-
spec.add_development_dependency "standard", "~> 1.
|
43
|
-
spec.add_development_dependency "steep", "~> 0.
|
42
|
+
spec.add_development_dependency "standard", "~> 1.9"
|
43
|
+
spec.add_development_dependency "steep", "~> 0.50"
|
44
44
|
spec.add_development_dependency "timecop", "~> 0.9"
|
45
45
|
spec.add_development_dependency "vcr", "~> 6.1"
|
46
46
|
spec.add_development_dependency "webmock", "~> 3.14"
|
@@ -3,10 +3,12 @@ module Mihari
|
|
3
3
|
class ZoomEye < Base
|
4
4
|
attr_reader query: String
|
5
5
|
|
6
|
-
attr_reader type: String
|
6
|
+
attr_reader type: String?
|
7
7
|
|
8
8
|
attr_reader interval: ::Integer
|
9
9
|
|
10
|
+
attr_reader api_key: String?
|
11
|
+
|
10
12
|
def artifacts: () -> (Array[String] | Array[Mihari::Artifact])
|
11
13
|
|
12
14
|
private
|
@@ -39,33 +39,25 @@ module Mihari
|
|
39
39
|
end
|
40
40
|
|
41
41
|
class Slack < Base
|
42
|
-
|
42
|
+
DEFAULT_CHANNEL: String
|
43
43
|
|
44
|
-
|
44
|
+
DEFAULT_USERNAME: String
|
45
45
|
|
46
|
-
|
46
|
+
# @return [String, nil]
|
47
|
+
attr_reader webhook_url: String?
|
47
48
|
|
48
|
-
#
|
49
|
-
# Slack channel to post
|
50
|
-
#
|
51
49
|
# @return [String]
|
52
|
-
|
53
|
-
def slack_channel: () -> String
|
50
|
+
attr_reader channel: String
|
54
51
|
|
55
|
-
#
|
56
|
-
# Slack webhook URL
|
57
|
-
#
|
58
52
|
# @return [String]
|
59
|
-
|
60
|
-
def slack_webhook_url: () -> String
|
53
|
+
attr_reader username: String
|
61
54
|
|
62
55
|
#
|
63
|
-
# Check
|
56
|
+
# Check webhook URL is set
|
64
57
|
#
|
65
58
|
# @return [Boolean]
|
66
59
|
#
|
67
|
-
def
|
68
|
-
|
60
|
+
def webhook_url?: () -> bool
|
69
61
|
|
70
62
|
def notifier: () -> ::Slack::Notifier
|
71
63
|
|
@@ -76,10 +68,6 @@ module Mihari
|
|
76
68
|
def to_text: (title: String title, description: String description, ?tags: Array[String] tags) -> String
|
77
69
|
|
78
70
|
def emit: (title: String title, description: String description, artifacts: Array[Mihari::Artifact] artifacts, ?tags: Array[String] tags, **untyped _options) -> void
|
79
|
-
|
80
|
-
private
|
81
|
-
|
82
|
-
def configuration_keys: () -> ::Array["slack_webhook_url"]
|
83
71
|
end
|
84
72
|
end
|
85
73
|
end
|
@@ -8,6 +8,8 @@ module Mihari
|
|
8
8
|
#
|
9
9
|
def configured?: () -> bool
|
10
10
|
|
11
|
+
private
|
12
|
+
|
11
13
|
#
|
12
14
|
# Configuration values
|
13
15
|
#
|
@@ -21,6 +23,8 @@ module Mihari
|
|
21
23
|
# @return [Array<String>] A list of cofiguration keys
|
22
24
|
#
|
23
25
|
def configuration_keys: () -> Array[String]
|
26
|
+
|
27
|
+
def api_key?: () -> bool
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -11,7 +11,9 @@ module Mihari
|
|
11
11
|
class Rule
|
12
12
|
attr_reader data: Hash
|
13
13
|
|
14
|
-
attr_reader
|
14
|
+
attr_reader yaml: String
|
15
|
+
|
16
|
+
attr_reader errors: Array[untypes]?
|
15
17
|
|
16
18
|
def initialize: (Hash data) -> void
|
17
19
|
|
@@ -54,6 +56,8 @@ module Mihari
|
|
54
56
|
def to_analyzer: () -> Mihari::Analyzers::Rule
|
55
57
|
|
56
58
|
def self.from_model: (Mihari::Rule model) -> Mihari::Structs::Rule::Rule
|
59
|
+
|
60
|
+
def self.from_yaml: (String yaml) -> Mihari::Structs::Rule::Rule
|
57
61
|
end
|
58
62
|
end
|
59
63
|
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: 4.
|
4
|
+
version: 4.4.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-03-
|
11
|
+
date: 2022-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -184,28 +184,28 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: '1.
|
187
|
+
version: '1.9'
|
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.
|
194
|
+
version: '1.9'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: steep
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0.
|
201
|
+
version: '0.50'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0.
|
208
|
+
version: '0.50'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: timecop
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1126,6 +1126,7 @@ files:
|
|
1126
1126
|
- lib/mihari/commands/init.rb
|
1127
1127
|
- lib/mihari/commands/search.rb
|
1128
1128
|
- lib/mihari/commands/validator.rb
|
1129
|
+
- lib/mihari/commands/version.rb
|
1129
1130
|
- lib/mihari/commands/web.rb
|
1130
1131
|
- lib/mihari/constants.rb
|
1131
1132
|
- lib/mihari/database.rb
|
@@ -1175,6 +1176,7 @@ files:
|
|
1175
1176
|
- lib/mihari/models/tagging.rb
|
1176
1177
|
- lib/mihari/models/whois.rb
|
1177
1178
|
- lib/mihari/schemas/analyzer.rb
|
1179
|
+
- lib/mihari/schemas/emitter.rb
|
1178
1180
|
- lib/mihari/schemas/macros.rb
|
1179
1181
|
- lib/mihari/schemas/rule.rb
|
1180
1182
|
- lib/mihari/status.rb
|
@@ -1207,8 +1209,10 @@ files:
|
|
1207
1209
|
- lib/mihari/web/public/redoc-static.html
|
1208
1210
|
- lib/mihari/web/public/static/css/app.0de4b715.css
|
1209
1211
|
- lib/mihari/web/public/static/css/app.43138058.css
|
1212
|
+
- lib/mihari/web/public/static/css/app.de5845d8.css
|
1210
1213
|
- lib/mihari/web/public/static/css/chunk-vendors.3ed9b08e.css
|
1211
1214
|
- lib/mihari/web/public/static/css/chunk-vendors.c57bb3fd.css
|
1215
|
+
- lib/mihari/web/public/static/css/chunk-vendors.da2a7bfc.css
|
1212
1216
|
- lib/mihari/web/public/static/favicon.ico
|
1213
1217
|
- lib/mihari/web/public/static/fonts/fa-brands-400.099a9556.woff
|
1214
1218
|
- lib/mihari/web/public/static/fonts/fa-brands-400.1a575a41.woff
|
@@ -1258,6 +1262,8 @@ files:
|
|
1258
1262
|
- lib/mihari/web/public/static/js/app-legacy.46b666f0.js.map
|
1259
1263
|
- lib/mihari/web/public/static/js/app-legacy.e451304b.js
|
1260
1264
|
- lib/mihari/web/public/static/js/app-legacy.e451304b.js.map
|
1265
|
+
- lib/mihari/web/public/static/js/app-legacy.f550d6ae.js
|
1266
|
+
- lib/mihari/web/public/static/js/app-legacy.f550d6ae.js.map
|
1261
1267
|
- lib/mihari/web/public/static/js/app.06d5cf1c.js
|
1262
1268
|
- lib/mihari/web/public/static/js/app.06d5cf1c.js.map
|
1263
1269
|
- lib/mihari/web/public/static/js/app.0a0cc502.js
|
@@ -1268,6 +1274,8 @@ files:
|
|
1268
1274
|
- lib/mihari/web/public/static/js/app.365f1907.js.map
|
1269
1275
|
- lib/mihari/web/public/static/js/app.378da3dc.js
|
1270
1276
|
- lib/mihari/web/public/static/js/app.378da3dc.js.map
|
1277
|
+
- lib/mihari/web/public/static/js/app.40749592.js
|
1278
|
+
- lib/mihari/web/public/static/js/app.40749592.js.map
|
1271
1279
|
- lib/mihari/web/public/static/js/app.4818aedd.js
|
1272
1280
|
- lib/mihari/web/public/static/js/app.4818aedd.js.map
|
1273
1281
|
- lib/mihari/web/public/static/js/app.49ab738a.js
|
@@ -1302,8 +1310,12 @@ files:
|
|
1302
1310
|
- lib/mihari/web/public/static/js/chunk-vendors-legacy.41357cdf.js.map
|
1303
1311
|
- lib/mihari/web/public/static/js/chunk-vendors-legacy.c99e452e.js
|
1304
1312
|
- lib/mihari/web/public/static/js/chunk-vendors-legacy.c99e452e.js.map
|
1313
|
+
- lib/mihari/web/public/static/js/chunk-vendors-legacy.d6b76c57.js
|
1314
|
+
- lib/mihari/web/public/static/js/chunk-vendors-legacy.d6b76c57.js.map
|
1305
1315
|
- lib/mihari/web/public/static/js/chunk-vendors.15e84e22.js
|
1306
1316
|
- lib/mihari/web/public/static/js/chunk-vendors.15e84e22.js.map
|
1317
|
+
- lib/mihari/web/public/static/js/chunk-vendors.3bdbaffb.js
|
1318
|
+
- lib/mihari/web/public/static/js/chunk-vendors.3bdbaffb.js.map
|
1307
1319
|
- lib/mihari/web/public/static/js/chunk-vendors.c5525f1e.js
|
1308
1320
|
- lib/mihari/web/public/static/js/chunk-vendors.c5525f1e.js.map
|
1309
1321
|
- mihari.gemspec
|