new(engine): don't expose details in error message

Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
This commit is contained in:
Gianmatteo Palmieri
2024-02-26 16:17:08 +01:00
committed by poiana
parent f00926b8af
commit 7265190e66
2 changed files with 6 additions and 2 deletions

View File

@@ -29,6 +29,10 @@ limitations under the License.
#define THROW(cond, err, ctx) { if ((cond)) { throw rule_loader::rule_load_exception(falco::load_result::LOAD_ERR_YAML_VALIDATE, (err), (ctx)); } }
// Sinsp Filter grammar tokens taken from "libsinsp/filter/parser.h"
// These regular expressions are used here to check for invalid macro/list names
// todo(mrgian): to avoid code duplication we can move regex definitions in libsinsp/filter/parser.h
// and include it here instead of redefining them.
#define RGX_IDENTIFIER "([a-zA-Z]+[a-zA-Z0-9_]*)"
#define RGX_BARESTR "([^()\"'[:space:]=,]+)"

View File

@@ -22,6 +22,6 @@
#define ERROR_NO_PREVIOUS_RULE_REPLACE "An 'override.<key>: replace' to a rule was requested but no rule by that name already exists"
#define ERROR_INVALID_MACRO_NAME "Macro has an invalid name. Macro names must match the Identifier regular expression: "
#define ERROR_INVALID_MACRO_NAME "Macro has an invalid name. Macro names must match a regular expression: "
#define ERROR_INVALID_LIST_NAME "List has an invalid name. List names must match the BareStr regular expression: "
#define ERROR_INVALID_LIST_NAME "List has an invalid name. List names must match a regular expression: "