Skip to content

Commit fa792f1

Browse files
committed
WIP
1 parent c047924 commit fa792f1

File tree

14 files changed

+389
-6
lines changed

14 files changed

+389
-6
lines changed

manifests/cpp_nginx.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ tests/:
6565
Test_Blocking: v1.2.0
6666
Test_Blocking_strip_response_headers: irrelevant (no response headers on 1st waf run, which is where blocking is possible)
6767
Test_CustomBlockingResponse: v1.2.0
68+
test_blocking_security_response_id.py:
69+
Test_SecurityResponseId_Custom_Redirect: missing_feature
70+
Test_SecurityResponseId_HTML_Response: missing_feature
71+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
72+
Test_SecurityResponseId_JSON_Response: missing_feature
6873
test_custom_rules.py:
6974
Test_CustomRules: v1.2.0
7075
test_exclusions.py:

manifests/dotnet.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ tests/:
302302
Test_Blocking: v2.27.0
303303
Test_Blocking_strip_response_headers: missing_feature
304304
Test_CustomBlockingResponse: v3.10.0
305+
test_blocking_security_response_id.py:
306+
Test_SecurityResponseId_Custom_Redirect: missing_feature
307+
Test_SecurityResponseId_HTML_Response: missing_feature
308+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
309+
Test_SecurityResponseId_JSON_Response: missing_feature
305310
test_custom_rules.py:
306311
Test_CustomRules: v2.30.0
307312
test_exclusions.py:

manifests/golang.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ tests/:
350350
Test_Blocking: v1.50.0-rc.1
351351
Test_Blocking_strip_response_headers: missing_feature
352352
Test_CustomBlockingResponse: v1.63.0
353+
test_blocking_security_response_id.py:
354+
Test_SecurityResponseId_Custom_Redirect: missing_feature
355+
Test_SecurityResponseId_HTML_Response: missing_feature
356+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
357+
Test_SecurityResponseId_JSON_Response: missing_feature
353358
test_custom_rules.py:
354359
Test_CustomRules: v1.51.0
355360
test_exclusions.py:

manifests/java.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,19 @@ tests/:
11481148
akka-http: v1.22.0
11491149
play: v1.22.0
11501150
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
1151+
test_blocking_security_response_id.py:
1152+
Test_SecurityResponseId_Custom_Redirect:
1153+
'*': missing_feature
1154+
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
1155+
Test_SecurityResponseId_HTML_Response:
1156+
'*': missing_feature
1157+
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
1158+
Test_SecurityResponseId_In_Span_Triggers:
1159+
'*': missing_feature
1160+
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
1161+
Test_SecurityResponseId_JSON_Response:
1162+
'*': missing_feature
1163+
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
11511164
test_custom_rules.py:
11521165
Test_CustomRules:
11531166
'*': v1.51.0

manifests/nodejs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,11 @@ tests/:
768768
Test_Blocking: *ref_3_19_0
769769
Test_Blocking_strip_response_headers: *ref_5_17_0
770770
Test_CustomBlockingResponse: *ref_5_15_0
771+
test_blocking_security_response_id.py:
772+
Test_SecurityResponseId_Custom_Redirect: missing_feature
773+
Test_SecurityResponseId_HTML_Response: missing_feature
774+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
775+
Test_SecurityResponseId_JSON_Response: missing_feature
771776
test_custom_rules.py:
772777
Test_CustomRules:
773778
'*': *ref_4_1_0

manifests/php.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ tests/:
312312
Test_Blocking: missing_feature # v0.86.0
313313
Test_Blocking_strip_response_headers: missing_feature
314314
Test_CustomBlockingResponse: missing_feature # v0.86.0
315+
test_blocking_security_response_id.py:
316+
Test_SecurityResponseId_Custom_Redirect: missing_feature
317+
Test_SecurityResponseId_HTML_Response: missing_feature
318+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
319+
Test_SecurityResponseId_JSON_Response: missing_feature
315320
test_custom_rules.py:
316321
Test_CustomRules: v0.87.2
317322
test_exclusions.py:

manifests/python.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ tests/:
452452
Test_CustomBlockingResponse:
453453
'*': v1.20.0
454454
fastapi: v2.4.0
455+
test_blocking_security_response_id.py:
456+
Test_SecurityResponseId_Custom_Redirect: missing_feature
457+
Test_SecurityResponseId_HTML_Response: missing_feature
458+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
459+
Test_SecurityResponseId_JSON_Response: missing_feature
455460
test_custom_rules.py:
456461
Test_CustomRules:
457462
'*': v1.16.1

manifests/ruby.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ tests/:
345345
Test_Blocking: v1.11.0
346346
Test_Blocking_strip_response_headers: v1.13.0
347347
Test_CustomBlockingResponse: v1.15.0
348+
test_blocking_security_response_id.py:
349+
Test_SecurityResponseId_Custom_Redirect: missing_feature
350+
Test_SecurityResponseId_HTML_Response: missing_feature
351+
Test_SecurityResponseId_In_Span_Triggers: missing_feature
352+
Test_SecurityResponseId_JSON_Response: missing_feature
348353
test_custom_rules.py:
349354
Test_CustomRules: v1.12.0
350355
test_exclusions.py:

tests/appsec/blocking_rule.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,33 @@
189189
"block4"
190190
]
191191
},
192+
{
193+
"id": "canary_rule5",
194+
"name": "Canary 5",
195+
"tags": {
196+
"type": "security_scanner",
197+
"category": "attack_attempt"
198+
},
199+
"conditions": [
200+
{
201+
"parameters": {
202+
"inputs": [
203+
{
204+
"address": "server.request.headers.no_cookies",
205+
"key_path": [
206+
"user-agent"
207+
]
208+
}
209+
],
210+
"regex": "^Canary\\/v5"
211+
},
212+
"operator": "match_regex"
213+
}
214+
],
215+
"on_match": [
216+
"block5"
217+
]
218+
},
192219
{
193220
"id": "tst-037-009",
194221
"name": "Test block on response header",
@@ -857,6 +884,14 @@
857884
"status_code": 303,
858885
"location": ""
859886
}
887+
},
888+
{
889+
"id": "block5",
890+
"type": "redirect_request",
891+
"parameters": {
892+
"status_code": 301,
893+
"location": "/you-have-been-blocked?security_response_id=[security_response_id]"
894+
}
860895
}
861896
],
862897
"rules_data": [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>You've been blocked</title><style>a,body,div,html,span{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}body{background:-webkit-radial-gradient(26% 19%,circle,#fff,#f4f7f9);background:radial-gradient(circle at 26% 19%,#fff,#f4f7f9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;width:100%;min-height:100vh;line-height:1;flex-direction:column}p{display:block}main{text-align:center;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;flex-direction:column}p{font-size:18px;line-height:normal;color:#646464;font-family:sans-serif;font-weight:400}a{color:#4842b7}footer{width:100%;text-align:center}footer p{font-size:16px}.security-response-id{font-size:14px;color:#999;margin-top:20px;font-family:monospace}</style></head><body><main><p>Sorry, you cannot access this page. Please contact the customer service team.</p><p class="security-response-id">Security Response ID: 00000000-0000-4000-8000-000000000000</p></main><footer><p>Security provided by <a href="https://www.datadoghq.com/product/security-platform/application-security-monitoring/" target="_blank">Datadog</a></p></footer></body></html>

0 commit comments

Comments
 (0)