Class: Mihari::Analyzers::Censys

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/analyzers/censys.rb

Constant Summary

Constants included from Mixins::Retriable

Mixins::Retriable::DEFAULT_ON

Instance Attribute Summary collapse

Attributes inherited from Base

#rule

Instance Method Summary collapse

Methods inherited from Base

inherited, #normalized_artifacts, #run, #run_emitter, #source

Methods included from Mixins::Retriable

#retry_on_error

Methods included from Mixins::Configurable

#configuration_values

Methods included from Mixins::AutonomousSystem

#normalize_asn

Constructor Details

#initialize(*args, **kwargs) ⇒ Censys



18
19
20
21
22
23
# File 'lib/mihari/analyzers/censys.rb', line 18

def initialize(*args, **kwargs)
  super(*args, **kwargs)

  @id = kwargs[:id] || Mihari.config.censys_id
  @secret = kwargs[:secret] || Mihari.config.censys_secret
end

Instance Attribute Details

#idString? (readonly)



13
14
15
# File 'lib/mihari/analyzers/censys.rb', line 13

def id
  @id
end

#secretString? (readonly)



16
17
18
# File 'lib/mihari/analyzers/censys.rb', line 16

def secret
  @secret
end

Instance Method Details

#artifactsObject



25
26
27
# File 'lib/mihari/analyzers/censys.rb', line 25

def artifacts
  search
end

#configured?Boolean



29
30
31
# File 'lib/mihari/analyzers/censys.rb', line 29

def configured?
  configuration_keys.all? { |key| Mihari.config.send(key) } || (id? && secret?)
end