Commit graph

35 commits

Author SHA1 Message Date
Simone Mainardi
83f0c38937 Massive cleanup of old alerts code 2021-05-03 18:16:46 +02:00
gabryon99
15e601e797 edit stub REST endpoint (#5151) 2021-04-07 15:29:41 +02:00
gabryon99
d20b1e4739 implemented stub for the new alerts page 2021-04-07 12:53:07 +02:00
Luca
a4047c5a1c Implements flow callbacks and alerts in C++
Scaffolding code of the host scripts

Scaffolding code for host alerts

Adds host_callbacks/ for .cpp files

Implements all classes for host callbacks

Removes pro/enterprise host callbacks

Adds typedefs with callback deltas

Compilation fix

Creates instances of host callbacks in loader

Link fix

Removes redundant/non-necessary host alerts

Merges Scan and Flood callbacks together

Removes outdated API files

Refactors alert keys into entity|id

Refactors all flow alert_{...} into flow_alert_{...}

Refactors C++ flow alert_{...} into flow_alert_{...}

Reworks alert ids to include an entity type

Cleanup and merge alertTypeRaw with getAlertType

Minor fix

Refactors alert definitions and keys into sub directories

Implement host alert callback execution and trigger/release logic

Update callbacks API

Adds base CallbacksLoader for {Host,Flow}CallbacksLoader

Implements load of host user scripts with periodicities

Implements runtime reload of host callbacks

Add logic for periodic callbacks

Add 'expired' flag to host alerts

Implements execution of host callbacks and SYN flood checks

Adds triggerAlertAsync calls to SYNFlood

Implements JSON host alert generation info

Handle callback getPeriod. Optimize callback lookup.

Implements host recipients in C++

Add callback status

Define destructor

Iterator fixes

Cleanup host Lua calls (now performed in C++)

Changes to show new host alerts in SQLite

Adds release/engage action on alert JSON

Move AlertableEntity to OtherAlertableEntity, inheriting from a new AlertableEntity. Add HostAlertableEntity.

Implements SYN Flood Attacker with params

Uses parametrized thresholds to trigger syn flood alerts

Implements build alert of both attacker and victim

Implement HostAlertableEntity

Implements SYN scan attacker/victim alerts

Implements flow flood attacker/victim alerts

Removes a debug flag

Add virtual allocStatus

Add HostAlert disableAutoRelease()

Add Ãexplicit releaseAlert()

Implements SYNFloodHostCallbackStatus

Implements SYNScanHostCallbackStatus

Implements FlowFloodHostCallbackStatus

Change trigger API to handle cli/src score

Implements {DNS,SMTP,NTP}ServerContactsAlert

Reworks ServerContacts host alerts

Implement exclusion bitmaps for host alerts

Implements {SMTP,DNS,NTP}ServerContactsAlert

Adds host_info to the generated alert JSON

Minor cleanup

Optimize access to callback status

Move RepliesRequestsRatio to pro

Rework triggerAlert on host to avoid multiple call and unneeded status data

Compilation fix

Reworked host alerts API (wip)

Cleanup unused host callbacks

Compilation fixes

Finishes backend implementation of host alerts exclusions

Rework host callbacks executor

Implements disable of host alerts

Port SYNFlood to the new api

Cleanup

Reduce duplicated code

Comments

Port ServerContacts to the new api

Clenaup

Adds parsing of configuration for host callbacks

Port SYNScanAlert to the new API

Port FlowFlood to the new API

Cleanup unused HostAlert getName

Reworks DNSRequestsErrorsRatioAlert

Adds JSON for DNSTrafficAlert

Adds FlowsAlert

Adds P2PTrafficAlert

Add RepliesRequestsRatioAlert

Adds ScoreAlert

Adds ThroughputAlert

Adds TrafficAlert

Fixes for scan/flood alerts

DNS ratio alert support

Add HTTP stats getters

Implements deltas for many host callbacks

Host score inc

Adds missing Alert params to host alerts

Release all host alerts on idle

Refactors score classes

Implements class Score to contain scores for hosts, flows, etc

Adds scores to VLANs, Networks, ASes and Countries

Host callbacks can trigger a single alert now

FlowFlood, SYNFloo, SYNScan now inherit from FlowHits

Move severity and score to constructor

Add else branch to hits callbacks

Alert definition update for flows_flood, syn_flood, syn_scan

Update field name

Engaged alert init

Adds score incs/decs for AS, VLAN, country, os and network

Restore network scripts

Restored other alert definitions for floods

Handle decreasing alert score

Removes include

Rename flows_flood to flow_flood for consistency

Restored alert_tcp_syn_flood_victim alert_tcp_syn_scan_victim definitions

Fixes for non-host engaged/release alerts

Cleanup LuaEngineFlow and LuaEngineHost classes

Fixes old calls to host lua during shutdown

Removes AlertCheckLuaEngine instance

Fixes purging of flows

Fixes alerts release upon shutdown causing wrong uses

Removes a debug flag

Fix getNumEngagedAlerts

Cleanup unnecessary host callbacks

Removes array of callback statuses inside host

Bitmap fixes

Refactors Bitmap into Bitmap128

Implements 16-bits bitmaps for host alerts

Adds class HostCallbacksStatus

Moves callback status p2p and DNS inside HostCallbacksStatus

Removes unused callbacks in typedefs

Minor cleanup

Adds trigger/release for DNS/p2p alerts

Reworks UI of hosts user scripts

Rename HostCallbackType to HostCallbackID, getType to getID, others
2021-04-03 09:53:15 +02:00
Timotheus Bachinger
d34eba0f77
Fix table access in REST call (#5103)
... which resulted in alert conts key not beeing transmitted
2021-03-12 17:33:46 +01:00
Simone Mainardi
174cedcb95 extends get/alert/ts.lua to retrieve per-host counters 2021-03-02 09:03:05 +01:00
Simone Mainardi
4becc28029 Fixes alert ts shifted by 1-h due to Lua arrays indexed from 1
Fixes #5072
2021-03-01 12:58:19 +01:00
Matteo Biscosi
6a32b6ca6d Changed exclude alert path 2021-02-17 18:25:21 +01:00
Matteo Biscosi
8b890a4411 Implemented filter alert params check done in Ajax 2021-02-17 18:14:33 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Simone Mainardi
9e7340c16a Implements alerts export to file
Implements #4769
2020-12-31 14:01:18 +01:00
Simone Mainardi
b3dc39c641 Refactors alert_severities into an independend Lua module 2020-11-30 15:28:17 +01:00
Luca Deri
79280dac60 Fixes #4332 2020-11-02 18:52:58 +01:00
Alfredo Cardigliano
3b32c3acd4 Update REST examples 2020-08-28 16:41:40 +02:00
Alfredo Cardigliano
ba2e44ddc6 REST endpoints now return specific HTTP codes on failure (fix #4278) 2020-08-20 11:45:17 +02:00
Simone Mainardi
16db3cda67 Reworks REST API to return i18n success/error messages
Implements #4300
2020-08-17 19:18:16 +02:00
Simone Mainardi
1d22c3c232 Adjusts naming conventions for rest/v1/get/alert/type/counters.lua 2020-05-29 18:05:35 +02:00
Simone Mainardi
f780152f89 Adjusts naming conventions for rest/v1/get/alert/severity/counters.lua 2020-05-29 18:02:29 +02:00
Simone Mainardi
6ea0531be0 Adjusts types and severities returned by rest/v1/get/alert/data.lua 2020-05-29 17:52:55 +02:00
Alfredo Cardigliano
6eec119083 Return a standard json format for arrays 2020-05-29 12:47:22 +02:00
Alfredo Cardigliano
b56b14b534 Alert ts endpoint fixes 2020-05-29 11:20:45 +02:00
Simone Mainardi
8b85f0dd9e Implement getter for application constants
Implements #3944
2020-05-28 16:44:59 +02:00
Simone Mainardi
63628af5bd Simplifies getter for alert constants 2020-05-28 15:54:07 +02:00
Simone Mainardi
699ec1e2fb Implement getter for alert severity constants
Implements #3946
2020-05-28 15:51:39 +02:00
Alfredo Cardigliano
1674137782 Add rest/v1/get/flow/active.lua REST API (#3951) 2020-05-28 15:07:32 +02:00
Simone Mainardi
073a8c3dd1 Implement getter for alert constants
Implements #3946
2020-05-27 15:26:58 +02:00
Alfredo Cardigliano
3e5eca0ee5 Filter rest/v1/get/alert/data.lua based on epoch_begin/epoch_end/alert_type/alert_severity (#3952) 2020-05-27 12:53:28 +02:00
Alfredo Cardigliano
97046a8a97 Add rest/v1/get/alert/severity/counters.lua REST API 2020-05-27 11:05:59 +02:00
Alfredo Cardigliano
9814c91bfb Add filters to rest/v1/get/alert/type/counters.lua REST API 2020-05-27 10:53:07 +02:00
Alfredo Cardigliano
7c977a3ebc Add rest/v1/get/alert/type/counters.lua API REST (implement #3948) 2020-05-27 10:47:33 +02:00
Alfredo Cardigliano
21fe9aa490 Add v1/get/alert/ts.lua REST API (implement #3943 2020-05-26 12:28:33 +02:00
Alfredo Cardigliano
09ea665c9b Improve v1/get/alert/data.lua endpoint 2020-05-26 11:11:20 +02:00
Alfredo Cardigliano
e45ae9bf7a Add missing interface select 2020-05-20 13:04:00 +02:00
Alfredo Cardigliano
5a753d8727 Add v1/get/alert/data rest API, alert_consts optimization 2020-05-20 11:02:44 +02:00
Luca Deri
ccf76ca54d Added "real" intefaceId validation
Initial work towards REST API
2020-05-17 20:47:46 +02:00