diff --git a/pkg/acquisition/modules/appsec/appsec_hooks_test.go b/pkg/acquisition/modules/appsec/appsec_hooks_test.go index c549d2ef1d1..43201420bcd 100644 --- a/pkg/acquisition/modules/appsec/appsec_hooks_test.go +++ b/pkg/acquisition/modules/appsec/appsec_hooks_test.go @@ -18,7 +18,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { tests := []appsecRuleTest{ { name: "no rule : check return code", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -46,7 +45,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: change return code", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -77,7 +75,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: change action to a non standard one (log)", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -108,7 +105,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: change action to another standard one (allow)", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -137,7 +133,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: change action to another standard one (ban)", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -164,7 +159,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: change action to another standard one (captcha)", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -191,7 +185,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: change action to a non standard one", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -220,7 +213,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: cancel alert", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -248,7 +240,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: cancel event", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -276,7 +267,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: on_success break", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -305,7 +295,6 @@ func TestAppsecOnMatchHooks(t *testing.T) { }, { name: "on_match: on_success continue", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -345,7 +334,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { tests := []appsecRuleTest{ { name: "Basic pre_eval hook to disable inband rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -373,7 +361,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "Basic pre_eval fails to disable rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -408,7 +395,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : disable inband by tag", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -436,7 +422,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : disable inband by ID", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -464,7 +449,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : disable inband by name", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -492,7 +476,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : outofband default behavior", - expected_load_ok: true, outofband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -523,7 +506,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : set remediation by tag", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -550,7 +532,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : set remediation by name", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -577,7 +558,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : set remediation by ID", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -606,7 +586,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : on_success continue", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -634,7 +613,6 @@ func TestAppsecPreEvalHooks(t *testing.T) { }, { name: "pre_eval : on_success break", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rulez", @@ -674,7 +652,6 @@ func TestAppsecRemediationConfigHooks(t *testing.T) { tests := []appsecRuleTest{ { name: "Basic matching rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -699,7 +676,6 @@ func TestAppsecRemediationConfigHooks(t *testing.T) { }, { name: "SetRemediation", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -726,7 +702,6 @@ func TestAppsecRemediationConfigHooks(t *testing.T) { }, { name: "SetRemediation", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -763,7 +738,6 @@ func TestOnMatchRemediationHooks(t *testing.T) { tests := []appsecRuleTest{ { name: "set remediation to allow with on_match hook", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -789,7 +763,6 @@ func TestOnMatchRemediationHooks(t *testing.T) { }, { name: "set remediation to captcha + custom user code with on_match hook", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -821,7 +794,6 @@ func TestOnMatchRemediationHooks(t *testing.T) { }, { name: "on_match: on_success break", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -854,7 +826,6 @@ func TestOnMatchRemediationHooks(t *testing.T) { }, { name: "on_match: on_success continue", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", diff --git a/pkg/acquisition/modules/appsec/appsec_lnx_test.go b/pkg/acquisition/modules/appsec/appsec_lnx_test.go index 61dfc536f5e..50813392102 100644 --- a/pkg/acquisition/modules/appsec/appsec_lnx_test.go +++ b/pkg/acquisition/modules/appsec/appsec_lnx_test.go @@ -19,7 +19,6 @@ func TestAppsecRuleTransformsOthers(t *testing.T) { tests := []appsecRuleTest{ { name: "normalizepath", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -43,7 +42,6 @@ func TestAppsecRuleTransformsOthers(t *testing.T) { }, { name: "normalizepath #2", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", diff --git a/pkg/acquisition/modules/appsec/appsec_remediation_test.go b/pkg/acquisition/modules/appsec/appsec_remediation_test.go index 06016b6251f..1cadbdd5db5 100644 --- a/pkg/acquisition/modules/appsec/appsec_remediation_test.go +++ b/pkg/acquisition/modules/appsec/appsec_remediation_test.go @@ -16,7 +16,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) { tests := []appsecRuleTest{ { name: "Basic non-matching rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -41,7 +40,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) { }, { name: "DefaultPassAction: pass", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -67,7 +65,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) { }, { name: "DefaultPassAction: captcha", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -93,7 +90,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) { }, { name: "DefaultPassHTTPCode: 200", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -119,7 +115,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) { }, { name: "DefaultPassHTTPCode: 200", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -155,7 +150,6 @@ func TestAppsecDefaultRemediation(t *testing.T) { tests := []appsecRuleTest{ { name: "Basic matching rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -180,7 +174,6 @@ func TestAppsecDefaultRemediation(t *testing.T) { }, { name: "default remediation to ban (default)", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -206,7 +199,6 @@ func TestAppsecDefaultRemediation(t *testing.T) { }, { name: "default remediation to allow", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -232,7 +224,6 @@ func TestAppsecDefaultRemediation(t *testing.T) { }, { name: "default remediation to captcha", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -258,7 +249,6 @@ func TestAppsecDefaultRemediation(t *testing.T) { }, { name: "custom user HTTP code", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -284,7 +274,6 @@ func TestAppsecDefaultRemediation(t *testing.T) { }, { name: "custom remediation + HTTP code", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", diff --git a/pkg/acquisition/modules/appsec/appsec_rules_test.go b/pkg/acquisition/modules/appsec/appsec_rules_test.go index 00093c5a5ad..c12c063b43c 100644 --- a/pkg/acquisition/modules/appsec/appsec_rules_test.go +++ b/pkg/acquisition/modules/appsec/appsec_rules_test.go @@ -17,7 +17,6 @@ func TestAppsecRuleMatches(t *testing.T) { tests := []appsecRuleTest{ { name: "Basic matching rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -49,7 +48,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "Basic non-matching rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -75,7 +73,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "default remediation to allow", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -102,7 +99,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "default remediation to captcha", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -129,7 +125,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "no default remediation / custom user HTTP code", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -156,7 +151,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "no match but try to set remediation to captcha with on_match hook", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -184,7 +178,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "no match but try to set user HTTP code with on_match hook", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -212,7 +205,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "no match but try to set remediation with pre_eval hook", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule42", @@ -240,7 +232,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "Basic matching in cookies", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -272,7 +263,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "Basic matching in all cookies", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -303,7 +293,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "Basic matching in cookie name", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -334,7 +323,6 @@ func TestAppsecRuleMatches(t *testing.T) { }, { name: "Basic matching in multipart file name", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -372,7 +360,6 @@ toto }, { name: "Basic matching IP address", - expected_load_ok: true, inband_native_rules: []string{ "SecRule REMOTE_ADDR \"@ipMatch 1.2.3.4\" \"id:1,phase:1,log,deny,msg: 'block ip'\"", }, @@ -410,7 +397,6 @@ func TestAppsecRuleTransforms(t *testing.T) { tests := []appsecRuleTest{ { name: "Basic matching rule", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -433,7 +419,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "lowercase", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -457,7 +442,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "uppercase", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -481,7 +465,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "b64decode", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -506,7 +489,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "b64decode with extra padding", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -531,7 +513,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "length", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -556,7 +537,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "urldecode", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -581,7 +561,6 @@ func TestAppsecRuleTransforms(t *testing.T) { }, { name: "trim", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -617,7 +596,6 @@ func TestAppsecRuleZones(t *testing.T) { tests := []appsecRuleTest{ { name: "rule: ARGS", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -645,7 +623,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: ARGS_NAMES", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -673,7 +650,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: BODY_ARGS", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -703,7 +679,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: BODY_ARGS_NAMES", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -733,7 +708,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: HEADERS", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -762,7 +736,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: HEADERS_NAMES", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -791,7 +764,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: METHOD", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -814,7 +786,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: PROTOCOL", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -838,7 +809,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: URI", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -861,7 +831,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: URI_FULL", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -884,7 +853,6 @@ func TestAppsecRuleZones(t *testing.T) { }, { name: "rule: RAW_BODY", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", diff --git a/pkg/acquisition/modules/appsec/appsec_runner_test.go b/pkg/acquisition/modules/appsec/appsec_runner_test.go index d07fb153186..e881c7bb471 100644 --- a/pkg/acquisition/modules/appsec/appsec_runner_test.go +++ b/pkg/acquisition/modules/appsec/appsec_runner_test.go @@ -13,7 +13,6 @@ func TestAppsecRuleLoad(t *testing.T) { tests := []appsecRuleTest{ { name: "simple rule load", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -27,7 +26,6 @@ func TestAppsecRuleLoad(t *testing.T) { }, { name: "simple native rule load", - expected_load_ok: true, inband_native_rules: []string{ `Secrule REQUEST_HEADERS:Content-Type "@rx ^application/x-www-form-urlencoded" "id:100,phase:1,pass,nolog,noauditlog,ctl:requestBodyProcessor=URLENCODED"`, }, @@ -37,7 +35,6 @@ func TestAppsecRuleLoad(t *testing.T) { }, { name: "simple native rule load (2)", - expected_load_ok: true, inband_native_rules: []string{ `Secrule REQUEST_HEADERS:Content-Type "@rx ^application/x-www-form-urlencoded" "id:100,phase:1,pass,nolog,noauditlog,ctl:requestBodyProcessor=URLENCODED"`, `Secrule REQUEST_HEADERS:Content-Type "@rx ^multipart/form-data" "id:101,phase:1,pass,nolog,noauditlog,ctl:requestBodyProcessor=MULTIPART"`, @@ -48,7 +45,6 @@ func TestAppsecRuleLoad(t *testing.T) { }, { name: "simple native rule load + dedup", - expected_load_ok: true, inband_native_rules: []string{ `Secrule REQUEST_HEADERS:Content-Type "@rx ^application/x-www-form-urlencoded" "id:100,phase:1,pass,nolog,noauditlog,ctl:requestBodyProcessor=URLENCODED"`, `Secrule REQUEST_HEADERS:Content-Type "@rx ^multipart/form-data" "id:101,phase:1,pass,nolog,noauditlog,ctl:requestBodyProcessor=MULTIPART"`, @@ -60,7 +56,6 @@ func TestAppsecRuleLoad(t *testing.T) { }, { name: "multi simple rule load", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -79,7 +74,6 @@ func TestAppsecRuleLoad(t *testing.T) { }, { name: "multi simple rule load", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", @@ -98,7 +92,6 @@ func TestAppsecRuleLoad(t *testing.T) { }, { name: "imbricated rule load", - expected_load_ok: true, inband_rules: []appsec_rule.CustomRule{ { Name: "rule1", diff --git a/pkg/acquisition/modules/appsec/appsec_win_test.go b/pkg/acquisition/modules/appsec/appsec_win_test.go index a6b8f3a0340..2d56bc12ae3 100644 --- a/pkg/acquisition/modules/appsec/appsec_win_test.go +++ b/pkg/acquisition/modules/appsec/appsec_win_test.go @@ -14,7 +14,6 @@ func TestAppsecRuleTransformsWindows(t *testing.T) { tests := []appsecRuleTest{ // { // name: "normalizepath", - // expected_load_ok: true, // inband_rules: []appsec_rule.CustomRule{ // { // Name: "rule1",