mihari 4.6.1 → 4.7.2
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/clients/otx.rb +36 -0
- data/lib/mihari/analyzers/otx.rb +19 -11
- data/lib/mihari/analyzers/rule.rb +17 -1
- data/lib/mihari/commands/init.rb +25 -2
- data/lib/mihari/commands/search.rb +2 -7
- data/lib/mihari/commands/validator.rb +10 -5
- data/lib/mihari/constants.rb +2 -0
- data/lib/mihari/enrichers/google_public_dns.rb +36 -0
- data/lib/mihari/enrichers/whois.rb +126 -0
- data/lib/mihari/errors.rb +2 -0
- data/lib/mihari/http.rb +2 -2
- data/lib/mihari/models/alert.rb +6 -1
- data/lib/mihari/models/artifact.rb +30 -0
- data/lib/mihari/models/dns.rb +5 -21
- data/lib/mihari/models/geolocation.rb +2 -4
- data/lib/mihari/models/port.rb +1 -1
- data/lib/mihari/models/rule.rb +7 -2
- data/lib/mihari/models/whois.rb +1 -96
- data/lib/mihari/schemas/enricher.rb +9 -0
- data/lib/mihari/schemas/rule.rb +6 -0
- data/lib/mihari/structs/filters.rb +71 -0
- data/lib/mihari/structs/google_public_dns.rb +42 -0
- data/lib/mihari/structs/ipinfo.rb +4 -4
- data/lib/mihari/structs/rule.rb +187 -137
- data/lib/mihari/types.rb +7 -0
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/endpoints/alerts.rb +1 -1
- data/lib/mihari/web/endpoints/rules.rb +13 -5
- data/lib/mihari/web/public/index.html +1 -1
- data/lib/mihari/web/public/redoc-static.html +796 -763
- data/lib/mihari/web/public/static/css/chunk-vendors.5013d549.css +7 -0
- data/lib/mihari/web/public/static/js/app.3ac3bd7a.js +2 -0
- data/lib/mihari/web/public/static/js/app.3ac3bd7a.js.map +1 -0
- data/lib/mihari/web/public/static/js/{chunk-vendors.dde2116c.js → chunk-vendors.37b7208e.js} +6 -6
- data/lib/mihari/web/public/static/js/chunk-vendors.37b7208e.js.map +1 -0
- data/lib/mihari.rb +4 -2
- data/mihari.gemspec +8 -9
- data/sig/lib/mihari/cli/base.rbs +0 -2
- data/sig/lib/mihari/enrichers/google_public_dns.rbs +18 -0
- data/sig/lib/mihari/models/alert.rbs +3 -3
- data/sig/lib/mihari/models/rule.rbs +2 -2
- data/sig/lib/mihari/structs/filters.rbs +40 -0
- data/sig/lib/mihari/structs/google_public_dns.rbs +21 -0
- data/sig/lib/mihari/structs/ipinfo.rbs +2 -2
- data/sig/lib/mihari/structs/rule.rbs +36 -43
- metadata +32 -45
- data/lib/mihari/mixins/rule.rb +0 -84
- data/lib/mihari/structs/alert.rb +0 -44
- data/lib/mihari/web/public/static/css/chunk-vendors.06251949.css +0 -7
- data/lib/mihari/web/public/static/js/app-legacy.9d5c9c3d.js +0 -2
- data/lib/mihari/web/public/static/js/app-legacy.9d5c9c3d.js.map +0 -1
- data/lib/mihari/web/public/static/js/app.823b5af7.js +0 -2
- data/lib/mihari/web/public/static/js/app.823b5af7.js.map +0 -1
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.b110c129.js +0 -25
- data/lib/mihari/web/public/static/js/chunk-vendors-legacy.b110c129.js.map +0 -1
- data/lib/mihari/web/public/static/js/chunk-vendors.dde2116c.js.map +0 -1
- data/sig/lib/mihari/mixins/rule.rbs +0 -36
- data/sig/lib/mihari/structs/alert.rbs +0 -27
@@ -36,7 +36,7 @@ module Mihari
|
|
36
36
|
# symbolize hash keys
|
37
37
|
filter = filter.to_h.symbolize_keys
|
38
38
|
|
39
|
-
search_filter_with_pagenation = Structs::Rule::SearchFilterWithPagination.new(**filter)
|
39
|
+
search_filter_with_pagenation = Structs::Filters::Rule::SearchFilterWithPagination.new(**filter)
|
40
40
|
rules = Mihari::Rule.search(search_filter_with_pagenation)
|
41
41
|
total = Mihari::Rule.count(search_filter_with_pagenation.without_pagination)
|
42
42
|
|
@@ -79,7 +79,7 @@ module Mihari
|
|
79
79
|
error!({ message: "ID:#{id} is not found" }, 404)
|
80
80
|
end
|
81
81
|
|
82
|
-
struct = Mihari::Structs::Rule
|
82
|
+
struct = Mihari::Structs::Rule.from_model(rule)
|
83
83
|
analyzer = struct.to_analyzer
|
84
84
|
analyzer.run
|
85
85
|
|
@@ -96,7 +96,12 @@ module Mihari
|
|
96
96
|
end
|
97
97
|
post "/" do
|
98
98
|
yaml = params[:yaml]
|
99
|
-
|
99
|
+
|
100
|
+
begin
|
101
|
+
rule = Structs::Rule.from_yaml(yaml)
|
102
|
+
rescue YAMLSyntaxError => e
|
103
|
+
error!({ message: e.message }, 400)
|
104
|
+
end
|
100
105
|
|
101
106
|
# check ID duplication
|
102
107
|
begin
|
@@ -144,8 +149,11 @@ module Mihari
|
|
144
149
|
error!({ message: "ID:#{id} is not found" }, 404)
|
145
150
|
end
|
146
151
|
|
147
|
-
|
148
|
-
|
152
|
+
begin
|
153
|
+
rule = Structs::Rule.from_yaml(yaml, id: id)
|
154
|
+
rescue YAMLSyntaxError => e
|
155
|
+
error!({ message: e.message }, 400)
|
156
|
+
end
|
149
157
|
|
150
158
|
begin
|
151
159
|
rule.validate!
|
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="/static/favicon.ico"/><title>Mihari</title><script defer="defer"
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="/static/favicon.ico"/><title>Mihari</title><script defer="defer" src="/static/js/chunk-vendors.37b7208e.js"></script><script defer="defer" src="/static/js/app.3ac3bd7a.js"></script><link href="/static/css/chunk-vendors.5013d549.css" rel="stylesheet"><link href="/static/css/app.2a5d3d21.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Mihari doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|