Commit graph

178 commits

Author SHA1 Message Date
Alfredo Cardigliano
c5ca72c6ba Add alert_ngi_trust_event alerts 2021-04-07 13:07:38 +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
Matteo Biscosi
b7fe7573bc Changed unexpected host behaviour titles 2021-03-24 17:16:59 +01:00
Matteo Biscosi
78aedbcebe Reworked unexpected host behaviour alert
Implements #5128
2021-03-24 15:38:43 +01:00
Matteo Biscosi
899f852f8e Renamed unexpected behaviour alert params 2021-03-23 19:19:50 +01:00
Matteo Biscosi
60e70f003c Fixes host behaviour alert 2021-03-23 18:42:33 +01:00
Simone Mainardi
1f08d942e0 Checks on stateful alerts to avoid creating unnecessary alert instances 2021-03-22 15:39:12 +01:00
Simone Mainardi
aea9138bfb Implements flow callbacks and alerts in C++ 2021-03-22 09:51:36 +01:00
Alfredo Cardigliano
fa311e3ade Rework user script working sets (a single configset is supported now) 2021-03-01 15:37:45 +01:00
Simone Mainardi
e369aa0a85 Implements alert filters for all engaged alerts 2021-02-24 10:29:59 +01:00
Simone Mainardi
696bcb33e5 Implements alert exclusions for hosts, interfaces, local networks 2021-02-23 15:36:14 +01:00
Matteo Biscosi
5e7cafd8f7 Removed threshold not nil check
Error due to the fact that an old user script configuration was in use
2021-02-22 10:23:05 +01:00
Matteo Biscosi
69ebe4e1a6 Temporary fix for threshold value to nil 2021-02-21 17:51:30 +01:00
Matteo Biscosi
d3853aaf90 Implements internet resources misuse script with exception list
Implements #4984
2021-02-04 15:10:52 +01:00
Matteo Biscosi
10fb8bbecc Implements #4919 custom alert severity 2021-01-27 12:29:19 +01:00
Simone Mainardi
81360d3a85 Reworks release of all triggered alerts
Fixes #4884
Fixes #4883
2021-01-04 18:10:14 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Matteo Biscosi
e94f2cb0b4 Fixed #4737 integration with fail2ban 2020-12-30 11:46:10 +01:00
Alfredo Cardigliano
6f8809954d Safety check and tracing in get_alert_triggered_key 2020-12-29 14:57:41 +01:00
Simone Mainardi
9e5c153b7f Fixes remote-to-remote alerts (leaves flow r2r alerts) 2020-12-24 10:59:51 +01:00
Matteo Biscosi
bcf2c2c1ed Migrates alerts to an object-oriented implementation 2020-12-22 14:48:00 +01:00
matteo
e24ef4ef35 Revert "Migrates alerts to an object-oriented implementation"
This reverts commit fbc283f12f.
2020-12-22 13:13:57 +01:00
matteo
fbc283f12f Migrates alerts to an object-oriented implementation 2020-12-22 13:00:25 +01:00
Alfredo Cardigliano
da62df2b73 Remove useless check to avoid misleading warnings 2020-12-18 14:25:25 +01:00
Simone Mainardi
b3dc39c641 Refactors alert_severities into an independend Lua module 2020-11-30 15:28:17 +01:00
Matteo Biscosi
0858d1bb79
Fixes alert_generation nil value 2020-11-30 10:55:12 +01:00
gabryon99
15772bd0fe refactor for endpoints and recipients (#4707) 2020-11-25 16:25:55 +01:00
Matteo Biscosi
507583db64
Added host category to flow and host alerts (#4767)
* Fixed shell endpoint bug and added notice when executing the script

* Added victim and attacker to security plugins

* Updated hosts alert with host_category info

* Added host category to hosts alert description

* Added host category to flows

Co-authored-by: matteo <biscosi@ntop.org>
2020-11-20 19:14:07 +01:00
Simone Mainardi
566babf34c Adds min host info to all host-alerts (engaged/released/triggered) 2020-11-19 17:11:18 +01:00
Simone Mainardi
93920ccdce Implements example of simplified flow alerts 2020-11-10 15:10:54 +01:00
Simone Mainardi
4ffe97f3b0 Lateral movement alert entity fixes 2020-10-12 09:22:08 +02:00
Luca Deri
c5e0db54b7 Added support for lateral movement detection 2020-10-11 18:30:21 +02:00
Simone Mainardi
dac9b41a98 Additional alerts cleanup
Fixes #4504
2020-10-01 18:45:57 +02:00
Simone Mainardi
b7bdd1edaf Massive cleanup of alerts (disabled/suppressed)
Fixes #4504
2020-10-01 18:40:11 +02:00
Simone Mainardi
6c1280a8e5 Reworks recipients.lua as static rather than (useless) instance 2020-09-23 15:03:07 +02:00
Luca Deri
8db941c31e Improved IEC 104 plugin 2020-09-16 23:24:40 +02:00
Simone Mainardi
b7341506f7 Implements checks for script type and alert severity in dispatch_notification 2020-09-16 13:08:07 +02:00
Simone Mainardi
1a8552549b Removes unused old notification_recipients module 2020-09-10 18:10:23 +02:00
Simone Mainardi
9e99fa1403 Uses new in-memory queues for alert recipients (avoid Redis) 2020-09-08 18:36:18 +02:00
Simone Mainardi
85f555a908 Removes intermediate alert queues - only leaves recipient queues
Implements #4366
2020-09-04 17:41:55 +02:00
Simone Mainardi
1a7ee97334 Reworks builtin SQLite alerts as a regular alert recipient 2020-09-04 10:33:10 +02:00
Simone Mainardi
6053c752f6 Avoids resending notifications for triggered alerts after restarts
Implements #4357
2020-09-03 09:58:46 +02:00
Simone Mainardi
a0097167f4 Fixes active monitoring alerts 2020-09-01 23:03:11 +02:00
Simone Mainardi
230d40abf9 Fixes addition of active monitoring hosts - circular require
Fixes #4345
2020-08-31 19:02:11 +02:00
Simone Mainardi
34b53b8a9b Adds documentation for OO recipients and operator functions 2020-08-28 18:57:59 +02:00
Simone Mainardi
fa00119b56 Adds operator function to evaluate threshold-based alerts 2020-08-28 17:04:25 +02:00
Simone Mainardi
aeecbcce29 Initial implementation of OO recipients with SQLite 2020-08-28 13:19:58 +02:00
Luca Deri
398e25c022 Disabled log 2020-08-17 18:24:05 +02:00
Alfredo Cardigliano
d55e4dc441 Remove alert_endpoints_utils (no longer required). Doc update. 2020-07-28 12:49:06 +02:00
Alfredo Cardigliano
7ffb4df9a6 Handle host pool serialization (exception for backward compatibility).
Fix recipients add
Initial work for alerts dispatching to recipients
2020-07-23 06:22:17 +02:00