Commit graph

34 commits

Author SHA1 Message Date
Alfredo Cardigliano
9352d0cdcd Update copyright 2025-01-02 09:09:56 +01:00
Luca Deri
d31a57c573 Optimized std::map to reduce memory usage 2024-02-21 13:41:06 +01:00
Luca Deri
55870e97b9 (C) Update 2024-01-12 11:44:18 +01:00
lucaderi
d395deac4e Automated commit of clang-format CI changes. 2023-04-07 14:20:44 +00:00
Luca Deri
78a757b84e Updated (C) 2023-02-19 19:16:07 +01:00
Simone Mainardi
3ab14250b8 Implements per-severity breakdown of engaged alerts in C++
Addresses the backend of #5881
2021-09-24 16:25:12 +02:00
Simone Mainardi
08fb295be9 Implements support for roles (attacker/victim) filtering of alerts
Implements #5425
2021-05-31 12:32:56 +02:00
Alfredo Cardigliano
450b6c4575 Remove AlertsManager (no longer used). Add back entity value or 5-tuple to exported alerts (fix #5285) 2021-05-10 10:57:43 +02:00
Simone Mainardi
ec06e6568f Simplifies and keeps per-family alert counters 2021-05-07 10:21:32 +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
83209ac402 Keeps alerted hosts in memory (fixes engaged alert counter out of sync)
Fixes #4506
2020-10-05 11:54:17 +02:00
emanuele-f
00b4fe17a6 Implement multitenant alerts support for in-memory alerts 2020-02-06 15:18:50 +01:00
emanuele-f
54140b6f1a Migrate alertable disabled alerts preference to lua
This avoids performing multiple hget on redis, thus increasing performance
2019-11-05 14:59:38 +01:00
Simone Mainardi
1ec35c3042 Fixes and cleanup of disabled alerts 2019-10-22 10:33:42 +02:00
Simone Mainardi
ff3469d897 Fixes race conditions in concurrent alert trigger and releases 2019-10-21 18:45:18 +02:00
Simone Mainardi
661dbbbeb0 Removes unnecessary alerts expired code 2019-10-21 17:47:17 +02:00
Simone Mainardi
e80dc962f4 Optimizes host.getFullInfo with smaller functions in periodic scripts 2019-10-21 16:21:03 +02:00
emanuele-f
87ba28195b Add support to engage/release on external alerts 2019-08-20 19:02:58 +02:00
emanuele-f
d1c5275302 Move suppressed alerts flag to C to reduce Redis load 2019-08-20 11:54:25 +02:00
Luca
6f95b32eae Alert triggering optimisation 2019-08-15 21:20:39 +02:00
Luca
f8c962a6fb Fixed alerts race conditions 2019-08-15 17:19:26 +02:00
emanuele-f
ee9e5ec9de Unify alerts and alerts notifications format 2019-07-30 18:12:58 +02:00
emanuele-f
2243cabcf1 Fix alert release time and gui enhancements 2019-07-25 14:25:27 +02:00
emanuele-f
a3942831b8 Fix issues with engaged alert counters and other improvements 2019-07-24 15:40:43 +02:00
emanuele-f
09fb8667e2 Add ability to disable specific alert types on alertables 2019-07-22 23:37:23 +02:00
Simone Mainardi
54c1df4b4d Implements class AlertCheckLuaEngine and refactors code 2019-07-18 17:01:05 +02:00
emanuele-f
5444f027ed Remove engaged alerts from sqlite 2019-07-17 16:29:55 +02:00
emanuele-f
2e537a0c94 Alert changes after review 2019-07-17 12:51:47 +02:00
emanuele-f
c117f20e19 Initial rework for in-memory alerts 2019-07-16 19:25:09 +02:00
emanuele-f
7b1190f24f Fix host alerts counter 2019-07-16 11:33:51 +02:00
emanuele-f
5e40e47cce Implement expired alerts release
This is necessary to handle the case where a previously configured alert config is deleted
2019-07-15 13:09:18 +02:00
Simone Mainardi
11fa6b5212 Implements network alerts 2019-07-10 12:43:17 +02:00
Luca
3e223849ba Added granularity to AlertableEntity 2019-07-08 17:07:26 +02:00
Luca
76ef993dfe Reworked alerts 2019-07-07 15:09:24 +02:00