Skip to content

Commit 1b3e604

Browse files
authored
Merge branch 'main' into iast-stack-trace-nodejs
2 parents 6292321 + c8163b7 commit 1b3e604

File tree

3 files changed

+93
-22
lines changed

3 files changed

+93
-22
lines changed

manifests/php.yml

+75-17
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ tests/:
77
appsec/:
88
api_security/:
99
test_api_security_rc.py:
10-
Test_API_Security_RC_ASM_DD_processors: missing_feature
11-
Test_API_Security_RC_ASM_DD_scanners: missing_feature
10+
Test_API_Security_RC_ASM_DD_processors: v1.6.2
11+
Test_API_Security_RC_ASM_DD_scanners: v1.6.2
1212
Test_API_Security_RC_ASM_processor_overrides_and_custom_scanner: irrelevant (waf does not support it yet)
1313
test_apisec_sampling.py: missing_feature
1414
test_schemas.py:
@@ -20,7 +20,7 @@ tests/:
2020
Test_Schema_Request_Path_Parameters: missing_feature
2121
Test_Schema_Request_Query_Parameters: v0.94.0
2222
Test_Schema_Response_Body: v0.99.1
23-
Test_Schema_Response_Body_env_var: missing_feature
23+
Test_Schema_Response_Body_env_var: v1.6.2
2424
Test_Schema_Response_Headers: v0.94.0
2525
iast/:
2626
sink/:
@@ -150,11 +150,69 @@ tests/:
150150
test_security_controls.py:
151151
TestSecurityControls: missing_feature
152152
rasp/:
153-
test_cmdi.py: missing_feature
154-
test_lfi.py: missing_feature
155-
test_shi.py: missing_feature
156-
test_sqli.py: missing_feature
157-
test_ssrf.py: missing_feature
153+
test_cmdi.py:
154+
Test_Cmdi_BodyJson: missing_feature
155+
Test_Cmdi_BodyUrlEncoded: missing_feature
156+
Test_Cmdi_BodyXml: missing_feature
157+
Test_Cmdi_Capability: missing_feature
158+
Test_Cmdi_Mandatory_SpanTags: missing_feature
159+
Test_Cmdi_Optional_SpanTags: missing_feature
160+
Test_Cmdi_Rules_Version: v1.6.2
161+
Test_Cmdi_StackTrace: missing_feature
162+
Test_Cmdi_Telemetry: missing_feature
163+
Test_Cmdi_Telemetry_Variant_Tag: missing_feature
164+
Test_Cmdi_UrlQuery: missing_feature
165+
Test_Cmdi_Waf_Version: v1.6.2
166+
test_lfi.py:
167+
Test_Lfi_BodyJson: missing_feature
168+
Test_Lfi_BodyUrlEncoded: missing_feature
169+
Test_Lfi_BodyXml: missing_feature
170+
Test_Lfi_Capability: missing_feature
171+
Test_Lfi_Mandatory_SpanTags: missing_feature
172+
Test_Lfi_Optional_SpanTags: missing_feature
173+
Test_Lfi_RC_CustomAction: missing_feature
174+
Test_Lfi_Rules_Version: v1.6.2
175+
Test_Lfi_StackTrace: missing_feature
176+
Test_Lfi_Telemetry: missing_feature
177+
Test_Lfi_UrlQuery: missing_feature
178+
Test_Lfi_Waf_Version: v1.6.2
179+
test_shi.py:
180+
Test_Shi_BodyJson: missing_feature
181+
Test_Shi_BodyUrlEncoded: missing_feature
182+
Test_Shi_BodyXml: missing_feature
183+
Test_Shi_Capability: missing_feature
184+
Test_Shi_Mandatory_SpanTags: missing_feature
185+
Test_Shi_Optional_SpanTags: missing_feature
186+
Test_Shi_Rules_Version: v1.6.2
187+
Test_Shi_StackTrace: missing_feature
188+
Test_Shi_Telemetry: missing_feature
189+
Test_Shi_Telemetry_Variant_Tag: missing_feature
190+
Test_Shi_UrlQuery: missing_feature
191+
Test_Shi_Waf_Version: v1.6.2
192+
test_sqli.py:
193+
Test_Sqli_BodyJson: missing_feature
194+
Test_Sqli_BodyUrlEncoded: missing_feature
195+
Test_Sqli_BodyXml: missing_feature
196+
Test_Sqli_Capability: missing_feature
197+
Test_Sqli_Mandatory_SpanTags: missing_feature
198+
Test_Sqli_Optional_SpanTags: missing_feature
199+
Test_Sqli_Rules_Version: v1.6.2
200+
Test_Sqli_StackTrace: missing_feature
201+
Test_Sqli_Telemetry: missing_feature
202+
Test_Sqli_UrlQuery: missing_feature
203+
Test_Sqli_Waf_Version: v1.6.2
204+
test_ssrf.py:
205+
Test_Ssrf_BodyJson: missing_feature
206+
Test_Ssrf_BodyUrlEncoded: missing_feature
207+
Test_Ssrf_BodyXml: missing_feature
208+
Test_Ssrf_Capability: missing_feature
209+
Test_Ssrf_Mandatory_SpanTags: missing_feature
210+
Test_Ssrf_Optional_SpanTags: missing_feature
211+
Test_Ssrf_Rules_Version: v1.6.2
212+
Test_Ssrf_StackTrace: missing_feature
213+
Test_Ssrf_Telemetry: missing_feature
214+
Test_Ssrf_UrlQuery: missing_feature
215+
Test_Ssrf_Waf_Version: v1.6.2
158216
waf/:
159217
test_addresses.py:
160218
Test_BodyJson: v0.98.1 # TODO what is the earliest version?
@@ -223,16 +281,16 @@ tests/:
223281
test_blocking_addresses.py:
224282
Test_BlockingGraphqlResolvers: missing_feature
225283
Test_Blocking_request_body: irrelevant (Php does not accept url encoded entries without key)
226-
Test_Blocking_request_body_multipart: missing_feature
284+
Test_Blocking_request_body_multipart: v1.6.2
227285
Test_Blocking_response_headers: irrelevant (On php it is not possible change the status code once its header is sent)
228286
Test_Blocking_response_status: irrelevant (On php it is not possible change the status code once its header is sent)
229-
Test_Suspicious_Request_Blocking: missing_feature (v0.86.0 but test is not implemented)
287+
Test_Suspicious_Request_Blocking: v1.6.2
230288
test_client_ip.py:
231289
Test_StandardTagsClientIp: v0.81.0
232290
test_fingerprinting.py:
233-
Test_Fingerprinting_Endpoint: missing_feature
291+
Test_Fingerprinting_Endpoint: v1.6.2
234292
Test_Fingerprinting_Endpoint_Capability: missing_feature
235-
Test_Fingerprinting_Header_And_Network: missing_feature
293+
Test_Fingerprinting_Header_And_Network: v1.6.2
236294
Test_Fingerprinting_Header_Capability: missing_feature
237295
Test_Fingerprinting_Network_Capability: missing_feature
238296
Test_Fingerprinting_Session: missing_feature
@@ -247,16 +305,16 @@ tests/:
247305
Test_SecurityEvents_Iast_Metastruct_Disabled: irrelevant (no fallback will be implemented)
248306
Test_SecurityEvents_Iast_Metastruct_Enabled: missing_feature
249307
test_remote_config_rule_changes.py:
250-
Test_BlockingActionChangesWithRemoteConfig: missing_feature
251-
Test_UpdateRuleFileWithRemoteConfig: missing_feature (v0.8.0 but lacks telemetry support)
308+
Test_BlockingActionChangesWithRemoteConfig: v1.6.2
309+
Test_UpdateRuleFileWithRemoteConfig: v1.6.2
252310
test_reports.py:
253311
Test_ExtraTagsFromRule: v0.88.0
254312
Test_Info: v0.68.3 # probably 0.68.2, but was flaky
255313
test_request_blocking.py:
256-
Test_AppSecRequestBlocking: missing_feature # missing version
314+
Test_AppSecRequestBlocking: v1.6.2
257315
test_runtime_activation.py:
258-
Test_RuntimeActivation: missing_feature # missing version
259-
Test_RuntimeDeactivation: missing_feature # missing version
316+
Test_RuntimeActivation: v1.6.2
317+
Test_RuntimeDeactivation: v1.6.2
260318
test_shell_execution.py:
261319
Test_ShellExecution: v0.95.0
262320
test_suspicious_attacker_blocking.py:

tests/appsec/test_automated_login_events.py

+1
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,7 @@ def setup_login_event_blocking_auto_id(self):
19281928
self.config_state_3 = rc.rc_state.set_config(*BLOCK_USER_ID).apply()
19291929
self.r_login_blocked = weblog.post("/login?auth=local", data=login_data(context, USER, PASSWORD))
19301930

1931+
@irrelevant(context.library == "java", reason="Blocking by user ID not available in java")
19311932
def test_login_event_blocking_auto_id(self):
19321933
assert self.config_state_1[rc.RC_STATE] == rc.ApplyState.ACKNOWLEDGED
19331934
assert self.r_login.status_code == 200

utils/proxy/_deserializer.py

+17-5
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,27 @@ def _deserialize_file_in_multipart_form_data(
247247
item["system-tests-error"] = "Filename not found in content-disposition, please contact #apm-shared-testing"
248248
else:
249249
filename = meta_data["filename"].strip('"')
250+
item["system-tests-filename"] = filename
251+
250252
if filename.lower().endswith(".gz"):
251253
filename = filename[:-3]
252-
file_path = f"{export_content_files_to}/{md5(content).hexdigest()}_{filename}"
253254

254-
with open(file_path, "wb") as f:
255-
f.write(content)
255+
content_is_deserialized = False
256+
if filename.lower().endswith(".json"):
257+
try:
258+
item["content"] = json.loads(content)
259+
content_is_deserialized = True
260+
except json.JSONDecodeError:
261+
item["system-tests-error"] = "Can't decode json file"
262+
263+
if not content_is_deserialized:
264+
file_path = f"{export_content_files_to}/{md5(content).hexdigest()}_{filename}"
265+
266+
item["system-tests-information"] = "File exported to a separated file"
267+
item["system-tests-file-path"] = file_path
256268

257-
item["system-tests-information"] = "File exported to a separated file"
258-
item["system-tests-file-path"] = file_path
269+
with open(file_path, "wb") as f:
270+
f.write(content)
259271

260272

261273
def _deserialized_nested_json_from_trace_payloads(content, interface):

0 commit comments

Comments
 (0)