Commit graph

785 commits

Author SHA1 Message Date
Simone Mainardi
e53aef06da Fixes nEdge startup 2021-08-17 13:58:17 +02:00
Simone Mainardi
3ada168fb7 Fixes engaged/dropped alert timeseries wrongly typed
Partially addresses #5678
2021-07-14 12:53:55 +02:00
Alfredo Cardigliano
4955ed4757 Fix housekeeping script failure in nEdge 2021-07-13 14:44:21 +02:00
Alfredo Cardigliano
f02986dff5 Add missing require 2021-07-09 16:01:15 +02:00
Alfredo Cardigliano
bb297048c7 Add connectivity check at startup. If offline, check hourly. 2021-07-09 15:45:04 +02:00
Simone Mainardi
2e8a6de0fc Major terminology unification (user scripts -> checks) 2021-06-17 12:39:43 +02:00
Simone Mainardi
4a526c3cdf Decouples checks from alerts (removes unnecessary flag is_alert) 2021-06-17 11:43:12 +02:00
Simone Mainardi
76fd315d1b Refactors user_scripts into checks (lua) 2021-06-16 18:02:22 +02:00
Luca Deri
4c27f6f98c Implemented handlig of hello message from nprobe 2021-05-28 19:34:11 +02:00
Matteo Biscosi
abd51d295f Changed nProbe policy push 2021-05-27 15:00:55 +02:00
Matteo Biscosi
79a563c1a9 Added IPS policy load at startup 2021-05-27 14:57:49 +02:00
Matteo Biscosi
b678a2128e Added jailed hosts refresh when removed a member and at startup 2021-05-27 11:38:32 +02:00
Luca Deri
6d93ae5a72 Added check for banned hosts processing 2021-05-26 23:26:30 +02:00
Alfredo Cardigliano
9bc4dbe078 Move ips pool creation after recipients initialization 2021-05-26 09:52:13 +02:00
Matteo Biscosi
c7b6e038cb Implements add host to drop pool by alert callback (#5405) 2021-05-25 17:57:26 +02:00
Matteo Biscosi
1336855981 Removed debug print 2021-05-25 12:19:00 +02:00
Matteo Biscosi
900a867a9b Standardized host pool name 2021-05-25 12:15:22 +02:00
Matteo Biscosi
b06ea2e8a0 Added default drop hosts poll creation at boot 2021-05-25 11:22:32 +02:00
Simone Mainardi
83f0c38937 Massive cleanup of old alerts code 2021-05-03 18:16:46 +02:00
Simone Mainardi
44861bcc0c Fixes deletion of old alerts 2021-05-03 16:48:30 +02:00
Alfredo Cardigliano
92b4ae4828 Alerts DB housekeeping 2021-04-29 19:31:49 +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
Simone Mainardi
f61ffc045b Merge branch 'c-user-scripts' into dev 2021-03-22 10:36:13 +01:00
Simone Mainardi
aea9138bfb Implements flow callbacks and alerts in C++ 2021-03-22 09:51:36 +01:00
Matteo Biscosi
97c83e1d75 Fixes delete alerts older then 2021-03-04 18:21:00 +01:00
Simone Mainardi
716d907ff1 Configset initialization fixes 2021-03-01 18:19:38 +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
696bcb33e5 Implements alert exclusions for hosts, interfaces, local networks 2021-02-23 15:36:14 +01:00
Matteo Biscosi
c62c2c232e Removed useless requires for enchanting performances
Removed, where it was possible, the lua requires, with the objective of enchanting the performances of periodic activities
2021-02-23 10:51:50 +01:00
Luca Deri
f1c87e533f Simplified housekeeping.lua 2021-02-22 18:03:25 +01:00
Simone Mainardi
a9aef2c70a Update for test alert_dns_data_exfiltration_02 2021-02-19 18:50:25 +01:00
Simone Mainardi
9049cb327f Update for test alert_dns_data_exfiltration_02 2021-02-19 18:41:36 +01:00
Simone Mainardi
e3dab26574 Fixes flow status not set under certain conditions 2021-02-18 11:12:26 +01:00
Simone Mainardi
9314f36cc5 Fixes remote to remote alerts setting nil scores 2021-02-18 10:59:36 +01:00
Simone Mainardi
0d39732d1c Implements telemetry for alter filters 2021-02-17 12:08:40 +01:00
Simone Mainardi
84ac0f4dfc Implements filtering of flow user scripts 2021-02-12 12:56:06 +01:00
Alfredo Cardigliano
7bee78fe75 Sort modules by prio and then by name to provide deterministic results 2021-02-11 16:28:41 +01:00
Matteo Biscosi
1d9b44eb18 Implements script failure in daily.lua
Implements #5031
2021-02-09 15:53:55 +01:00
Luca Deri
a4a2a13fed Added migration for old service map keys
Added dynamic memory management of ntop.getHashCache()
2021-02-04 17:16:14 +01:00
Simone Mainardi
38d31a474a Makes multiple score increments status-dependent
Implements #4993
2021-01-30 12:45:04 +01:00
Matteo Biscosi
10fb8bbecc Implements #4919 custom alert severity 2021-01-27 12:29:19 +01:00
Matteo Biscosi
98917ee686 Implements #4937 top sites generation broken 2021-01-21 15:44:15 +01:00
Matteo Biscosi
3c6674e32d Fixed #2611 automatically delete alert older than 2021-01-18 18:12:53 +01:00
Matteo Biscosi
371edc0b43 Fixed interface periodic top sites update 2021-01-13 16:34:11 +01:00
Simone Mainardi
c3c2a58c3a String fix 2021-01-12 15:47:00 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Simone Mainardi
a3383c5e2c Honors status_always_notify also for the internal SQLite recipient 2020-12-30 19:31:23 +01:00
Simone Mainardi
e3eda6e082 Implements ability to trigger flow alerts even if already triggered 2020-12-30 13:08:55 +01:00
Simone Mainardi
56a4c999a3 Initial flow status rework to remove globals 2020-12-30 12:06:33 +01:00
Simone Mainardi
d989f8d2c6 Reworks notifications thread to avoid Redis accesses
Fixes #4673
2020-12-29 18:48:55 +01:00