Commit graph

529 commits

Author SHA1 Message Date
Luca Deri
71fbbdbf58 Implemented custom host script (WIP) 2022-11-24 12:34:14 +01:00
Luca Deri
309d17b6b8 Implemented CustomFlowLuaScript.cpp engine 2022-11-20 20:30:49 +01:00
Luca Deri
2d7dc6bfa0 Added kafka dependencies 2022-10-20 00:02:03 +02:00
Luca Deri
fd306dd894 Increased upload size to 25 MB 2022-10-05 22:23:35 +02:00
Alfredo Cardigliano
054fa59bc8 Remove unused var 2022-09-16 09:09:35 +02:00
Alfredo Cardigliano
b4b4316068 Restore GET params on POST 2022-09-15 19:06:25 +02:00
Luca Deri
4ad109a7c0 Added the ability to analyze a pcap without creating a new interface 2022-09-15 00:35:56 +02:00
Luca Deri
fa51a2b4e8 Added the ability to upload a pcap file for analysis 2022-09-08 00:46:24 +02:00
Luca Deri
00f95a03de Warning fixes 2022-05-24 12:23:01 +02:00
Luca Deri
164c186ee9 Final fix for #6286 2022-02-09 23:19:32 +01:00
Luca Deri
72faebe4a5 Improved active ICMP monitoring 2022-01-04 22:30:12 +01:00
Alfredo Cardigliano
f2060f2488 Copyright update (C) 2022-01-03 09:35:09 +01:00
MatteoBiscosi
e92135e776 Reorganized periodic scripts 2021-12-28 15:41:28 +01:00
Luca Deri
32fd4d67b9 Compilation fix 2021-12-23 21:04:47 +01:00
Luca Deri
878a3c3c60 Changes for similarity detection 2021-12-13 21:18:13 +01:00
Simone Mainardi
547e320113 Fixes lua_pop in LuaEngine::run_loaded_script 2021-12-03 16:18:41 +01:00
Luca Deri
e905d09124 Mitigates load due to VM reload (#6091) 2021-11-23 09:55:13 +01:00
Simone Mainardi
2ff0cccdfa Fixes default observation point id selection 2021-11-18 16:16:52 +01:00
Luca Deri
03cc793958 Removed Lua warning for CONST_LUA_ERROR to avoid nasty warnings 2021-10-15 08:32:40 +02:00
Luca Deri
9bd28b1f54 Added code for tracking C functions that do not fill up the Lua state properly. In case of issues
detected, the misbehaving function is reported on the screen for easy patching. Fixed a couple
of functions that were not setting the return state properly.

Lua VMs are reset before reuse.

Minor code cleanup and rename (Vm -> VM).
2021-10-14 19:03:18 +02:00
Simone Mainardi
2e6068bdef Fixes selection and XSRF when changing the observation point 2021-09-23 16:05:55 +02:00
Alfredo Cardigliano
1f43ed6a6b Add URI information to POST data warning 2021-08-09 16:44:37 +02:00
Alfredo Cardigliano
5d6b69d493 Fix leak checking CSRF 2021-07-14 14:51:35 +02:00
Luca
112c931226 Observation point code cleanup (WIP) 2021-07-01 23:26:15 +02:00
Luca
336f1f3d9f Adding observationPoint support (WIP) 2021-06-30 20:03:37 +02:00
Luca
fa5271b4d7 Implemented observationPoint menu support 2021-06-29 21:18:51 +02:00
Simone Mainardi
8cfb7b608a Allows alert access to admins and non-admins w/o allowed networks
Implements #5324
2021-05-26 09:50:28 +02:00
Simone Mainardi
0855f627a0 Allows alert access to admins and non-admins w/o allowed networks
Addresses #5324
2021-05-25 18:14:17 +02:00
Simone Mainardi
09f9254aa7 Prevents non-admins to switch to system interface
Partially addresses #5324
2021-05-25 17:04:51 +02:00
Luca Deri
d81d8a3295 Fixes bug that precvented session key to work when multiple ntopng instances are started per host 2021-05-21 23:29:15 +02:00
Simone Mainardi
33495e0188 Fixes system interface selection mixed between Lua and C++ 2021-05-11 12:51:34 +02:00
Simone Mainardi
81f43876c6 Removes shutdown check performed in Netfilterinterface 2021-04-09 17:52:45 +02:00
Luca Deri
1a3713394b Compilation fix 2021-04-09 16:02:48 +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
Alfredo Cardigliano
e86fffcc58 Add message to restart ntopng after importing all conf. Improve max post data check. Remove unnecessary exported modules. 2021-03-08 11:14:44 +01:00
Luca Deri
ad9e629e36 Fixes #4961 2021-02-02 18:39:24 +01:00
Luca Deri
34e7f765ee Missing Server: header from HTTP requests 2021-01-25 15:10:21 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Luca Deri
9c16489912 FreeBSD compilation fixes
Various warning fixes
2020-12-31 18:05:44 +01:00
Luca Deri
2ef29c7c5e Cleanup code removing .inc files 2020-11-25 22:05:06 +01:00
Luca Deri
7353b2d3cc Added Origin under _SERVER variable 2020-11-19 13:49:57 +01:00
Simone Mainardi
049bfdcf4a Implements bitmap-based limited privileges for non-admins
Implements #4489
2020-10-09 15:50:22 +02:00
Simone Mainardi
b5781eea2c Cleanup unused flow_acle lua context member 2020-09-30 18:44:39 +02:00
Alfredo Cardigliano
3be4b69ea8 Fix CSRF check in case of non-REST POST with JSON payload 2020-08-28 15:05:42 +02:00
Simone Mainardi
b31a209e73 Removes a debug print 2020-08-25 17:38:26 +02:00
Simone Mainardi
f4affe2c6c Fixes CSRF vulnerabilities when POSTing JSON
Fixes #4285
2020-08-25 16:47:20 +02:00
Luca Deri
643e78f8d5 Implements most of #4113
- Removed unused google assistant scripts
- Cleaned up existing REST calls using _POST["payload"]

The _GET["parameter"] element is still present and it will be removed soon
2020-07-06 18:06:40 +02:00
andpp
87d77d12d6 Fixing redirection issue after changing interface (#4022)
Simplifies interface switch send redirect code

Addresses https://github.com/ntop/ntopng/pull/4022
2020-06-08 10:31:16 +02:00
Simone Mainardi
fed5cc9577 Enforces CSRF checks only when a session is used
When direct username:password are submitted, there is no need to enforce
such checks as it cannot be a CSRF attack. Indeed, CSRF attacks rely
on a session.

Fixes #4014
2020-06-03 09:59:31 +02:00
Luca Deri
8c948de437 SNMP code reorganization 2020-05-25 23:50:36 +02:00