Skip to content

Commit 6cb99e1

Browse files
committed
wip
1 parent 7061c15 commit 6cb99e1

File tree

6 files changed

+0
-82
lines changed

6 files changed

+0
-82
lines changed

pkg/acquisition/modules/appsec/appsec_hooks_test.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
1818
tests := []appsecRuleTest{
1919
{
2020
name: "no rule : check return code",
21-
expected_load_ok: true,
2221
inband_rules: []appsec_rule.CustomRule{
2322
{
2423
Name: "rule1",
@@ -46,7 +45,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
4645
},
4746
{
4847
name: "on_match: change return code",
49-
expected_load_ok: true,
5048
inband_rules: []appsec_rule.CustomRule{
5149
{
5250
Name: "rule1",
@@ -77,7 +75,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
7775
},
7876
{
7977
name: "on_match: change action to a non standard one (log)",
80-
expected_load_ok: true,
8178
inband_rules: []appsec_rule.CustomRule{
8279
{
8380
Name: "rule1",
@@ -108,7 +105,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
108105
},
109106
{
110107
name: "on_match: change action to another standard one (allow)",
111-
expected_load_ok: true,
112108
inband_rules: []appsec_rule.CustomRule{
113109
{
114110
Name: "rule1",
@@ -137,7 +133,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
137133
},
138134
{
139135
name: "on_match: change action to another standard one (ban)",
140-
expected_load_ok: true,
141136
inband_rules: []appsec_rule.CustomRule{
142137
{
143138
Name: "rule1",
@@ -164,7 +159,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
164159
},
165160
{
166161
name: "on_match: change action to another standard one (captcha)",
167-
expected_load_ok: true,
168162
inband_rules: []appsec_rule.CustomRule{
169163
{
170164
Name: "rule1",
@@ -191,7 +185,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
191185
},
192186
{
193187
name: "on_match: change action to a non standard one",
194-
expected_load_ok: true,
195188
inband_rules: []appsec_rule.CustomRule{
196189
{
197190
Name: "rule1",
@@ -220,7 +213,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
220213
},
221214
{
222215
name: "on_match: cancel alert",
223-
expected_load_ok: true,
224216
inband_rules: []appsec_rule.CustomRule{
225217
{
226218
Name: "rule42",
@@ -248,7 +240,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
248240
},
249241
{
250242
name: "on_match: cancel event",
251-
expected_load_ok: true,
252243
inband_rules: []appsec_rule.CustomRule{
253244
{
254245
Name: "rule42",
@@ -276,7 +267,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
276267
},
277268
{
278269
name: "on_match: on_success break",
279-
expected_load_ok: true,
280270
inband_rules: []appsec_rule.CustomRule{
281271
{
282272
Name: "rule42",
@@ -305,7 +295,6 @@ func TestAppsecOnMatchHooks(t *testing.T) {
305295
},
306296
{
307297
name: "on_match: on_success continue",
308-
expected_load_ok: true,
309298
inband_rules: []appsec_rule.CustomRule{
310299
{
311300
Name: "rule42",
@@ -345,7 +334,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
345334
tests := []appsecRuleTest{
346335
{
347336
name: "Basic pre_eval hook to disable inband rule",
348-
expected_load_ok: true,
349337
inband_rules: []appsec_rule.CustomRule{
350338
{
351339
Name: "rule1",
@@ -373,7 +361,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
373361
},
374362
{
375363
name: "Basic pre_eval fails to disable rule",
376-
expected_load_ok: true,
377364
inband_rules: []appsec_rule.CustomRule{
378365
{
379366
Name: "rule1",
@@ -408,7 +395,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
408395
},
409396
{
410397
name: "pre_eval : disable inband by tag",
411-
expected_load_ok: true,
412398
inband_rules: []appsec_rule.CustomRule{
413399
{
414400
Name: "rulez",
@@ -436,7 +422,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
436422
},
437423
{
438424
name: "pre_eval : disable inband by ID",
439-
expected_load_ok: true,
440425
inband_rules: []appsec_rule.CustomRule{
441426
{
442427
Name: "rulez",
@@ -464,7 +449,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
464449
},
465450
{
466451
name: "pre_eval : disable inband by name",
467-
expected_load_ok: true,
468452
inband_rules: []appsec_rule.CustomRule{
469453
{
470454
Name: "rulez",
@@ -492,7 +476,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
492476
},
493477
{
494478
name: "pre_eval : outofband default behavior",
495-
expected_load_ok: true,
496479
outofband_rules: []appsec_rule.CustomRule{
497480
{
498481
Name: "rulez",
@@ -523,7 +506,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
523506
},
524507
{
525508
name: "pre_eval : set remediation by tag",
526-
expected_load_ok: true,
527509
inband_rules: []appsec_rule.CustomRule{
528510
{
529511
Name: "rulez",
@@ -550,7 +532,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
550532
},
551533
{
552534
name: "pre_eval : set remediation by name",
553-
expected_load_ok: true,
554535
inband_rules: []appsec_rule.CustomRule{
555536
{
556537
Name: "rulez",
@@ -577,7 +558,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
577558
},
578559
{
579560
name: "pre_eval : set remediation by ID",
580-
expected_load_ok: true,
581561
inband_rules: []appsec_rule.CustomRule{
582562
{
583563
Name: "rulez",
@@ -606,7 +586,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
606586
},
607587
{
608588
name: "pre_eval : on_success continue",
609-
expected_load_ok: true,
610589
inband_rules: []appsec_rule.CustomRule{
611590
{
612591
Name: "rulez",
@@ -634,7 +613,6 @@ func TestAppsecPreEvalHooks(t *testing.T) {
634613
},
635614
{
636615
name: "pre_eval : on_success break",
637-
expected_load_ok: true,
638616
inband_rules: []appsec_rule.CustomRule{
639617
{
640618
Name: "rulez",
@@ -674,7 +652,6 @@ func TestAppsecRemediationConfigHooks(t *testing.T) {
674652
tests := []appsecRuleTest{
675653
{
676654
name: "Basic matching rule",
677-
expected_load_ok: true,
678655
inband_rules: []appsec_rule.CustomRule{
679656
{
680657
Name: "rule1",
@@ -699,7 +676,6 @@ func TestAppsecRemediationConfigHooks(t *testing.T) {
699676
},
700677
{
701678
name: "SetRemediation",
702-
expected_load_ok: true,
703679
inband_rules: []appsec_rule.CustomRule{
704680
{
705681
Name: "rule1",
@@ -726,7 +702,6 @@ func TestAppsecRemediationConfigHooks(t *testing.T) {
726702
},
727703
{
728704
name: "SetRemediation",
729-
expected_load_ok: true,
730705
inband_rules: []appsec_rule.CustomRule{
731706
{
732707
Name: "rule1",
@@ -763,7 +738,6 @@ func TestOnMatchRemediationHooks(t *testing.T) {
763738
tests := []appsecRuleTest{
764739
{
765740
name: "set remediation to allow with on_match hook",
766-
expected_load_ok: true,
767741
inband_rules: []appsec_rule.CustomRule{
768742
{
769743
Name: "rule42",
@@ -789,7 +763,6 @@ func TestOnMatchRemediationHooks(t *testing.T) {
789763
},
790764
{
791765
name: "set remediation to captcha + custom user code with on_match hook",
792-
expected_load_ok: true,
793766
inband_rules: []appsec_rule.CustomRule{
794767
{
795768
Name: "rule42",
@@ -821,7 +794,6 @@ func TestOnMatchRemediationHooks(t *testing.T) {
821794
},
822795
{
823796
name: "on_match: on_success break",
824-
expected_load_ok: true,
825797
inband_rules: []appsec_rule.CustomRule{
826798
{
827799
Name: "rule42",
@@ -854,7 +826,6 @@ func TestOnMatchRemediationHooks(t *testing.T) {
854826
},
855827
{
856828
name: "on_match: on_success continue",
857-
expected_load_ok: true,
858829
inband_rules: []appsec_rule.CustomRule{
859830
{
860831
Name: "rule42",

pkg/acquisition/modules/appsec/appsec_lnx_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func TestAppsecRuleTransformsOthers(t *testing.T) {
1919
tests := []appsecRuleTest{
2020
{
2121
name: "normalizepath",
22-
expected_load_ok: true,
2322
inband_rules: []appsec_rule.CustomRule{
2423
{
2524
Name: "rule1",
@@ -43,7 +42,6 @@ func TestAppsecRuleTransformsOthers(t *testing.T) {
4342
},
4443
{
4544
name: "normalizepath #2",
46-
expected_load_ok: true,
4745
inband_rules: []appsec_rule.CustomRule{
4846
{
4947
Name: "rule1",

pkg/acquisition/modules/appsec/appsec_remediation_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) {
1616
tests := []appsecRuleTest{
1717
{
1818
name: "Basic non-matching rule",
19-
expected_load_ok: true,
2019
inband_rules: []appsec_rule.CustomRule{
2120
{
2221
Name: "rule1",
@@ -41,7 +40,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) {
4140
},
4241
{
4342
name: "DefaultPassAction: pass",
44-
expected_load_ok: true,
4543
inband_rules: []appsec_rule.CustomRule{
4644
{
4745
Name: "rule1",
@@ -67,7 +65,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) {
6765
},
6866
{
6967
name: "DefaultPassAction: captcha",
70-
expected_load_ok: true,
7168
inband_rules: []appsec_rule.CustomRule{
7269
{
7370
Name: "rule1",
@@ -93,7 +90,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) {
9390
},
9491
{
9592
name: "DefaultPassHTTPCode: 200",
96-
expected_load_ok: true,
9793
inband_rules: []appsec_rule.CustomRule{
9894
{
9995
Name: "rule1",
@@ -119,7 +115,6 @@ func TestAppsecDefaultPassRemediation(t *testing.T) {
119115
},
120116
{
121117
name: "DefaultPassHTTPCode: 200",
122-
expected_load_ok: true,
123118
inband_rules: []appsec_rule.CustomRule{
124119
{
125120
Name: "rule1",
@@ -155,7 +150,6 @@ func TestAppsecDefaultRemediation(t *testing.T) {
155150
tests := []appsecRuleTest{
156151
{
157152
name: "Basic matching rule",
158-
expected_load_ok: true,
159153
inband_rules: []appsec_rule.CustomRule{
160154
{
161155
Name: "rule1",
@@ -180,7 +174,6 @@ func TestAppsecDefaultRemediation(t *testing.T) {
180174
},
181175
{
182176
name: "default remediation to ban (default)",
183-
expected_load_ok: true,
184177
inband_rules: []appsec_rule.CustomRule{
185178
{
186179
Name: "rule42",
@@ -206,7 +199,6 @@ func TestAppsecDefaultRemediation(t *testing.T) {
206199
},
207200
{
208201
name: "default remediation to allow",
209-
expected_load_ok: true,
210202
inband_rules: []appsec_rule.CustomRule{
211203
{
212204
Name: "rule42",
@@ -232,7 +224,6 @@ func TestAppsecDefaultRemediation(t *testing.T) {
232224
},
233225
{
234226
name: "default remediation to captcha",
235-
expected_load_ok: true,
236227
inband_rules: []appsec_rule.CustomRule{
237228
{
238229
Name: "rule42",
@@ -258,7 +249,6 @@ func TestAppsecDefaultRemediation(t *testing.T) {
258249
},
259250
{
260251
name: "custom user HTTP code",
261-
expected_load_ok: true,
262252
inband_rules: []appsec_rule.CustomRule{
263253
{
264254
Name: "rule42",
@@ -284,7 +274,6 @@ func TestAppsecDefaultRemediation(t *testing.T) {
284274
},
285275
{
286276
name: "custom remediation + HTTP code",
287-
expected_load_ok: true,
288277
inband_rules: []appsec_rule.CustomRule{
289278
{
290279
Name: "rule42",

0 commit comments

Comments
 (0)