Class: Threatinator::Event

Inherits:
Model::Base show all
Defined in:
lib/threatinator/event.rb

Constant Summary collapse

VALID_TYPES =
Set.new([:c2, :attacker, :malware_host, :spamming, :scanning, :phishing])

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model::Base

#validate!

Constructor Details

#initialize(opts = {}) ⇒ Event

Returns a new instance of Event.

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :feed_provider (String)

    The name of the feed provider

  • :feed_name (String)

    The name of the feed

  • :type (Symbol)

    The ‘type’ of feed.

  • :ipv4s (#each)

    A collection of ipv4s

  • :fqdns (#each)

    A collection of FQDNs

  • :urls (#each)

    A collection of Urls



28
29
30
31
32
33
34
35
36
# File 'lib/threatinator/event.rb', line 28

def initialize(opts = {})
  @feed_provider = opts[:feed_provider]
  @feed_name = opts[:feed_name]
  @type = opts[:type]
  @ipv4s = Threatinator::Model::Observables::Ipv4Collection.new(opts[:ipv4s] || [])
  @fqdns = Threatinator::Model::Observables::FqdnCollection.new(opts[:fqdns] || [])
  @urls = Threatinator::Model::Observables::UrlCollection.new(opts[:urls] || [])
  super()
end

Instance Attribute Details

#feed_nameObject (readonly)

Returns the value of attribute feed_name.



11
12
13
# File 'lib/threatinator/event.rb', line 11

def feed_name
  @feed_name
end

#feed_providerObject (readonly)

Returns the value of attribute feed_provider.



11
12
13
# File 'lib/threatinator/event.rb', line 11

def feed_provider
  @feed_provider
end

#fqdnsObject (readonly)

Returns the value of attribute fqdns.



11
12
13
# File 'lib/threatinator/event.rb', line 11

def fqdns
  @fqdns
end

#ipv4sObject (readonly)

Returns the value of attribute ipv4s.



11
12
13
# File 'lib/threatinator/event.rb', line 11

def ipv4s
  @ipv4s
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/threatinator/event.rb', line 11

def type
  @type
end

#urlsObject (readonly)

Returns the value of attribute urls.



11
12
13
# File 'lib/threatinator/event.rb', line 11

def urls
  @urls
end