Commit graph

762 commits

Author SHA1 Message Date
Simone Mainardi
60a8a4ed0c Fixes TLS server name not properly parsed via ZMQ
Addresses #5924
2021-09-24 12:16:41 +02:00
Matteo Biscosi
120cd82c39 Changed format and position of Flow Verdict information 2021-09-08 15:47:23 +02:00
Simone Mainardi
0e8e24d077 Fixes dumped traffic partials potentially wrongly updated 2021-08-24 15:53:21 +02:00
Simone Mainardi
ef9597140b nEdge compilation fix 2021-08-11 17:23:03 +02:00
Simone Mainardi
f6560d1974 Implements and rework alert for flow periodicity change 2021-08-11 15:11:44 +02:00
Luca Deri
993168c691 Edge compilation fixes 2021-08-10 23:16:31 +02:00
Luca Deri
aca352452e Fixes #5733 and the regressions introduced by 13d804e199
Updated code for new nDPI API
2021-08-07 18:23:44 +02:00
Simone Mainardi
51cb8aae77 Improves the swap heuristics and adds a third test case
Addresses #5706
2021-08-04 18:32:42 +02:00
Alfredo Cardigliano
7b62dcfbcb Change function return code to match the name 2021-08-02 16:01:00 +02:00
Simone Mainardi
f41faab5da Reworks TLS/MDNS flow names 2021-07-23 11:43:51 +02:00
Simone Mainardi
324292f04f Fixes false positives in invalid suspicious device protocol
Fixes #5664
2021-07-14 18:48:37 +02:00
MatteoBiscosi
017818616d Added nprobe ip and observation id (#5666) 2021-07-13 17:39:34 +02:00
Luca Deri
e55f88faa2 ZMQ timeout optimizazion 2021-07-09 16:36:46 +02:00
Simone Mainardi
04a5a6ea78 Fixes DGA domains not properly handled over ZMQ
Fixes #5649
2021-07-07 19:20:39 +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
MatteoBiscosi
638bf881fd Migrated periodicity update alert into flow alert 2021-06-21 17:47:03 +02:00
Luca Deri
195fe9578c Improved observation point id support and flow reporting 2021-06-19 00:16:48 +02:00
MatteoBiscosi
2d61babeaf Removed unused lateral movement variable 2021-06-17 16:59:15 +02:00
MatteoBiscosi
a89c95dba4 Migrated Lateral Movement alert from interface to flow (Fixes #5485) 2021-06-17 11:07:29 +02:00
Simone Mainardi
40f5c4e821 Refactors {flow,host}callbacks into {flow,host}checks (C++) 2021-06-16 15:27:38 +02:00
Simone Mainardi
cf50f4e0e7 Uses possibly swapped cli and srv to set host names
Possibly resolves #5506
2021-06-16 09:14:14 +02:00
Luca Deri
846d24c5e9 Initial VLANid rework 2021-06-15 23:01:59 +02:00
Simone Mainardi
bd5ebabb16 Shows unhanlded flow risks in the flow details page
Addresses #5402
2021-06-11 17:56:49 +02:00
Simone Mainardi
3d1ab71f9b Reworks scores for nDPI-risk flow alerts
Addresses #5402
2021-06-11 15:22:32 +02:00
Simone Mainardi
0bd6efe5dc Implements breakdown for flow score
Implements #5402
2021-06-10 14:27:19 +02:00
Simone Mainardi
409a7ceed7 Fixes tests output 2021-06-09 11:00:58 +02:00
Simone Mainardi
c066e623e5 Fixes non-deterministic DNS DGA alerts
Fixes #5437
2021-06-08 17:31:36 +02:00
Simone Mainardi
4ccca54458 Handles possible races in setting multiple DNS queries
Addresses #5437
2021-06-08 17:11:56 +02:00
Luca Deri
c7939fb212 Added JA3 handling via ZMQ 2021-06-04 00:10:07 +02:00
Alfredo Cardigliano
94dd271814 Set flow score using ndpi_risk2score for Risk alerts. Change flow score from 8 to 16 bit in API calls. 2021-06-03 11:23:20 +02:00
Simone Mainardi
4352638cdf Reworks and completes attacker/victim for all flow alerts
Addresses #5310
2021-05-28 17:03:37 +02:00
Luca Deri
73280f0e09 Fixed invalid protocol breed mapping 2021-05-17 22:22:25 +02:00
Alfredo Cardigliano
adc665c847 Cleanup get proto name functions. Add master proto to flow alerts. 2021-05-06 10:31:16 +02:00
Simone Mainardi
02934faf6e Optimizes flow callbacks (saves 24 bytes per flow) 2021-05-05 16:55:38 +02:00
Alfredo Cardigliano
ef65671794 Remove alert severity from Alerts. Always use score (convert to severity when required for UI or similar) 2021-05-05 09:54:14 +02:00
Simone Mainardi
96cd1bebbd Fixes score decrements on flows 2021-04-09 20:12:42 +02:00
Alfredo Cardigliano
db6746e1a3 Enqueue host alert release status to avoid concurrency issues. Change SPSCQueue dequeue to behave similar to std lists. 2021-04-09 09:45:11 +02:00
Matteo Biscosi
8d2cf80f95 Added JA3 hash to flow alert
Implements #5159
2021-04-08 12:34:45 +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
da943e0dff Reduces the maximum cli/srv score per callback to 128 2021-03-23 14:54:32 +01:00
Simone Mainardi
537c151a62 Simplifies check of alerted flows 2021-03-23 13:31:08 +01:00
Simone Mainardi
8c31b70073 Fixes and simplifies counters for alerted flows 2021-03-23 13:23:09 +01:00
Simone Mainardi
c0815c4329 Fixes set of predominant alert severity 2021-03-23 12:46:42 +01:00
Simone Mainardi
d90535017a Allows severity to be passed to triggerAlert{Sync,Async} 2021-03-23 12:17:11 +01:00
Alfredo Cardigliano
d1c8d2c530 Check if the same alert has been already triggered and accounted in the score, unless this is a sync alert 2021-03-23 10:08:53 +01:00
Simone Mainardi
aea9138bfb Implements flow callbacks and alerts in C++ 2021-03-22 09:51:36 +01:00
Simone Mainardi
9050b210b5 Cleanup and simplif. old client/server heuristic code 2021-02-27 19:19:03 +01:00
Simone Mainardi
b7a2e0138c Additional changes and simplif. to the client/server heuristic 2021-02-27 19:10:55 +01:00
Simone Mainardi
9b6c9b7c60 User script changes for client/server heuristics 2021-02-26 19:29:36 +01:00