mirror of https://github.com/MISP/MISP
chg: [event:alert] Added option to refresh to ban
parent
b71c73a304
commit
95ceeebebb
|
@ -7353,7 +7353,15 @@ class Event extends AppModel
|
|||
if (!empty($banLiftTimestamp)) {
|
||||
$remainingMinutes = (intval($banLiftTimestamp) - time()) / 60;
|
||||
$banStatus['active'] = true;
|
||||
$banStatus['message'] = __('Reason: Event is banned from sending out emails. Ban will be lifted in %smin %ssec.', floor($remainingMinutes), $remainingMinutes % 60);
|
||||
if (Configure::read('MISP.event_alert_republish_ban_refresh_on_retry')) {
|
||||
$redis->multi(Redis::PIPELINE)
|
||||
->set($redisKey, time() + $banThresholdSeconds)
|
||||
->expire($redisKey, $banThresholdSeconds)
|
||||
->exec();
|
||||
$banStatus['message'] = __('Reason: Event is banned from sending out emails. Ban has been refreshed and will be lifted in %smin', $banThresholdMinutes);
|
||||
} else {
|
||||
$banStatus['message'] = __('Reason: Event is banned from sending out emails. Ban will be lifted in %smin %ssec.', floor($remainingMinutes), $remainingMinutes % 60);
|
||||
}
|
||||
return $banStatus;
|
||||
} else {
|
||||
$redis->multi(Redis::PIPELINE)
|
||||
|
|
|
@ -5340,6 +5340,15 @@ class Server extends AppModel
|
|||
'type' => 'numeric',
|
||||
'null' => false,
|
||||
),
|
||||
'event_alert_republish_ban_refresh_on_retry' => array(
|
||||
'level' => 1,
|
||||
'description' => __('If the MISP.event_alert_republish_ban setting is set, this setting will control if a ban time should be reset if emails are tried to be sent during the ban.'),
|
||||
'value' => false,
|
||||
'errorMessage' => '',
|
||||
'test' => 'testBool',
|
||||
'type' => 'boolean',
|
||||
'null' => false,
|
||||
),
|
||||
'org_alert_threshold' => array(
|
||||
'level' => 1,
|
||||
'description' => __('Set a value to limit the number of email alerts that events can generate per creator organisation (for example, if an organisation pushes out 2000 events in one shot, only alert on the first 20).'),
|
||||
|
|
Loading…
Reference in New Issue