Class: Mihari::Emitters::Attachment

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Includes:
Memist::Memoizable
Defined in:
lib/mihari/emitters/slack.rb

Instance Method Summary collapse

Instance Method Details

#actionsObject



16
17
18
# File 'lib/mihari/emitters/slack.rb', line 16

def actions
  [vt_link, urlscan_link, censys_link, shodan_link].compact
end


32
33
34
35
36
# File 'lib/mihari/emitters/slack.rb', line 32

def censys_link
  return nil unless _censys_link

  { type: "button", text: "Censys", url: _censys_link }
end


38
39
40
41
42
# File 'lib/mihari/emitters/slack.rb', line 38

def shodan_link
  return nil unless _shodan_link

  { type: "button", text: "Shodan", url: _shodan_link }
end

#to_aArray

Returns:

  • (Array)


45
46
47
48
49
50
51
52
53
# File 'lib/mihari/emitters/slack.rb', line 45

def to_a
  [
    {
      text: defanged_data,
      fallback: "VT & urlscan.io links",
      actions: actions
    }
  ]
end


26
27
28
29
30
# File 'lib/mihari/emitters/slack.rb', line 26

def urlscan_link
  return nil unless _urlscan_link

  { type: "button", text: "urlscan.io", url: _urlscan_link }
end


20
21
22
23
24
# File 'lib/mihari/emitters/slack.rb', line 20

def vt_link
  return nil unless _vt_link

  { type: "button", text: "VirusTotal", url: _vt_link }
end