From 49cf90dd6d0c1d271df1e946beadf026d18c6e49 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 3 Sep 2025 14:25:09 +0100 Subject: [PATCH] ids.cgi: Allow to choose which alerts to send by email Signed-off-by: Michael Tremer --- config/cfgroot/ids-functions.pl | 5 ++++ doc/language_issues.en | 5 ++++ doc/language_issues.es | 5 ++++ doc/language_issues.fr | 5 ++++ doc/language_issues.it | 5 ++++ doc/language_issues.nl | 5 ++++ doc/language_issues.pl | 5 ++++ doc/language_issues.ru | 5 ++++ doc/language_issues.tr | 5 ++++ doc/language_issues.tw | 5 ++++ doc/language_issues.zh | 5 ++++ doc/language_missings | 45 +++++++++++++++++++++++++++++++++ html/cgi-bin/ids.cgi | 27 ++++++++++++++++++++ langs/de/cgi-bin/de.pl | 5 ++++ langs/en/cgi-bin/en.pl | 5 ++++ 15 files changed, 137 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 0239037f9..14212930e 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -1781,6 +1781,11 @@ sub generate_report_generator_config() { print FILE "sender = $idssettings{'EMAIL_SENDER'}\n"; print FILE "recipients = $idssettings{'EMAIL_RECIPIENTS'}\n"; + # Optionally add the severity + if ($idssettings{'EMAIL_ALERT_SEVERITY'}) { + print FILE "severity = $idssettings{'EMAIL_ALERT_SEVERITY'}\n"; + } + close(FILE); } diff --git a/doc/language_issues.en b/doc/language_issues.en index ddf82764c..6dfada328 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -1031,6 +1031,7 @@ WARNING: untranslated string: idle timeout = Idle timeout (mins; 0 to disable): WARNING: untranslated string: idle timeout not set = Idle timeout not set. WARNING: untranslated string: ids add provider = Add provider WARNING: untranslated string: ids adjust ruleset = Adjust rules and add user defined customizations... +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts WARNING: untranslated string: ids apply = Apply WARNING: untranslated string: ids apply ruleset changes = The ruleset changes are being applied. Please wait until all operations have completed successfully... WARNING: untranslated string: ids autoupdates = Automatic updates @@ -1038,6 +1039,7 @@ WARNING: untranslated string: ids cleanup tmp dir = Cleanup temporary directory. WARNING: untranslated string: ids could not add provider = Could not add provider WARNING: untranslated string: ids customize ruleset = Customize ruleset WARNING: untranslated string: ids download new ruleset = Downloading and unpacking new ruleset. Please wait until all operations have completed successfully... +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address @@ -1047,6 +1049,9 @@ WARNING: untranslated string: ids extract ruleset = Extracting ruleset for provi WARNING: untranslated string: ids finished = Finished... WARNING: untranslated string: ids force ruleset update = Force ruleset update WARNING: untranslated string: ids hide = Hide +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids ignored hosts = Whitelisted Hosts WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids log hits = Total of number of activated rules for diff --git a/doc/language_issues.es b/doc/language_issues.es index cf4bee835..cadfaf5d6 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -1056,9 +1056,14 @@ WARNING: untranslated string: guardian logtarget_file = unknown string WARNING: untranslated string: guardian logtarget_syslog = unknown string WARNING: untranslated string: guardian no entries = unknown string WARNING: untranslated string: guardian service = unknown string +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids no email recipients = No email recipients given WARNING: untranslated string: ids no email sender = No sender email address specified diff --git a/doc/language_issues.fr b/doc/language_issues.fr index 0f1aefe31..a03241bce 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -1044,9 +1044,14 @@ WARNING: untranslated string: guardian logtarget_syslog = unknown string WARNING: untranslated string: guardian no entries = unknown string WARNING: untranslated string: guardian service = unknown string WARNING: untranslated string: hostile networks total = Total Hostile Networks +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids no email recipients = No email recipients given WARNING: untranslated string: ids no email sender = No sender email address specified diff --git a/doc/language_issues.it b/doc/language_issues.it index 0a12b68a5..d5fdcd55e 100644 --- a/doc/language_issues.it +++ b/doc/language_issues.it @@ -1155,6 +1155,7 @@ WARNING: untranslated string: hostile networks out = To Hostile Networks WARNING: untranslated string: hostile networks total = Total Hostile Networks WARNING: untranslated string: ids add provider = Add provider WARNING: untranslated string: ids adjust ruleset = Adjust rules and add user defined customizations... +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts WARNING: untranslated string: ids apply = Apply WARNING: untranslated string: ids apply ruleset changes = The ruleset changes are being applied. Please wait until all operations have completed successfully... WARNING: untranslated string: ids autoupdates = Automatic updates @@ -1162,6 +1163,7 @@ WARNING: untranslated string: ids cleanup tmp dir = Cleanup temporary directory. WARNING: untranslated string: ids could not add provider = Could not add provider WARNING: untranslated string: ids customize ruleset = Customize ruleset WARNING: untranslated string: ids download new ruleset = Downloading and unpacking new ruleset. Please wait until all operations have completed successfully... +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address @@ -1171,6 +1173,9 @@ WARNING: untranslated string: ids extract ruleset = Extracting ruleset for provi WARNING: untranslated string: ids finished = Finished... WARNING: untranslated string: ids force ruleset update = Force ruleset update WARNING: untranslated string: ids hide = Hide +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids ignored hosts = Whitelisted Hosts WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids log hits = Total of number of activated rules for diff --git a/doc/language_issues.nl b/doc/language_issues.nl index 2d3bb45a8..72af4fba5 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -1161,6 +1161,7 @@ WARNING: untranslated string: hostile networks out = To Hostile Networks WARNING: untranslated string: hostile networks total = Total Hostile Networks WARNING: untranslated string: ids add provider = Add provider WARNING: untranslated string: ids adjust ruleset = Adjust rules and add user defined customizations... +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts WARNING: untranslated string: ids apply = Apply WARNING: untranslated string: ids apply ruleset changes = The ruleset changes are being applied. Please wait until all operations have completed successfully... WARNING: untranslated string: ids autoupdates = Automatic updates @@ -1168,6 +1169,7 @@ WARNING: untranslated string: ids cleanup tmp dir = Cleanup temporary directory. WARNING: untranslated string: ids could not add provider = Could not add provider WARNING: untranslated string: ids customize ruleset = Customize ruleset WARNING: untranslated string: ids download new ruleset = Downloading and unpacking new ruleset. Please wait until all operations have completed successfully... +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address @@ -1177,6 +1179,9 @@ WARNING: untranslated string: ids extract ruleset = Extracting ruleset for provi WARNING: untranslated string: ids finished = Finished... WARNING: untranslated string: ids force ruleset update = Force ruleset update WARNING: untranslated string: ids hide = Hide +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids ignored hosts = Whitelisted Hosts WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids log hits = Total of number of activated rules for diff --git a/doc/language_issues.pl b/doc/language_issues.pl index 79251b0b4..c89dd9966 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -1280,6 +1280,7 @@ WARNING: untranslated string: hostile networks out = To Hostile Networks WARNING: untranslated string: hostile networks total = Total Hostile Networks WARNING: untranslated string: ids add provider = Add provider WARNING: untranslated string: ids adjust ruleset = Adjust rules and add user defined customizations... +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts WARNING: untranslated string: ids apply = Apply WARNING: untranslated string: ids apply ruleset changes = The ruleset changes are being applied. Please wait until all operations have completed successfully... WARNING: untranslated string: ids autoupdates = Automatic updates @@ -1287,6 +1288,7 @@ WARNING: untranslated string: ids cleanup tmp dir = Cleanup temporary directory. WARNING: untranslated string: ids could not add provider = Could not add provider WARNING: untranslated string: ids customize ruleset = Customize ruleset WARNING: untranslated string: ids download new ruleset = Downloading and unpacking new ruleset. Please wait until all operations have completed successfully... +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address @@ -1296,6 +1298,9 @@ WARNING: untranslated string: ids extract ruleset = Extracting ruleset for provi WARNING: untranslated string: ids finished = Finished... WARNING: untranslated string: ids force ruleset update = Force ruleset update WARNING: untranslated string: ids hide = Hide +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids ignored hosts = Whitelisted Hosts WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids log hits = Total of number of activated rules for diff --git a/doc/language_issues.ru b/doc/language_issues.ru index 8d3d379f8..2377115ab 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -1278,6 +1278,7 @@ WARNING: untranslated string: hostile networks out = To Hostile Networks WARNING: untranslated string: hostile networks total = Total Hostile Networks WARNING: untranslated string: ids add provider = Add provider WARNING: untranslated string: ids adjust ruleset = Adjust rules and add user defined customizations... +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts WARNING: untranslated string: ids apply = Apply WARNING: untranslated string: ids apply ruleset changes = The ruleset changes are being applied. Please wait until all operations have completed successfully... WARNING: untranslated string: ids autoupdates = Automatic updates @@ -1285,6 +1286,7 @@ WARNING: untranslated string: ids cleanup tmp dir = Cleanup temporary directory. WARNING: untranslated string: ids could not add provider = Could not add provider WARNING: untranslated string: ids customize ruleset = Customize ruleset WARNING: untranslated string: ids download new ruleset = Downloading and unpacking new ruleset. Please wait until all operations have completed successfully... +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address @@ -1294,6 +1296,9 @@ WARNING: untranslated string: ids extract ruleset = Extracting ruleset for provi WARNING: untranslated string: ids finished = Finished... WARNING: untranslated string: ids force ruleset update = Force ruleset update WARNING: untranslated string: ids hide = Hide +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids ignored hosts = Whitelisted Hosts WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids log hits = Total of number of activated rules for diff --git a/doc/language_issues.tr b/doc/language_issues.tr index 42230af94..dfabd029e 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -1099,6 +1099,7 @@ WARNING: untranslated string: hostile networks out = To Hostile Networks WARNING: untranslated string: hostile networks total = Total Hostile Networks WARNING: untranslated string: ids add provider = Add provider WARNING: untranslated string: ids adjust ruleset = Adjust rules and add user defined customizations... +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts WARNING: untranslated string: ids apply = Apply WARNING: untranslated string: ids apply ruleset changes = The ruleset changes are being applied. Please wait until all operations have completed successfully... WARNING: untranslated string: ids autoupdates = Automatic updates @@ -1106,6 +1107,7 @@ WARNING: untranslated string: ids cleanup tmp dir = Cleanup temporary directory. WARNING: untranslated string: ids could not add provider = Could not add provider WARNING: untranslated string: ids customize ruleset = Customize ruleset WARNING: untranslated string: ids download new ruleset = Downloading and unpacking new ruleset. Please wait until all operations have completed successfully... +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address @@ -1115,6 +1117,9 @@ WARNING: untranslated string: ids extract ruleset = Extracting ruleset for provi WARNING: untranslated string: ids finished = Finished... WARNING: untranslated string: ids force ruleset update = Force ruleset update WARNING: untranslated string: ids hide = Hide +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids ignored hosts = Whitelisted Hosts WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids log hits = Total of number of activated rules for diff --git a/doc/language_issues.tw b/doc/language_issues.tw index c271e52b2..2745a25ba 100644 --- a/doc/language_issues.tw +++ b/doc/language_issues.tw @@ -1065,9 +1065,14 @@ WARNING: untranslated string: guardian logtarget_file = unknown string WARNING: untranslated string: guardian logtarget_syslog = unknown string WARNING: untranslated string: guardian no entries = unknown string WARNING: untranslated string: guardian service = unknown string +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids no email recipients = No email recipients given WARNING: untranslated string: ids no email sender = No sender email address specified diff --git a/doc/language_issues.zh b/doc/language_issues.zh index c271e52b2..2745a25ba 100644 --- a/doc/language_issues.zh +++ b/doc/language_issues.zh @@ -1065,9 +1065,14 @@ WARNING: untranslated string: guardian logtarget_file = unknown string WARNING: untranslated string: guardian logtarget_syslog = unknown string WARNING: untranslated string: guardian no entries = unknown string WARNING: untranslated string: guardian service = unknown string +WARNING: untranslated string: ids all including informational = All, Including Informational Alerts +WARNING: untranslated string: ids email alert severity = Severity WARNING: untranslated string: ids email alerts = Email Alerts WARNING: untranslated string: ids email recipients = Recipients WARNING: untranslated string: ids email sender = Sender Address +WARNING: untranslated string: ids high and medium severity = High and Medium Severity +WARNING: untranslated string: ids high severity only = High Severity Only +WARNING: untranslated string: ids high, medium and low severity = High, Medium, and Low Severity WARNING: untranslated string: ids invalid mail address = Is or contains an invalid mail address. WARNING: untranslated string: ids no email recipients = No email recipients given WARNING: untranslated string: ids no email sender = No sender email address specified diff --git a/doc/language_missings b/doc/language_missings index 4ac744e6c..03c286f5a 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -156,9 +156,14 @@ < AES-256-GCM < CHACHA20-POLY1305 < dns servers +< ids all including informational < ids email alerts +< ids email alert severity < ids email recipients < ids email sender +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids invalid mail address < ids no email recipients < ids no email sender @@ -217,9 +222,14 @@ < g.dtm < g.lite < hostile networks total +< ids all including informational < ids email alerts +< ids email alert severity < ids email recipients < ids email sender +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids invalid mail address < ids no email recipients < ids no email sender @@ -572,6 +582,7 @@ < hostile networks total < ids add provider < ids adjust ruleset +< ids all including informational < ids apply < ids apply ruleset changes < ids automatic rules update @@ -581,6 +592,7 @@ < ids customize ruleset < ids download new ruleset < ids email alerts +< ids email alert severity < ids email recipients < ids email sender < ids enable @@ -589,6 +601,9 @@ < ids finished < ids force ruleset update < ids hide +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids ignored hosts < ids invalid mail address < ids log hits @@ -1226,6 +1241,7 @@ < hostile networks total < ids add provider < ids adjust ruleset +< ids all including informational < ids apply < ids apply ruleset changes < ids automatic rules update @@ -1235,6 +1251,7 @@ < ids customize ruleset < ids download new ruleset < ids email alerts +< ids email alert severity < ids email recipients < ids email sender < ids enable @@ -1243,6 +1260,9 @@ < ids finished < ids force ruleset update < ids hide +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids ignored hosts < ids invalid mail address < ids log hits @@ -2182,6 +2202,7 @@ < hostile networks total < ids add provider < ids adjust ruleset +< ids all including informational < ids apply < ids apply ruleset changes < ids automatic rules update @@ -2191,6 +2212,7 @@ < ids customize ruleset < ids download new ruleset < ids email alerts +< ids email alert severity < ids email recipients < ids email sender < ids enable @@ -2199,6 +2221,9 @@ < ids finished < ids force ruleset update < ids hide +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids ignored hosts < ids invalid mail address < ids log hits @@ -3306,6 +3331,7 @@ < hour-graph < ids add provider < ids adjust ruleset +< ids all including informational < ids apply < ids apply ruleset changes < ids automatic rules update @@ -3315,6 +3341,7 @@ < ids customize ruleset < ids download new ruleset < ids email alerts +< ids email alert severity < ids email recipients < ids email sender < ids enable @@ -3323,6 +3350,9 @@ < ids finished < ids force ruleset update < ids hide +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids ignored hosts < ids invalid mail address < ids log hits @@ -4024,6 +4054,7 @@ < hostile networks total < ids add provider < ids adjust ruleset +< ids all including informational < ids apply < ids apply ruleset changes < ids automatic rules update @@ -4033,6 +4064,7 @@ < ids customize ruleset < ids download new ruleset < ids email alerts +< ids email alert severity < ids email recipients < ids email sender < ids enable @@ -4041,6 +4073,9 @@ < ids finished < ids force ruleset update < ids hide +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids ignored hosts < ids invalid mail address < ids log hits @@ -4365,9 +4400,14 @@ < CHACHA20-POLY1305 < dns servers < guaranteed bandwidth +< ids all including informational < ids email alerts +< ids email alert severity < ids email recipients < ids email sender +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids invalid mail address < ids no email recipients < ids no email sender @@ -4423,9 +4463,14 @@ < CHACHA20-POLY1305 < dns servers < guaranteed bandwidth +< ids all including informational < ids email alerts +< ids email alert severity < ids email recipients < ids email sender +< ids high and medium severity +< ids high, medium and low severity +< ids high severity only < ids invalid mail address < ids no email recipients < ids no email sender diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index ee5c3d1eb..6398e047b 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -1037,6 +1037,8 @@ sub show_mainpage() { $checked{'ENABLE_EMAIL'}{'on'} = ''; $checked{'ENABLE_EMAIL'}{$idssettings{'ENABLE_EMAIL'}} = "checked='checked'"; + $selected{'EMAIL_ALERT_SEVERITY'}{$idssettings{'EMAIL_ALERT_SEVERITY'}} = "selected"; + $checked{'ENABLE_REPORT_DAILY'}{'off'} = ''; $checked{'ENABLE_REPORT_DAILY'}{'on'} = ''; $checked{'ENABLE_REPORT_DAILY'}{$idssettings{'ENABLE_REPORT_DAILY'}} = "checked='checked'"; @@ -1179,6 +1181,31 @@ print < + + + + + + + + + +