Commit graph

82 commits

Author SHA1 Message Date
Simone Mainardi
237a4a3659 Uses the error logging facility to print a plugins traceback 2021-08-12 09:58:01 +02:00
Simone Mainardi
2d3c44e6b4 Prints traceback as ERROR to help debugging tests 2021-08-12 09:39:31 +02:00
Simone Mainardi
343fc335c2 Implements support for non-community {host,flow} checks 2021-07-12 12:32:06 +02:00
Simone Mainardi
2e8a6de0fc Major terminology unification (user scripts -> checks) 2021-06-17 12:39:43 +02:00
Simone Mainardi
76fd315d1b Refactors user_scripts into checks (lua) 2021-06-16 18:02:22 +02:00
Simone Mainardi
0385651aaf Fixes sporadic plugins load failures causing unexpected behaviors 2021-06-03 11:37:57 +02:00
Simone Mainardi
228c85d850 Removes old inefficient alert functions 2021-05-07 11:40:07 +02:00
Simone Mainardi
ce84de5732 Changes the severity of a message 2021-04-30 15:47:18 +02:00
Simone Mainardi
c7082a4647 Implements new alerts database and drilldown
alert store skeleton

Alert database type changes

Implement alert store for host alerts. All alert store skeletons.

Fix class method access

Enable tracing

Implements simple queries for host alerts

Implement flow alert store

Fixes escaping of INSERT queries

Flow alerts database schema fixes

Adds escaping for alert JSON in flows and hosts

Implements queries .select() for alerts store

Adds limit and offset to perform paginated queries

Adds new REST getter for flow alerts

Name changes alert_severity to severity, alert_json to json

Fixes alert message not shown

Implement active monitoring alerts store

Implements sort of queries in the new dataabase

Changes alert_type to alert_id

Implement mac alerts store

Fixes flow alert messages

Implement system alerts store

Implement snmp alert store

Add missing items to the flow alerts

Add missing items to the host alerts

Add missing items to the mac alerts

Implements COUNT aplerts api

Add device_name to snmp alerts

add flow alerts templates

updated gitignore

fix for missing order field

add families defined in `alert_store_schema.sql`

Reworks and simplifies alert store subclasses

Implements REST API to fetch alert timeseries

Fixes date in flow REST api

Host alert json fix

Add get/host/alert/list.lua

Move alert/list.lua to alert/past/list.lua

Add alert/past/list.lua for all alert families

Add entity_id to system table to identify the alert type based on <alert_id, entity_id>

Add missing field

Implements facilities to query engaged alerts via REST

Handle both historical and past alerts in alert/list.lua

Fix count

Update params of select_historical

Implement method to add family-specific filters

Add alert/ts.lua for all alert families

Implements facilities and REST endpoints to delete alerts

Implements ordering of alert queries

Fix add_order_by group_by

Rest API tests update

Tests output update

Remove debug trace

Use alert_id instead of type. Add more flow alert info.

Update http lint

Format obsolete tlv version alerts. Add more host info.

Add row_id to list of alerts

Fix selection of engaged alerts

Add test for mac alerts (bcast domains)

Removes attempt to format alerts as flow alerts

Fixes interface selection for active monitoring

Update test output with rest changes

Add more fields to be ignores

Set alert count to 1 for the time being

add bar timeseries chart

add apexcharts

improvements on timeseries bar chart

registered chart callbakcs

working on alert page

fix for date format

Fixes acrive monitoring REST API

Fixes alignment of grouped alert data

Additional fix for alert histogram

remove useless if

formatting alerts page

fixes on flows alert stats table

rename local networks to device

format host pagie in alert_stats

add tag support for hosts and flow

implemented single delete action

add release modal

Fixes format of threshold cross interface alerts

Fixes wrong increase of dropped alerts

Implements exclusion list for invalid dns queries

Reworks exclusions lists for hosts and flows

Addresses #5212
Addresses #5113

Adds host alert keys in host callbacks definitions

Adds alert ids to flow callbacks

fix for not working button (#5215)

Fixes reported timeseries name

removed any additional button inside chart's toolbar (#5200)

Add tables for interfaces, networks, users to the schema. Skeleton alert_store classes

fixed broken range picker layout in firefox (#5199)

Alert insert fixes

Add more info to network alerts

Add rest endpoint for interface, network, user alerts

Fix endpoint selection in alerts_stats

Unifies columns between engaged and past alerts

Fixes Missing mandatory 'alert_granularity'

Minor fixes for missing alert_severity

Fixes arithmetic on a nil value (field 'last_seen')

Fixes get/system/alert/list.lua

use tstamp for column names (#5221)

Implements host alert formatter

Add alerts_store format_record_common

Use common format_record for am, system alerts

Use common format_record for all alerts

Fixes formatting of alerts of all types

Fixes nil in function 'hostinfo2label'

fixes on disable modal

add pages for network, user and interface endpoint (#5224)

Set alert_entity in all classes

Unifies influxdb alerts into system alerts

Addresses #5224

Unifies process alerts into system alerts

Addresses #5224

Cleanup unused periodicActivityEntity

Unifies category lists alerts into system alerts

Addresses #5224

Aligns new alert enums

Addresses #5224

Fixes alert page links

Fixes insertion of interface alerts

Implement filters for Host alerts

Fixes active monitoring alerts not triggering

Implement filters on flow alerts

Fixes for internal alerts timestamp and subtype

implements disable for the alerts

formatted alert disable label

Add address and device type to mac alert records

fix for delete alert toggle

Fix access to entity_val in alert_unexpected_new_device

add mac address and device type inside table

Fixes for new alert fields not handled

Fixes alert_definitions to handle new fields

Add ip/port to snmp alert records

Implements deletion of stored flow alerts

Add alert_name to all alert records via rest. Fix duration.

fixes for snmp tab

Implements delete of past host alerts

Add name to snmp alert records

fixes on system tab

Fix Date column

fixes link

Update menu

Fixes bad argument #3 to 'format' in snmp alerts

updated interface link

new alerts url for host (#5228)

Fixes sort of engaged alert

Minor cleanup

Fixes data returned for local network alerts

Fix duration for one shot. Note.

Fix duration override

Fixes interface selection for system alerts

Move host alert page

fixes for local network tab

Minor fix

Fix engaged host alerts

fixes on user tab

Fix alert_user_activity message
2021-04-26 19:41:34 +02:00
Simone Mainardi
10ee722da4 Fixes missing information when loading plugins with no manifest
Fixes #5163
2021-04-12 09:29:45 +02:00
Simone Mainardi
08f95ee5cb Fix and cleanup defaul alert severities 2021-03-25 09:07:40 +01:00
Simone Mainardi
aea9138bfb Implements flow callbacks and alerts in C++ 2021-03-22 09:51:36 +01:00
Simone Mainardi
716d907ff1 Configset initialization fixes 2021-03-01 18:19:38 +01:00
Simone Mainardi
15d4672f7e Loads plugins templates from /modules when no template is found 2021-02-23 10:55:41 +01:00
Simone Mainardi
9433928dfc Handles templates (load/require) for individual plugins 2021-02-19 15:51:27 +01:00
Simone Mainardi
f489eba549 Prevents non-community plugins from being always reloaded
Possibly addresses #4903
2021-01-25 19:26:13 +01:00
Alfredo Cardigliano
080e590166 Fix plugins_utils.hasAlerts what was not restoring the selected interface 2021-01-25 17:39:03 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Simone Mainardi
d989f8d2c6 Reworks notifications thread to avoid Redis accesses
Fixes #4673
2020-12-29 18:48:55 +01:00
Simone Mainardi
16e2c9efe2 Cleanup to remove flow_consts no longer needed 2020-12-22 17:59:51 +01:00
gabryon99
15772bd0fe refactor for endpoints and recipients (#4707) 2020-11-25 16:25:55 +01:00
Simone Mainardi
2849267af8 Reworks plugin template definition keys
Implements #4651
2020-11-03 18:09:29 +01:00
Simone Mainardi
e27406cc5d Checks plugin template parameters upon load
Implements #4652
2020-11-03 17:38:33 +01:00
Simone Mainardi
357f11900f Fixes exceptions upon plugins reload
Fixes #4633
2020-10-27 17:35:14 +01:00
Simone Mainardi
8a3c115e9d Fixes possible ERROR: Missing required field 'alert_type'
Fixes #4560
2020-10-12 14:55:16 +02:00
Simone Mainardi
46572a96a0 Fixes cleanup of plugins upon startup 2020-10-11 19:03:40 +02:00
Simone Mainardi
c795fdb4e9 Adds trace info upon failing 'plugins_metadata' require
Addresses #4492
2020-09-28 17:57:10 +02:00
Simone Mainardi
6c1280a8e5 Reworks recipients.lua as static rather than (useless) instance 2020-09-23 15:03:07 +02:00
Simone Mainardi
3ad4522e45 Implements additional plugin hooks
The following plugin hooks have been implemented

onEnable(hook, hook_config)
onDisable(hook, hook_config)
onUpdateConfig(hook, hook_config)
onLoad(hook, hook_config)
onUnload(hook, hook_config)

Documentation is part of the commit.

Implements #4451
Implements #4453
Implements #4454
Implements #4455
2020-09-21 18:25:14 +02:00
Simone Mainardi
304c5404f2 Implement additional plugin hook script.onUpdateConfig
Implements #4451
2020-09-20 13:19:36 +02:00
Simone Mainardi
d8d8ee08ee Refreshes recipients upon plugins reload 2020-09-16 22:11:50 +02:00
Simone Mainardi
64f0922b6b Implements plugin onLoad call
Implements #4438
2020-09-16 10:48:12 +02:00
Simone Mainardi
f7e1ea9709 Reworks plugin loading and structure
Implements #4358
2020-09-15 11:33:53 +02:00
Simone Mainardi
20db316136 Migrates Discord plugin as self-contained 2020-09-09 17:22:09 +02:00
Simone Mainardi
0b894bcec9 Typo 2020-07-24 13:22:17 +02:00
Simone Mainardi
9f337629ec Simplifies plugins_utils.loadSchemas 2020-07-24 13:15:27 +02:00
Simone Mainardi
95607666aa Fixes plugin timeseries schemas load 2020-07-24 12:48:53 +02:00
Simone Mainardi
2214a7297c Fixes metadata reload upon plugins reload on community 2020-07-24 12:44:05 +02:00
Simone Mainardi
66b684d8e9 Minor cleanup 2020-07-23 23:44:37 +02:00
Simone Mainardi
36478ba3ee Optimizes plugins_utils.loadModule with require 2020-07-23 23:38:30 +02:00
Simone Mainardi
1e3fa9a389 Optimizes plugins http lint using require 2020-07-23 23:25:23 +02:00
Simone Mainardi
6d1e8697a1 Optimizes plugins_utils.getLoadedAlertEndpoints (avoids multiple reloads) 2020-07-23 23:19:01 +02:00
Simone Mainardi
4270f6e912 Cleanup unused plugins_utils.loadAlertEndpoint 2020-07-23 23:02:00 +02:00
Simone Mainardi
5d178b0bf4 Avoids using dofile when loading plugins metadata 2020-07-23 19:48:34 +02:00
Simone Mainardi
5fe50b0fd5 Plugin improvements (require vs dofile) 2020-07-23 19:39:28 +02:00
Simone Mainardi
2e16c2b76c Avoids dofile when loading plugin ts schemas (uses require) 2020-07-23 19:20:33 +02:00
Simone Mainardi
99a083251e Prevents loading of non-lua files in plugin load_definitions 2020-07-23 18:14:45 +02:00
Luca Deri
b1a17d990f Added check to avoid copying non .lua files when plugin directories are created 2020-06-12 08:09:41 +02:00
Simone Mainardi
f3b2b4869e Fixes broken plugin menu entries with --http-prefix
Addresses #3957
2020-05-20 12:07:22 +02:00
emanuele-f
7191f3e1a5 Add checks to avoid startup failures when plugins metadata does not exist 2020-04-27 12:25:48 +02:00