Commit graph

122 commits

Author SHA1 Message Date
Matteo Biscosi
c7b6e038cb Implements add host to drop pool by alert callback (#5405) 2021-05-25 17:57:26 +02:00
Matteo Biscosi
900a867a9b Standardized host pool name 2021-05-25 12:15:22 +02:00
Simone Mainardi
42c82ba8f4 Implements C++ HostPool getPoolByName
Implements #5409
2021-05-25 11:42:42 +02:00
Simone Mainardi
f5ae35e4b6 Minor fixes 2021-05-19 12:00:36 +02:00
Simone Mainardi
1b272d63a1 Fixes recipients not handled when setting policies 2021-05-19 10:36:48 +02:00
Alfredo Cardigliano
b99384494e Fix pools set policy 2021-05-18 18:06:44 +02:00
Matteo Biscosi
553a059557 Added getters and setters for host pools policy 2021-05-14 17:41:06 +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
Alfredo Cardigliano
2758ec85a5 Fix import of of recipients for default pools (and merging for existing pools) #5083 2021-03-04 14:31:43 +01:00
Alfredo Cardigliano
5f759a6766 Fix pools:_persist call 2021-03-01 18:29:44 +01:00
Alfredo Cardigliano
90c31e11ec Fix pools:_initialize 2021-03-01 18:25:21 +01:00
Alfredo Cardigliano
fa311e3ade Rework user script working sets (a single configset is supported now) 2021-03-01 15:37:45 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Simone Mainardi
b3dc39c641 Refactors alert_severities into an independend Lua module 2020-11-30 15:28:17 +01:00
Simone Mainardi
93ef5c08d8 Allows a recipient to be bound to every pool upon creation 2020-11-27 16:30:55 +01:00
gabryon99
15772bd0fe refactor for endpoints and recipients (#4707) 2020-11-25 16:25:55 +01:00
Simone Mainardi
e7a6682aba Implements transactional host pools members add 2020-11-13 19:15:21 +01:00
Simone Mainardi
3937888f96 Adds pools, active monitoring, endpoints and recipients to nEdge 2020-11-12 17:32:29 +01:00
Alfredo Cardigliano
5d606a41fc Handle recipient[recipient_minimum_severity] = nil (all categories) 2020-11-12 10:04:14 +01:00
gabryon99
ee3bb1db29 add check for builtin recipients (#4663) 2020-11-02 12:19:56 +01:00
gabryon99
ee4733e2ed fixed notification keys set (#4662) 2020-11-02 11:02:39 +01:00
gabryon99
8dd860ea2a implemented wizard-likes messages for endpoints and recipients (#4658) 2020-11-01 18:31:42 +01:00
Simone Mainardi
355be90e5d Improves alerts with better descriptions and hyperlinks
Implements #4585
2020-10-23 14:24:16 +02:00
Simone Mainardi
049bfdcf4a Implements bitmap-based limited privileges for non-admins
Implements #4489
2020-10-09 15:50:22 +02:00
Alfredo Cardigliano
fb011bc0af Add missing pool_import_export.lua including pools export and reset (#4433 #4475) 2020-10-02 12:32:04 +02:00
Simone Mainardi
2afc279caf Fixes invalid recipients behavior
Fixes #4483
2020-09-23 18:55:39 +02:00
Simone Mainardi
6c1280a8e5 Reworks recipients.lua as static rather than (useless) instance 2020-09-23 15:03:07 +02:00
Simone Mainardi
0bbcc12edb Fixes pools_alert_utils.lua:112: bad argument #1 to 'for iterator' 2020-09-16 18:26:39 +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
fdf65adc62 Reworks recipient register/delete and Lua VMs reload 2020-09-15 15:58:48 +02:00
Simone Mainardi
b4627ffc08 Removes forced use of builtin SQLite plugin
Implements #4383
2020-09-11 18:39:18 +02:00
Simone Mainardi
27ef917766 Implements flag to indicate default-only pools 2020-09-10 16:29:00 +02:00
Simone Mainardi
e0192d03be Implements reset of pools and REST API endpoint
Implements #4384
2020-09-10 14:45:28 +02:00
Simone Mainardi
13cfd29376 Implements REST endpoint to get all pools for a given recipient 2020-09-10 14:00:55 +02:00
Simone Mainardi
c1078d2f21 Implements additional pools and edit/get REST API
Implements #4380
Implements #4381
2020-09-10 11:11:08 +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
2aa4588c07 UI fixes for new recipients 2020-09-08 14:57:55 +02:00
gabryon99
146e0f7945 rewrok gui for new recipients api 2020-09-08 14:08:44 +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
32b4a1cca4 Refactors base_pools to pools 2020-09-01 10:53:36 +02:00
Simone Mainardi
6e0ae904df Implements REST API endpoint to get pools for any available type
Implements #4263
2020-08-31 16:13:42 +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
d895777fa2 Adds pool name to base_pools:get_assigned_members 2020-08-19 09:33:58 +02:00
Simone Mainardi
2473637bd0 Prevents initialization of non-subclassed base_pools.lua
Partially addresses #4271
2020-08-18 18:29:25 +02:00
Simone Mainardi
16db3cda67 Reworks REST API to return i18n success/error messages
Implements #4300
2020-08-17 19:18:16 +02:00
Alfredo Cardigliano
1160066b08 Add logging for all non-get REST calls (fix #4279) 2020-08-14 12:02:09 +02:00
Simone Mainardi
60b6d36315 Fixes script failure module 'snmp_config' not found in community 2020-08-03 11:05:18 +02:00
Alfredo Cardigliano
75ba792513 Check if pool recipients exist 2020-07-31 16:50:55 +02:00