Class: Mihari::Emitters::Attachment
- Inherits:
-
Object
- Object
- Mihari::Emitters::Attachment
- Includes:
- MemoWise
- Defined in:
- lib/mihari/emitters/slack.rb
Instance Attribute Summary collapse
- #data ⇒ String readonly
- #data_type ⇒ String readonly
Instance Method Summary collapse
- #actions ⇒ Object
- #censys_link ⇒ Object
-
#initialize(data:, data_type:) ⇒ Attachment
constructor
A new instance of Attachment.
- #shodan_link ⇒ Object
- #to_a ⇒ Array
- #urlscan_link ⇒ Object
- #vt_link ⇒ Object
Constructor Details
#initialize(data:, data_type:) ⇒ Attachment
Returns a new instance of Attachment.
21 22 23 24 |
# File 'lib/mihari/emitters/slack.rb', line 21 def initialize(data:, data_type:) @data = data @data_type = data_type end |
Instance Attribute Details
#data ⇒ String (readonly)
12 13 14 |
# File 'lib/mihari/emitters/slack.rb', line 12 def data @data end |
#data_type ⇒ String (readonly)
15 16 17 |
# File 'lib/mihari/emitters/slack.rb', line 15 def data_type @data_type end |
Instance Method Details
#actions ⇒ Object
26 27 28 |
# File 'lib/mihari/emitters/slack.rb', line 26 def actions [vt_link, urlscan_link, censys_link, shodan_link].compact end |
#censys_link ⇒ Object
42 43 44 45 46 |
# File 'lib/mihari/emitters/slack.rb', line 42 def censys_link return nil unless _censys_link {type: "button", text: "Censys", url: _censys_link} end |
#shodan_link ⇒ Object
48 49 50 51 52 |
# File 'lib/mihari/emitters/slack.rb', line 48 def shodan_link return nil unless _shodan_link {type: "button", text: "Shodan", url: _shodan_link} end |
#to_a ⇒ Array
55 56 57 58 59 60 61 62 63 |
# File 'lib/mihari/emitters/slack.rb', line 55 def to_a [ { text: defanged_data, fallback: "VT & urlscan.io links", actions: } ] end |
#urlscan_link ⇒ Object
36 37 38 39 40 |
# File 'lib/mihari/emitters/slack.rb', line 36 def urlscan_link return nil unless _urlscan_link {type: "button", text: "urlscan.io", url: _urlscan_link} end |
#vt_link ⇒ Object
30 31 32 33 34 |
# File 'lib/mihari/emitters/slack.rb', line 30 def vt_link return nil unless _vt_link {type: "button", text: "VirusTotal", url: _vt_link} end |