Skip to content

Commit f2808fb

Browse files
authored
feat(appsec): enable telemetry when appsec is enabled through the tracer and not the extension (#641)
* feat(appsec): default to telemetry enabled * build: keep dist-info/METADATA files for SCA to work correctly
1 parent f1a4cb4 commit f2808fb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracki
2525
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
2626
# _stack_v2 may not exist for some versions of ddtrace (e.g. under python 3.13)
2727
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so
28-
# remove *.dist-info directories except any entry_points.txt files
29-
RUN find ./python/lib/$runtime/site-packages/*.dist-info -not -name "entry_points.txt" -type f -delete
28+
# remove *.dist-info directories except any entry_points.txt files and METADATA files required for Appsec Software Composition Analysis
29+
RUN find ./python/lib/$runtime/site-packages/*.dist-info \
30+
-type f \
31+
! \( -name 'entry_points.txt' -o -name 'METADATA' \) \
32+
-delete
3033
RUN find ./python/lib/$runtime/site-packages -type d -empty -delete
3134

3235
# Remove requests and dependencies

datadog_lambda/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44

55
if os.environ.get("DD_INSTRUMENTATION_TELEMETRY_ENABLED") is None:
6-
os.environ["DD_INSTRUMENTATION_TELEMETRY_ENABLED"] = "false"
6+
# Telemetry is required for Appsec Software Composition Analysis
7+
os.environ["DD_INSTRUMENTATION_TELEMETRY_ENABLED"] = os.environ.get(
8+
"DD_APPSEC_ENABLED", "false"
9+
)
710

811
if os.environ.get("DD_API_SECURITY_ENABLED") is None:
912
os.environ["DD_API_SECURITY_ENABLED"] = "False"

0 commit comments

Comments
 (0)