@@ -68,15 +68,20 @@ def setup_custom_span_tags(self):
6868 weblog .get ("/waf" , params = {"key" : "\n :" }) # rules.http_protocol_violation.crs_921_160
6969 weblog .get ("/waf" , headers = {"random-key" : "acunetix-user-agreement" }) # rules.security_scanner.crs_913_110
7070
71- @bug (library = "python_lambda" , reason = "APPSEC-58201" )
7271 def test_custom_span_tags (self ):
7372 """AppSec should store in all APM spans some tags when enabled."""
7473
7574 spans = [span for _ , span in interfaces .library .get_root_spans ()]
7675 assert spans , "No root spans to validate"
77- spans = [s for s in spans if s .get ("type" ) == "web" ]
78- assert spans , "No spans of type web to validate"
76+ spans = [s for s in spans if s .get ("type" ) in ( "web" , "serverless" ) ]
77+ assert spans , "No spans of type web or serverless to validate"
7978 for span in spans :
79+ if span .get ("type" ) == "serverless" and "_dd.appsec.unsupported_event_type" in span ["metrics" ]:
80+ # For serverless, the `healthcheck` event is not supported
81+ assert (
82+ span ["metrics" ]["_dd.appsec.unsupported_event_type" ] == 1
83+ ), "_dd.appsec.unsupported_event_type should be 1 or 1.0"
84+ continue
8085 assert "_dd.appsec.enabled" in span ["metrics" ], "Cannot find _dd.appsec.enabled in span metrics"
8186 assert span ["metrics" ]["_dd.appsec.enabled" ] == 1 , "_dd.appsec.enabled should be 1 or 1.0"
8287 assert "_dd.runtime_family" in span ["meta" ], "Cannot find _dd.runtime_family in span meta"
@@ -87,14 +92,15 @@ def test_custom_span_tags(self):
8792 def setup_header_collection (self ):
8893 self .r = weblog .get ("/headers" , headers = {"User-Agent" : "Arachni/v1" , "Content-Type" : "text/plain" })
8994
95+ @bug (library = "python_lambda" , reason = "APPSEC-58202" )
9096 @bug (context .library < f"python@{ PYTHON_RELEASE_GA_1_1 } " , reason = "APMRP-360" )
9197 @bug (context .library < "java@1.2.0" , weblog_variant = "spring-boot-openliberty" , reason = "APPSEC-6734" )
9298 @bug (
9399 context .library < "nodejs@5.57.0" ,
94100 weblog_variant = "fastify" ,
95101 reason = "APPSEC-57432" , # Response headers collection not supported yet
96102 )
97- @irrelevant (context .library not in ["golang" , "nodejs" , "java" , "dotnet" ], reason = "test" )
103+ @irrelevant (context .library not in ["golang" , "nodejs" , "java" , "dotnet" , "python_lambda" ], reason = "test" )
98104 @irrelevant (context .scenario is scenarios .external_processing , reason = "Irrelevant tag set for golang" )
99105 def test_header_collection (self ):
100106 """AppSec should collect some headers for http.request and http.response and store them in span tags.
0 commit comments