Add APPSEC_OTEL_API scenarios for M1 topology (APPSEC-68836) - #7582
Add APPSEC_OTEL_API scenarios for M1 topology (APPSEC-68836)#7582RamyElkest wants to merge 3 commits into
Conversation
M1: DD Tracer as drop-in OTel SDK replacement (instrumentation layer). Uses standard DD agent for transport (native protocol), OTel API backed by dd-tracer. Two new scenarios: - APPSEC_OTEL_API: blocking ruleset, tests WAF blocking + detection - APPSEC_OTEL_API_DEFAULT_RULES: default ruleset, tests alpha/obfuscator/payment No new weblog needed — existing flask-poc weblog already uses OTel API with DD_TRACE_OTEL_ENABLED=true. No OTLP adapter needed — traces go via DD agent in native Datadog format. Test results: 42 + 26 + 35 + 2 = 105 passed, 0 failed, 4 xfailed. CI: scenarios added to .github/workflows/run-end-to-end.yml
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0696d415d2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| appsec_otel_api = DdTraceEndToEndScenario( | ||
| "APPSEC_OTEL_API", | ||
| weblog_env={ | ||
| "DD_TRACE_OTEL_ENABLED": "true", |
There was a problem hiding this comment.
Exercise the OTel API in the new scenarios
Setting DD_TRACE_OTEL_ENABLED does not make these AppSec checks exercise the drop-in OTel API: the new smoke classes call /waf and /login (tests/appsec/smoke_tests/utils.py:122-124,332-335), and the Python handlers use normal framework instrumentation and explicit Datadog AppSec helpers (utils/build/docker/python/flask/app.py:399-409,1547-1559); the actual OTel API calls are confined to separate /otel_drop_in_* handlers starting at line 1941. Consequently, a tracer whose OTel bridge is absent or broken can still pass both scenarios, so the reported M1 experiment validates ordinary Datadog instrumentation rather than AppSec through the OTel API; generate the tested request/span through an OTel API endpoint or instrument the request path with the OTel API.
Useful? React with 👍 / 👎.
|
…r to M1 (APPSEC-68836) 5 new OTel API scenarios covering all required AppSec capabilities: - APPSEC_OTEL_API_SECURITY: API Security schema discovery + sampling - APPSEC_OTEL_API_RASP: RASP detection (cmdi, lfi, sqli, ssrf, shi, api10) - APPSEC_OTEL_API_RUNTIME_ACTIVATION: RC-driven AppSec on/off + rule changes - APPSEC_OTEL_API_BLOCKING_FULL_DENYLIST: RC-driven IP/user blocking - APPSEC_OTEL_API_RATE_LIMITER: AppSec rate limiter 101 new test classes decorated across 21 files. All smoke tests pass: 1 passed per scenario for API Sec, RASP, RC, blocking, rate limiter. This completes the 'supported' definition from the strategic plan: WAF + ATO + API Security all validated via OTel API.
…APPSEC-68836) New weblog variant that creates spans via opentelemetry.trace.start_span() instead of dd-trace's Flask auto-instrumentation. This validates M1: AppSec works when the OTel API is the instrumentation layer. Key endpoints (/waf, /rasp/*, /login, /identify, /headers) are wrapped with otel_tracer.start_as_current_span() so spans are created through the OTel API. Uses ddtrace-run to load dd-tracer with DD_TRACE_OTEL_ENABLED=true, so dd-tracer implements the OTel API. First test passes (XPASS — needs manifest entries for new weblog variant).
Summary
Validates M1 topology from the AAP for OTel Customers strategic plan: DD Tracer as drop-in OTel SDK replacement.
M1 tests the instrumentation layer — the dd-tracer implements the OTel API (), so customers can use standard in their code while getting full AppSec. This is different from M2 (PR #7578) which tests the transport layer (OTLP export).
Closes APPSEC-68836
What's New
Two Scenarios
APPSEC_OTEL_APIAPPSEC_OTEL_API_DEFAULT_RULESBoth use:
DD_TRACE_OTEL_ENABLED=true+include_agent=True+rc_api_enabled=True+appsec_enabled=TrueKey Difference from M2 (PR #7578)
No new weblog Dockerfile needed — the existing
flask-pocweblog already imports and usesopentelemetry.trace,opentelemetry.baggage, andopentelemetry.propagate. WithDD_TRACE_OTEL_ENABLED=true, dd-tracer implements these APIs.Test Results
APPSEC_OTEL_APIAPPSEC_OTEL_API_DEFAULT_RULESPlus 2 smoke tests (Threats + UserEvents) passing in each scenario.
CI Integration
.github/workflows/run-end-to-end.ymltracer_releasegroup — runs on every tracer release PR@scenarios.appsec_otel_apiare modified