-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a62b5d
commit 819f398
Showing
10 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* | ||
* (C) 2013-24 - ntop.org | ||
* | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
* | ||
*/ | ||
|
||
#ifndef _ACCESS_CONTROL_LIST_ALERT_H_ | ||
#define _ACCESS_CONTROL_LIST_ALERT_H_ | ||
|
||
#include "ntop_includes.h" | ||
|
||
class AccessControlListAlert : public FlowAlert { | ||
public: | ||
static FlowAlertType getClassType() { | ||
return {flow_alert_access_control_list, alert_category_network}; | ||
} | ||
static u_int8_t getDefaultScore() { return SCORE_LEVEL_ERROR; }; | ||
|
||
AccessControlListAlert(FlowCheck *c, Flow *f) : FlowAlert(c, f){}; | ||
~AccessControlListAlert(){}; | ||
|
||
FlowAlertType getAlertType() const { return getClassType(); } | ||
}; | ||
|
||
#endif /* _ACCESS_CONTROL_LIST_ALERT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
scripts/lua/modules/alert_definitions/flow/alert_access_control_list.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
-- | ||
-- (C) 2019-24 - ntop.org | ||
-- | ||
|
||
-- ############################################## | ||
|
||
local flow_alert_keys = require "flow_alert_keys" | ||
-- Import the classes library. | ||
local classes = require "classes" | ||
-- Make sure to import the Superclass! | ||
local alert = require "alert" | ||
local json = require "dkjson" | ||
-- Import Mitre Att&ck utils | ||
local mitre = require "mitre_utils" | ||
|
||
-- ############################################## | ||
|
||
local alert_access_control_list = classes.class(alert) | ||
|
||
-- ############################################## | ||
|
||
alert_access_control_list.meta = { | ||
alert_key = flow_alert_keys.flow_alert_access_control_list, | ||
icon = "fas fa-fw fa-exclamation", | ||
i18n_title = "alerts_dashboard.access_control_list", | ||
} | ||
|
||
-- ############################################## | ||
|
||
-- @brief Prepare an alert table used to generate the alert | ||
-- @return A table with the alert built | ||
function alert_access_control_list:init() | ||
-- Call the parent constructor | ||
self.super:init() | ||
end | ||
|
||
-- ####################################################### | ||
|
||
-- @brief Format an alert into a human-readable string | ||
-- @param ifid The integer interface id of the generated alert | ||
-- @param alert The alert description table, including alert data such as the generating entity, timestamp, granularity, type | ||
-- @param alert_type_params Table `alert_type_params` as built in the `:init` method | ||
-- @return A human-readable string | ||
function alert_access_control_list.format(ifid, alert, alert_type_params) | ||
-- Extracting info field | ||
local href = ntop.getHttpPrefix() .. '/lua/pro/admin/access_control_list.lua' | ||
return(i18n("alerts_dashboard.access_control_list_descr", { href = href })) | ||
end | ||
|
||
-- ####################################################### | ||
|
||
return alert_access_control_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters