Class: Mihari::Analyzers::Crtsh

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #run, #run_emitter

Methods included from Retriable

#retry_on_error

Methods included from Configurable

#config_keys, #configuration_status, #configured?

Constructor Details

#initialize(query, title: nil, description: nil, tags: []) ⇒ Crtsh

Returns a new instance of Crtsh.



13
14
15
16
17
18
19
20
# File 'lib/mihari/analyzers/crtsh.rb', line 13

def initialize(query, title: nil, description: nil, tags: [])
  super()

  @query = query
  @title = title || "crt.sh lookup"
  @description = description || "query = #{query}"
  @tags = tags
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



9
10
11
# File 'lib/mihari/analyzers/crtsh.rb', line 9

def description
  @description
end

#queryObject (readonly)

Returns the value of attribute query.



10
11
12
# File 'lib/mihari/analyzers/crtsh.rb', line 10

def query
  @query
end

#tagsObject (readonly)

Returns the value of attribute tags.



11
12
13
# File 'lib/mihari/analyzers/crtsh.rb', line 11

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/mihari/analyzers/crtsh.rb', line 8

def title
  @title
end

Instance Method Details

#artifactsObject



22
23
24
25
# File 'lib/mihari/analyzers/crtsh.rb', line 22

def artifacts
  results = search
  results.map { |result| result.dig("name_value") }.compact.uniq
end