Class: FIDIUS::PreludeDB::Alert

Inherits:
Connection
  • Object
show all
Defined in:
lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb

Overview

Wrapper for Prelude_Alert table

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.total_entriesObject

def self.table_name

"Prelude_Alert"

end



22
23
24
25
26
27
28
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 22

def self.total_entries
  sql = connection();
 sql.begin_db_transaction
 value = sql.execute("SELECT count(*) FROM Prelude_Alert;").fetch_row;
 sql.commit_db_transaction
 value[0].to_i;
end

Instance Method Details

#dest_ipObject



34
35
36
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 34

def dest_ip
   dest_address.address
end

#payload_dataObject



42
43
44
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 42

def payload_data
  payload.data if payload != nil
end

#severityObject



38
39
40
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 38

def severity
  return impact.severity
end

#source_ipObject



30
31
32
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 30

def source_ip
  source_address.address
end