|
14 | 14 | from ddtrace.appsec._constants import LOGIN_EVENTS_MODE |
15 | 15 | from ddtrace.appsec._constants import TELEMETRY_INFORMATION_NAME |
16 | 16 | from ddtrace.constants import APPSEC_ENV |
| 17 | +from ddtrace.ext import SpanTypes |
17 | 18 | from ddtrace.internal import core |
18 | 19 | from ddtrace.internal.serverless import in_aws_lambda |
19 | 20 | from ddtrace.settings._config import config as tracer_config |
@@ -64,6 +65,7 @@ class ASMConfig(DDConfig): |
64 | 65 | # prevent empty string |
65 | 66 | if _asm_static_rule_file == "": |
66 | 67 | _asm_static_rule_file = None |
| 68 | + _asm_processed_span_types = {SpanTypes.WEB, SpanTypes.GRPC} |
67 | 69 | _iast_enabled = tracer_config._from_endpoint.get("iast_enabled", DDConfig.var(bool, IAST.ENV, default=False)) |
68 | 70 | _iast_request_sampling = DDConfig.var(float, IAST.ENV_REQUEST_SAMPLING, default=30.0) |
69 | 71 | _iast_debug = DDConfig.var(bool, IAST.ENV_DEBUG, default=False, private=True) |
@@ -224,9 +226,20 @@ class ASMConfig(DDConfig): |
224 | 226 |
|
225 | 227 | def __init__(self): |
226 | 228 | super().__init__() |
| 229 | + |
| 230 | + if in_aws_lambda(): |
| 231 | + self._asm_processed_span_types.add(SpanTypes.SERVERLESS) |
| 232 | + |
| 233 | + # As a first step, only Threat Management in monitoring mode should be enabled in AWS Lambda |
| 234 | + tracer_config._remote_config_enabled = False |
| 235 | + self._api_security_enabled = False |
| 236 | + self._ep_enabled = False |
| 237 | + self._iast_supported = False |
| 238 | + |
227 | 239 | if not self._iast_supported: |
228 | 240 | self._iast_enabled = False |
229 | | - if not self._asm_libddwaf_available or in_aws_lambda(): |
| 241 | + |
| 242 | + if not self._asm_libddwaf_available: |
230 | 243 | self._asm_enabled = False |
231 | 244 | self._asm_can_be_enabled = False |
232 | 245 | self._iast_enabled = False |
|
0 commit comments