Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/understand/scenarios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ run a test suite.

The `AI_GUARD` scenario tests the [AI Guard SDK](https://docs.datadoghq.com/security/ai_guard/) integration across tracer libraries. It uses a VCR cassettes container to replay pre-recorded AI Guard API responses, validating evaluation actions (ALLOW, DENY, ABORT), span metadata, sensitive data scanning, and multi-modal content handling. See [ai_guard.md](ai_guard.md) for details.

### Security smoke scenarios

The `SECURITY_SMOKE` scenario and its standalone variants run the same security product checks on each supported infrastructure, at backend intake. `SECURITY_SMOKE` is the reference. See [security_smoke.md](security_smoke.md) for details.

### Thread context sharing scenario

The `THREAD_CONTEXT_SHARING` scenario runs the agent with CWS (Cloud Workload Security), and checks that security events triggered by the weblog carry the trace context of the active span. It needs the docker daemon to run on the instrumented kernel, with an opt-in for Kata docker-in-docker environments. See [thread_context_sharing.md](thread_context_sharing.md) for details.
Expand Down
2 changes: 2 additions & 0 deletions docs/understand/scenarios/ai_guard.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Tests use pre-recorded HTTP request/response pairs stored in `utils/build/docker

The cassette filename encodes the HTTP method and a hash of the request body (e.g. `aiguard_evaluate_post_3156697a.json`). The VCR container matches incoming requests to cassettes by method and body hash, then returns the recorded response.

The [security smoke scenarios](security_smoke.md) also replay the `ALLOW` evaluation cassette, so the messages in `tests/ai_guard/utils.py` must keep matching it.

### Upgrading cassettes

Cassettes must be upgraded when:
Expand Down
28 changes: 28 additions & 0 deletions docs/understand/scenarios/security_smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Security smoke scenarios

The security smoke tests check that security payloads survive the whole path to Datadog intake, for every infrastructure a customer can run. They assert on what the [mocked backend](../../edit/mocked-backend-interface-validation-methods.md) receives, not on what the SDK sends.

They form a grid of products and infrastructures:

- **Rows** are products. Each one is a `Base*SmokeTests` class in `tests/appsec/smoke_tests/utils.py`: threats, RASP, WAF telemetry, remote config, API Security, user events, AI Guard and SCA. A row sends its own traffic and does not depend on how data is exported.
- **Columns** are infrastructures. Each one is a scenario that only changes the infrastructure: Agent mode, APM opt-out, or export protocol.
- **Cells** are `Test_<Scenario>_<Product>` classes that only inherit a row.

`SECURITY_SMOKE` is the reference column: classic Agent and native trace export. When a cell fails while its `SECURITY_SMOKE` cell passes, the infrastructure of that column is the cause.

| Scenario | Infrastructure |
| --- | --- |
| `SECURITY_SMOKE` | Classic Agent, native trace export (reference) |
| `APPSEC_APM_STANDALONE` | Agent with `DD_INFRASTRUCTURE_MODE=none` |
| `APPSEC_STANDALONE_APM_STANDALONE` | Agent with `DD_INFRASTRUCTURE_MODE=none`, SDK with `DD_APM_TRACING_ENABLED=false` |

## Adding a product

1. Add a `Base<Product>SmokeTests` class in `tests/appsec/smoke_tests/utils.py`.
2. Add one cell per column, in `tests/appsec/smoke_tests/test_security.py` and `tests/appsec/smoke_tests/test_apm_standalone.py`.
3. If the product needs configuration or a container, add it to `SMOKE_PRODUCTS_WEBLOG_ENV` or `SMOKE_PRODUCTS_CONTAINERS` in `utils/_context/_scenarios/_core/product_env.py`, which every column uses.
4. Declare each cell in the [manifests](../../edit/manifest.md).

## Adding an infrastructure

Add a scenario that starts from `SMOKE_PRODUCTS_WEBLOG_ENV` and `SMOKE_PRODUCTS_CONTAINERS`, and only adds what its infrastructure changes. Then add one cell per row.
6 changes: 6 additions & 0 deletions manifests/cpp_nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,32 @@ manifest:
tests/appsec/iast/test_security_controls.py: irrelevant (ASM is not implemented in C++)
tests/appsec/iast/test_vulnerability_schema.py: irrelevant (ASM is not implemented in C++)
tests/appsec/rasp/: irrelevant (ASM is not implemented in C++)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_AiGuard: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_ApiSecurity: '>=1.19.1' # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Rasp: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_RemoteConfig: '>=1.19.1' # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_RemoteConfig::test_rasp_blocking_smoke: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Sca: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Telemetry: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Threats: '>=1.19.1' # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Threats::test_waf_monitoring_smoke: missing_feature (WAF monitoring tags not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_UserEvents: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_AiGuard: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_ApiSecurity: '>=1.19.1' # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Rasp: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_RemoteConfig: '>=1.19.1' # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_RemoteConfig::test_rasp_blocking_smoke: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Sca: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Telemetry: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Threats: '>=1.19.1' # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Threats::test_waf_monitoring_smoke: missing_feature (WAF monitoring tags not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_UserEvents: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_AiGuard: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_ApiSecurity: '>=1.19.1'
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Rasp: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_RemoteConfig: '>=1.19.1'
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_RemoteConfig::test_rasp_blocking_smoke: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Sca: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Telemetry: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Threats: '>=1.19.1'
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Threats::test_waf_monitoring_smoke: missing_feature (WAF monitoring tags not implemented)
Expand Down
3 changes: 3 additions & 0 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ manifest:
tests/appsec/rasp/test_ssrf.py::Test_Ssrf_UrlQuery: v2.51.0
tests/appsec/rasp/test_ssrf.py::Test_Ssrf_Waf_Version: v3.4.1
tests/appsec/smoke_tests/test_apm_standalone.py: v3.41.0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_AiGuard: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_AiGuard: missing_feature
tests/appsec/smoke_tests/test_security.py: v3.41.0
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_AiGuard: missing_feature
tests/appsec/test_agentic_onboarding.py::Test_AppsecAgenticOnboarding: v3.50.0
tests/appsec/test_alpha.py::Test_Basic: v1.28.6
tests/appsec/test_asm_standalone.py::Test_APISecurityStandalone: v3.17.0
Expand Down
6 changes: 6 additions & 0 deletions manifests/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ manifest:
fiber-v2-orchestrion: v2.12.0 # TODO: a lower version might be supported
tests/appsec/rasp/test_ssrf.py::Test_Ssrf_Waf_Version: v2.0.0
tests/appsec/smoke_tests/test_apm_standalone.py: v2.7.0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_AiGuard: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_ApiSecurity: # Easy win for fiber-v2-orchestrion and version 2.12.0
- declaration: missing_feature (Fiber v2 has no HTTP AppSec integration)
weblog: fiber-v2-orchestrion
Expand All @@ -703,10 +704,12 @@ manifest:
net-http-orchestrion: v2.7.0
- weblog_declaration:
fiber-v2-orchestrion: missing_feature (Fiber v2 has no HTTP AppSec integration)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Sca::test_sca_dependencies_smoke: irrelevant (Go does not support dynamic dependency loading)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Threats: # Easy win for fiber-v2-orchestrion and version 2.12.0
- declaration: missing_feature (Fiber v2 has no HTTP AppSec integration)
weblog: fiber-v2-orchestrion
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_UserEvents: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_AiGuard: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_ApiSecurity: # Easy win for fiber-v2-orchestrion and version 2.12.0
- declaration: missing_feature (Fiber v2 has no HTTP AppSec integration)
weblog: fiber-v2-orchestrion
Expand All @@ -732,11 +735,13 @@ manifest:
net-http-orchestrion: v2.7.0
- weblog_declaration:
fiber-v2-orchestrion: missing_feature (Fiber v2 has no HTTP AppSec integration)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Sca::test_sca_dependencies_smoke: irrelevant (Go does not support dynamic dependency loading)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Threats: # Easy win for fiber-v2-orchestrion and version 2.12.0
- declaration: missing_feature (Fiber v2 has no HTTP AppSec integration)
weblog: fiber-v2-orchestrion
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_UserEvents: missing_feature
tests/appsec/smoke_tests/test_security.py: v2.7.0
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_AiGuard: missing_feature
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_ApiSecurity: # Easy win for fiber-v2-orchestrion and version 2.12.0
- declaration: missing_feature (Fiber v2 has no HTTP AppSec integration)
weblog: fiber-v2-orchestrion
Expand All @@ -762,6 +767,7 @@ manifest:
net-http-orchestrion: v2.7.0
- weblog_declaration:
fiber-v2-orchestrion: missing_feature (Fiber v2 has no HTTP AppSec integration)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Sca::test_sca_dependencies_smoke: irrelevant (Go does not support dynamic dependency loading)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Threats: # Easy win for fiber-v2-orchestrion and version 2.12.0
- declaration: missing_feature (Fiber v2 has no HTTP AppSec integration)
weblog: fiber-v2-orchestrion
Expand Down
48 changes: 48 additions & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,10 @@ manifest:
- weblog_declaration:
"*": v1.60.3
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_AiGuard:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
"spring-boot": v1.60.3
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Rasp:
- weblog_declaration:
spring-boot-payara: v1.66.0 # TODO: a lower version might be supported
Expand All @@ -1661,6 +1665,18 @@ manifest:
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_RemoteConfig::test_rasp_blocking_smoke:
- weblog_declaration:
spring-boot-payara: missing_feature (APPSEC-54966)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Sca::test_sca_dependencies_smoke:
- weblog_declaration:
akka-http: missing_feature (endpoint not implemented)
jersey-grizzly2: missing_feature (endpoint not implemented)
play: missing_feature (endpoint not implemented)
ratpack: missing_feature (endpoint not implemented)
vertx3: missing_feature (endpoint not implemented)
vertx4: missing_feature (endpoint not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Sca::test_sca_enabled_smoke:
- weblog_declaration:
"*": v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_UserEvents:
- weblog_declaration:
akka-http: missing_feature (login endpoints not implemented)
Expand All @@ -1670,6 +1686,10 @@ manifest:
resteasy-netty3: missing_feature (login endpoints not implemented)
vertx3: missing_feature (login endpoints not implemented)
vertx4: missing_feature (login endpoints not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_AiGuard:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
"spring-boot": v1.65.0-SNAPSHOT
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_ApiSecurity:
- declaration: flaky (APPSEC-60872)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Rasp:
Expand All @@ -1683,6 +1703,18 @@ manifest:
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_RemoteConfig::test_rasp_blocking_smoke:
- weblog_declaration:
spring-boot-payara: missing_feature (APPSEC-54966)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Sca::test_sca_dependencies_smoke:
- weblog_declaration:
akka-http: missing_feature (endpoint not implemented)
jersey-grizzly2: missing_feature (endpoint not implemented)
play: missing_feature (endpoint not implemented)
ratpack: missing_feature (endpoint not implemented)
vertx3: missing_feature (endpoint not implemented)
vertx4: missing_feature (endpoint not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Sca::test_sca_enabled_smoke:
- weblog_declaration:
"*": v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Threats:
- declaration: flaky (APPSEC-60872)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_UserEvents:
Expand All @@ -1699,6 +1731,10 @@ manifest:
- weblog_declaration:
"*": v1.60.3
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_AiGuard:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
"spring-boot": v1.60.3
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Rasp:
- weblog_declaration:
spring-boot-payara: v1.66.0
Expand All @@ -1709,6 +1745,18 @@ manifest:
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_RemoteConfig::test_rasp_blocking_smoke:
- weblog_declaration:
spring-boot-payara: missing_feature (APPSEC-54966)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Sca::test_sca_dependencies_smoke:
- weblog_declaration:
akka-http: missing_feature (endpoint not implemented)
jersey-grizzly2: missing_feature (endpoint not implemented)
play: missing_feature (endpoint not implemented)
ratpack: missing_feature (endpoint not implemented)
vertx3: missing_feature (endpoint not implemented)
vertx4: missing_feature (endpoint not implemented)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Sca::test_sca_enabled_smoke:
- weblog_declaration:
"*": v1.61.0-SNAPSHOT # Normalization of telemetry keys updated in https://github.com/DataDog/dd-trace-java/pull/10823
spring-boot-3-native: irrelevant (GraalVM. Tracing support only)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_UserEvents:
- weblog_declaration:
akka-http: incomplete_test_app (login endpoints not implemented)
Expand Down
21 changes: 21 additions & 0 deletions manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,33 +1112,54 @@ manifest:
nextjs: *ref_6_26_0
tests/appsec/rasp/test_ssrf.py::Test_Ssrf_Waf_Version: *ref_5_25_0
tests/appsec/smoke_tests/test_apm_standalone.py: v5.92.0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_AiGuard:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
express5: v5.92.0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Rasp:
- weblog_declaration:
nextjs: v6.19.0 # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_RemoteConfig::test_rasp_blocking_smoke:
- weblog_declaration:
nextjs: *ref_6_26_0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_Sca::test_sca_dependencies_smoke:
- weblog_declaration:
nextjs: missing_feature (endpoint not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecAPMStandalone_UserEvents:
- weblog_declaration:
fastify: missing_feature
nextjs: missing_feature
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_AiGuard:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
express5: *ref_5_110_0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Rasp:
- weblog_declaration:
nextjs: v6.19.0 # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_RemoteConfig::test_rasp_blocking_smoke:
- weblog_declaration:
nextjs: *ref_6_26_0
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_Sca::test_sca_dependencies_smoke:
- weblog_declaration:
nextjs: missing_feature (endpoint not implemented)
tests/appsec/smoke_tests/test_apm_standalone.py::Test_AppSecStandaloneAPMStandalone_UserEvents:
- weblog_declaration:
fastify: missing_feature
nextjs: missing_feature
tests/appsec/smoke_tests/test_security.py: v5.92.0
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_AiGuard:
- weblog_declaration:
"*": irrelevant (just one weblog is enough to test the SDK)
express5: v5.92.0
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Rasp:
- weblog_declaration:
nextjs: v6.19.0
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_RemoteConfig::test_rasp_blocking_smoke:
- weblog_declaration:
nextjs: v6.26.0 # TODO: a lower version might be supported
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_Sca::test_sca_dependencies_smoke:
- weblog_declaration:
nextjs: missing_feature (endpoint not implemented)
tests/appsec/smoke_tests/test_security.py::Test_SecuritySmoke_UserEvents:
- weblog_declaration:
fastify: missing_feature
Expand Down
Loading
Loading