Class: Mihari::Analyzers::CIRCL
Overview
CIRCL passive DNS/SSL analyzer
Constant Summary
Concerns::Retriable::DEFAULT_CONDITION, Concerns::Retriable::RETRIABLE_ERRORS
Instance Attribute Summary collapse
Attributes inherited from Base
#query
#options
Class Method Summary
collapse
Instance Method Summary
collapse
#refang
Methods inherited from Base
#call, from_query, #ignore_error?, inherited, #normalized_artifacts, #pagination_interval, #pagination_limit, #parallel?, #result, #truncated_query
#call, key, key_aliases, keys, #result, #retry_exponential_backoff, #retry_interval, #retry_times, #timeout, type, #validate_configuration!
#retry_on_error
#configuration_keys?
Constructor Details
#initialize(query, options: nil, username: nil, password: nil) ⇒ CIRCL
26
27
28
29
30
31
32
33
|
# File 'lib/mihari/analyzers/circl.rb', line 26
def initialize(query, options: nil, username: nil, password: nil)
super(refang(query), options: options)
@type = DataType.type(query)
@username = username || Mihari.config.circl_passive_username
@password = password || Mihari.config.circl_passive_password
end
|
Instance Attribute Details
#password ⇒ String?
18
19
20
|
# File 'lib/mihari/analyzers/circl.rb', line 18
def password
@password
end
|
#type ⇒ String?
12
13
14
|
# File 'lib/mihari/analyzers/circl.rb', line 12
def type
@type
end
|
#username ⇒ String?
15
16
17
|
# File 'lib/mihari/analyzers/circl.rb', line 15
def username
@username
end
|
Class Method Details
.configuration_keys ⇒ Object
51
52
53
|
# File 'lib/mihari/analyzers/circl.rb', line 51
def configuration_keys
%w[circl_passive_password circl_passive_username]
end
|
Instance Method Details
#artifacts ⇒ Object
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/mihari/analyzers/circl.rb', line 35
def artifacts
case type
when "domain"
client.passive_dns_search query
when "hash"
client.passive_ssl_search query
else
raise ValueError, "#{@query}(type: #{@type || "unknown"}) is not supported."
end
end
|
46
47
48
|
# File 'lib/mihari/analyzers/circl.rb', line 46
def configured?
configuration_keys? || (username? && password?)
end
|