Commit graph

57 commits

Author SHA1 Message Date
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
gabryon99
13596ea4e0 updated nindex page template 2021-03-23 12:49:48 +01:00
gabryon99
6ead87d958 added chips inside range-picker 2021-03-23 11:19:15 +01: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
gabryon99
d164d53f97 add bar chart to test picker page 2021-03-17 14:07:58 +01:00
gabryon99
8426a330f4 improvements on range picker 2021-03-15 12:19:08 +01:00
gabryon99
d42bfc5072 improvments on test_picker page 2021-03-12 11:08:15 +01:00
gabryon99
88609de875 updated style range picker and added arrow buttons 2021-03-12 11:08:15 +01:00
gabryon99
0b411defcd updated style of range picker template 2021-03-10 16:37:55 +01:00
gabryon99
b61e86d696 add table picker template 2021-03-10 16:14:29 +01:00
gabryon99
59725e0355 add a test page containing datetimepicker range 2021-03-09 13:50:15 +01:00
gabryon99
d079589c9a rework hosts map with widget (#5080) 2021-03-08 11:28:03 +01:00
gabryon99
2bb5be7bf6 add bubble widget and removed old code 2021-03-01 15:49:12 +01:00
Alfredo Cardigliano
fa311e3ade Rework user script working sets (a single configset is supported now) 2021-03-01 15:37:45 +01:00
gabryon99
54dee2a426 updated .gitignore
now the files generated by the compilation of the widgets will be ignored
2021-02-17 18:17:14 +01:00
gabryon99
daa117b533 ntopng widget tests 2021-02-15 18:39:54 +01:00
gabryon99
ee0fa52d9d add radar widget 2021-01-22 12:23:42 +01:00
Luca Deri
2ff16404ee Modified interface ids 2021-01-21 15:00:55 +01:00
gabryon99
23a0bcbaac updated ntop-widgets 2021-01-21 10:50:56 +01:00
gabryon99
0057d37218 working on ntop widgets 2021-01-19 18:52:06 +01:00
gabryon99
1823fa00dd replace type to src ntop widgets 2021-01-19 18:52:06 +01:00
gabryon99
406f933f20 add select for testing widgets 2021-01-16 10:17:16 +01:00
gabryon99
8ce8debebd minor fixes on ntop-widgets 2021-01-14 21:24:24 +01:00
gabryon99
abb65fa847 test for ntop-widgets 2021-01-14 15:22:23 +01:00
gabryon99
4b606c0685 rename ds_hash to ds_type in test page 2021-01-07 18:16:23 +01:00
Simone Mainardi
a71492aab5 Changes to allow widgets to fetch datasources by type 2021-01-07 11:41:36 +01:00
Luca Deri
a60e322887 Moved hosts explorer under maps 2021-01-06 20:59:28 +01:00
gabryon99
5688f45544 simple test for widgets 2021-01-06 15:47:05 +01:00
Simone Mainardi
df7ac9429c Implements unique keys and getters for datasource types 2021-01-06 14:51:04 +01:00
Simone Mainardi
6546e3d9bd Implements getter for all available class-based datasource types 2021-01-06 10:56:39 +01:00
Simone Mainardi
d902000d67 Implements widgets with multiple datasources (fetch + rest) 2021-01-05 20:55:33 +01:00
Simone Mainardi
b670ab1d59 Initial rework of widget datasources and transformations 2021-01-05 12:34:04 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Simone Mainardi
3baa932a01 Migrates alerts to an object-oriented implementation
Migrates alert_malicious_signature alert_elephant_local_to_remote alert_elephant_remote_to_local

Migrates long_lived

Migrates alert_flow_blocked

Migrates alert_tls_old_version

Migrates alert_tls_certificate_mismatch

Migrates alert_tls_certificate_expired

Migrates alert_tls_unsafe_ciphers

Migrates alert_tls_certificate_selfsigned

Migrates alert_potentially_dangerous_protocol

Migrates alert_snmp_device_reset

Migrates alert_port_mac_changed

Migrates alert_port_duplexstatus_change

Mirgates alert_port_errors

Migrates alert_port_status_change

Migrates alert_port_load_threshold_exceeded

Migrates alert_data_exfiltration

Migrates alert_dns_data_exfiltration

Migrates alert_suspicious_tcp_probing alert_suspicious_tcp_syn_probing alert_tcp_connection_refused

Migrates alert_dns_invalid_query

Migrates alert_attack_mitigation_via_snmp

Migrates alert_lateral_movement

Migrates alert_periodicity_update

Migrates alert_dns_positive_error_ratio

Migrates alert_iec104_error
2020-12-22 09:56:38 +01:00
Simone Mainardi
c6f799ac16 Moves test_alerts.lua under tests/lua 2020-10-12 09:25:34 +02:00
Simone Mainardi
6c1280a8e5 Reworks recipients.lua as static rather than (useless) instance 2020-09-23 15:03:07 +02:00
Simone Mainardi
d42051616c Implements per-recipient user script categories and severities 2020-09-16 12:09:13 +02:00
Simone Mainardi
f56bcebe81 Handles in-memory recipients addition/deletion 2020-09-08 14:05:38 +02:00
Simone Mainardi
3f2fa953aa Implements in-memory recipient queues 2020-09-07 17:54:14 +02:00
Simone Mainardi
fbf1e39981 Implements reuse of recipient ids 2020-09-07 15:53:35 +02:00
Simone Mainardi
3cefe89d4b Initial implementation of OO recipients and integer ids 2020-09-07 13:03:34 +02:00
Simone Mainardi
aeecbcce29 Initial implementation of OO recipients with SQLite 2020-08-28 13:19:58 +02:00
Simone Mainardi
e0d936fc9c Fixes host pools getter returning non-existing pools 2020-07-29 16:39:31 +02:00
Simone Mainardi
1405107c13 Implements in-memory host pools bind checks 2020-07-15 15:32:42 +02:00
Simone Mainardi
4e886711cf Refactors pools members bind checks (eases host pools checks) 2020-07-15 15:11:58 +02:00
Simone Mainardi
b1edce1894 Implement REST endpoint to add host pools
Implements #4133
2020-07-14 17:36:08 +02:00
Simone Mainardi
7408eca0bc Implements host pools as a Lua class (compatible with existing pools)
Implements #4131
2020-07-14 16:54:14 +02:00
Simone Mainardi
a9ccba5ec6 Implements base_pools:bind_member Lua API
Implements #4129
2020-07-13 19:22:05 +02:00
Simone Mainardi
44535d99a7 Implements lua class active_monitoring_pools.lua to handle active monitoring pools 2020-07-08 17:52:14 +02:00