From bc4e0e09e29167d79744609be4760c9d84a6a9f8 Mon Sep 17 00:00:00 2001 From: sanathkumarbs Date: Thu, 10 Nov 2022 12:21:48 -0800 Subject: [PATCH] fix: use lower case for all severity values --- src/extensions/nginx-app-protect/monitoring/processor/nap.go | 2 +- .../testData/events-out/expanded_nap_waf.log.txt.out | 4 ++-- .../testData/events-out/xml_header_data.log.txt.out | 4 ++-- .../testData/events-out/xml_parameter_data.log.txt.out | 4 ++-- .../events-out/xml_parameter_data_as_param_data.log.txt.out | 4 ++-- .../events-out/xml_parameter_data_empty_context.log.txt.out | 4 ++-- .../testData/events-out/xml_signature_data.log.txt.out | 4 ++-- .../testData/events-out/xml_violation_name.log.txt.out | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/extensions/nginx-app-protect/monitoring/processor/nap.go b/src/extensions/nginx-app-protect/monitoring/processor/nap.go index 6d824f1ba..ea34ce712 100644 --- a/src/extensions/nginx-app-protect/monitoring/processor/nap.go +++ b/src/extensions/nginx-app-protect/monitoring/processor/nap.go @@ -460,7 +460,7 @@ func setValue(napConfig *NAPConfig, key, value string, logger *logrus.Entry) err case requestStatus: napConfig.RequestStatus = value case severity: - napConfig.Severity = value + napConfig.Severity = strings.ToLower(value) case sigSetNames: napConfig.SigSetNames = replaceEncodedList(value, listSeperator) case threatCampaignNames: diff --git a/test/component/nginx-app-protect/monitoring/testData/events-out/expanded_nap_waf.log.txt.out b/test/component/nginx-app-protect/monitoring/testData/events-out/expanded_nap_waf.log.txt.out index 40b6b6137..793d833b7 100755 --- a/test/component/nginx-app-protect/monitoring/testData/events-out/expanded_nap_waf.log.txt.out +++ b/test/component/nginx-app-protect/monitoring/testData/events-out/expanded_nap_waf.log.txt.out @@ -1,8 +1,8 @@ j -Agent$c9f9fc06-6071-11ed-8415-5671f551701b4355056874564592513" ת*ERROR2Nginx: +Agent$638d54bc-6135-11ed-8afe-5671f551701b4355056874564592513" *ERROR2Nginx: AppProtect -app_protect_default_policy4355056874564592513REJECTED"SECURITY_WAF_VIOLATION*N/A2GET:HTTPBN/AJ/RHTTP/1.1bblockedjBlockedz1-localhost:1-/ 127.0.0.16147880HTTP protocol compliance failed,Illegal meta character in value,Attack signature detected,Violation Rating Threat detected,Bot Client Detected?HTTP protocol compliance failed:Host header contains IP address5u{Cross Site Scripting Signatures;High Accuracy Signatures},{Cross Site Scripting Signatures;High Accuracy Signatures}, Untrusted BotN/AN/ACriticalN/AN/A HTTP LibraryN/Acurl parameteru +app_protect_default_policy4355056874564592513REJECTED"SECURITY_WAF_VIOLATION*N/A2GET:HTTPBN/AJ/RHTTP/1.1bblockedjBlockedz1-localhost:1-/ 127.0.0.16147880HTTP protocol compliance failed,Illegal meta character in value,Attack signature detected,Violation Rating Threat detected,Bot Client Detected?HTTP protocol compliance failed:Host header contains IP address5u{Cross Site Scripting Signatures;High Accuracy Signatures},{Cross Site Scripting Signatures;High Accuracy Signatures}, Untrusted BotN/AN/AcriticalN/AN/A HTTP LibraryN/Acurl parameteru VIOL_ATTACK_SIGNATURE parameter a