Class: FIDIUS::PreludeDB::Alert
- Inherits:
-
Connection
- Object
- ActiveRecord::Base
- Connection
- FIDIUS::PreludeDB::Alert
- Defined in:
- lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb
Overview
Wrapper for Prelude_Alert table
Class Method Summary collapse
-
.total_entries ⇒ Object
def self.table_name “Prelude_Alert” end.
Instance Method Summary collapse
Class Method Details
.total_entries ⇒ Object
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_ip ⇒ Object
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_data ⇒ Object
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 |
#severity ⇒ Object
38 39 40 |
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 38 def severity return impact.severity end |
#source_ip ⇒ Object
30 31 32 |
# File 'lib/evasion-db/idmef-fetchers/prelude-db/lib/models/alert.rb', line 30 def source_ip source_address.address end |