Skip to content

Commit d2064eb

Browse files
committed
# This is the 1st commit message:
Extend vulnerability location data with class re-enable aws integrations tests (#3733) feat(tests/test_data_integrity): update test_datadog_external_env for Go v1.72.0 and forward (#3961) Activate ruff rules on tests/ folder (#3999) [python] Avoid passing global tracer to pin in weblog apps (#4004) All classes must declare feature ids (#4003) Extend mypy scope (#4002) Onboarding: bug marker profiling (#4005) Docker SSI: fix scenario (#4006) [ruby] Enable IP blocking tests for Ruby (#3937) Activate ruff rules on tests/ folder (#4007) [nodejs] remove auto login event skip (#3998) Email HTML Injection detection in IAST Java (#3906) Co-authored-by: Mario Vidal Domínguez <[email protected]> Add test to check absence of client computed stats (#3812) [java] Skip payara/CROSSED_TRACING_LIBRARIES/prod (#4009) Add GraphQL error extension tests (#3986) Co-authored-by: William Conti <[email protected]> Use prod agent, dev agent broke lot of tracers (#4011) update xpassing baggage tests for unimplemented languages (#3773) [NodeJS] skip failing baggage tests (#4015) [python] fix 500 errors in sql queries (#3997) Activate ruff rules on tests/ folder (#4010) Hotfix Fix fuzzer [Nodejs] Enable untrusted deserialization stack trace test for Node.js (#3995) [python] use main again for dev branch (#4008) Co-authored-by: erikayasuda <[email protected]> Co-authored-by: Charles de Beauchesne <[email protected]> Revert agent dev fix (#4013) [PHP] Enable rasp telemetry tests for PHP (#3972) [skipci] Update CODEOWNERS for static files (#4012) [Java] Enable more easy wins (#4018) [java] Bump GraalVM system test to JDK 22 (#4001) [NodeJS] skip more failing baggage tests (#4021) [Debugger] Update dotnet Exception Replay tests (#3974) Test multiple rasp during one request (#3989) Add test for location extended data (#3978) Fix APPSEC_NO_STATS scenario name (#4019) Avoid false XPASS on APPSEC_WAF_TELEMETRY (#4029) [java] Enable Test_Blocking_strip_response_headers in some variants (#4033) [java] Remove some outdated manifest entries (#4039) [java] Fix xpass for Test_SecurityEvents_Appsec_Metastruct_Disabled (#4038) Consolidate remote config tests into same directory/file (#4031) [python] use last patch version of python for django weblogs (#4025) crashtracking: assert si_signo is set to 11 (#4023) # This is the commit message #2: [nodejs] Fix get_target_branch - "quotes, parens and # (#3952)"" (#3953) Co-authored-by: Charles de Beauchesne <[email protected]> # This is the commit message #3: Fix Standalone Billing values (#3965) # This is the commit message #4: Add success to valid WAF telemetry tags (#3966) # This is the commit message #5: Ensure tracer release coherence (#3967) [Nodejs] Code injection telemetry metric (#3959) Do not use special chars in "redacted" string used in scrubber (#3977) fix Context Propagation: Extraction feature_id (#3970) [dotnet] Enable Custom Blocking Response tests (#3971) [python] update flask base image (#3979) [ruby] Skip failing test for APMAPI-1141 (#3980) update weblog sampling_test use sampling rules instead of deprecated envvar (#3984) [python] enable Python IAST+SSRF tests (#2512) Signed-off-by: Juanjo Alvarez <[email protected]> [python] IAST Header source in werkzeug 3.1 (#3991) [python] switch flaky decorator for bug (#3990) [python] update versions for major release (#3993) [test optimization] Update config shape sent as telemetry (#3992) Add profiling scenarios to Python onboarding tests (#3002) Update changelog re-enable aws integrations tests (#3733) feat(tests/test_data_integrity): update test_datadog_external_env for Go v1.72.0 and forward (#3961) [python] Avoid passing global tracer to pin in weblog apps (#4004) All classes must declare feature ids (#4003) Extend mypy scope (#4002) Onboarding: bug marker profiling (#4005) Docker SSI: fix scenario (#4006) [ruby] Enable IP blocking tests for Ruby (#3937) [nodejs] remove auto login event skip (#3998) [NodeJS] skip failing baggage tests (#4015) [python] fix 500 errors in sql queries (#3997) Hotfix Fix fuzzer [python] use main again for dev branch (#4008) Co-authored-by: erikayasuda <[email protected]> Co-authored-by: Charles de Beauchesne <[email protected]> Revert agent dev fix (#4013) [skipci] Update CODEOWNERS for static files (#4012) [Java] Enable more easy wins (#4018) [java] Bump GraalVM system test to JDK 22 (#4001) [NodeJS] skip more failing baggage tests (#4021) [Debugger] Update dotnet Exception Replay tests (#3974) Test multiple rasp during one request (#3989) Add test for location extended data (#3978) Fix APPSEC_NO_STATS scenario name (#4019) Avoid false XPASS on APPSEC_WAF_TELEMETRY (#4029) [java] Enable Test_Blocking_strip_response_headers in some variants (#4033) [java] Remove some outdated manifest entries (#4039) [java] Fix xpass for Test_SecurityEvents_Appsec_Metastruct_Disabled (#4038) Consolidate remote config tests into same directory/file (#4031) [python] use last patch version of python for django weblogs (#4025) crashtracking: assert si_signo is set to 11 (#4023) class vs path
1 parent 5d1de3b commit d2064eb

File tree

273 files changed

+7428
-2024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+7428
-2024
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
/manifests/ruby.yml @DataDog/ruby-guild @DataDog/asm-ruby
3131

3232
# Allows everyone to easily make changes
33-
/tests/telemetry_intake/static/ @DataDog/apm-ecosystems
33+
/tests/telemetry_intake/static/ @DataDog/apm-sdk

.github/actions/get_target_branch/action.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ runs:
1616
id: extract
1717
shell: bash
1818
run: |
19-
branch=$(echo "${{ inputs.text }}" | grep -ioP '\[(?:java|dotnet|python|ruby|php|golang|cpp|agent|nodejs)@[^]]+(?=\])' | tr -d '[:space:]' || true)
19+
branch=$(echo "${INPUTS_TEXT}" | grep -ioP '\[(?:java|dotnet|python|ruby|php|golang|cpp|agent|nodejs)@[^]]+(?=\])' | tr -d '[:space:]' || true)
2020
2121
echo "target-branch=${branch#*@}" >> $GITHUB_OUTPUT
22+
23+
# the preferred approach to handling untrusted input is to set the value of the expression to an intermediate environment variable
24+
env:
25+
INPUTS_TEXT: ${{ inputs.text }}

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ jobs:
7474
run: ./utils/scripts/load-binary.sh ${{ matrix.library }}
7575
env:
7676
TARGET_BRANCH: "${{ steps.get-target-branch.outputs.target-branch }}"
77+
7778
- name: Get agent artifact
7879
run: ./utils/scripts/load-binary.sh agent
80+
7981
# ### appsec-event-rules is now a private repo. The GH_TOKEN provided can't read private repos.
8082
# ### skipping this, waiting for a proper solution
8183
# - name: Load WAF rules

.github/workflows/run-end-to-end.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ jobs:
113113
- name: Run APPSEC_STANDALONE_V2 scenario
114114
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_STANDALONE_V2"')
115115
run: ./run.sh APPSEC_STANDALONE_V2
116+
- name: Run APPSEC_NO_STATS scenario
117+
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_NO_STATS"')
118+
run: ./run.sh APPSEC_NO_STATS
116119
- name: Run IAST_STANDALONE scenario
117120
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_STANDALONE"')
118121
run: ./run.sh IAST_STANDALONE
@@ -135,7 +138,7 @@ jobs:
135138
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IPV6"') && inputs.library != 'ruby'
136139
run: ./run.sh IPV6
137140
- name: Run CROSSED_TRACING_LIBRARIES scenario
138-
if: always() && steps.build.outcome == 'success' && matrix.weblog != 'python3.12' && matrix.weblog != 'django-py3.13' && contains(inputs.scenarios, '"CROSSED_TRACING_LIBRARIES"')
141+
if: always() && steps.build.outcome == 'success' && matrix.weblog != 'python3.12' && matrix.weblog != 'django-py3.13' && matrix.weblog != 'spring-boot-payara' && contains(inputs.scenarios, '"CROSSED_TRACING_LIBRARIES"')
139142
# python 3.13 issue : APMAPI-1096
140143
run: ./run.sh CROSSED_TRACING_LIBRARIES
141144
env:
@@ -203,7 +206,7 @@ jobs:
203206
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD_NOCACHE"')
204207
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD_NOCACHE
205208
- name: Run AGENT_NOT_SUPPORTING_SPAN_EVENTS scenario
206-
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, 'AGENT_NOT_SUPPORTING_SPAN_EVENTS') && (inputs.library != 'ruby' || matrix.weblog == 'rack')
209+
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, 'AGENT_NOT_SUPPORTING_SPAN_EVENTS')
207210
run: ./run.sh AGENT_NOT_SUPPORTING_SPAN_EVENTS
208211
- name: Run APPSEC_MISSING_RULES scenario
209212
# C++ 1.2.0 freeze when the rules file is missing
@@ -269,6 +272,9 @@ jobs:
269272
- name: Run APPSEC_RASP scenario
270273
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_RASP"')
271274
run: ./run.sh APPSEC_RASP
275+
- name: Run APPSEC_RASP_NON_BLOCKING scenario
276+
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_RASP_NON_BLOCKING"')
277+
run: ./run.sh APPSEC_RASP_NON_BLOCKING
272278
- name: Run APPSEC_META_STRUCT_DISABLED scenario
273279
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_META_STRUCT_DISABLED"')
274280
run: ./run.sh APPSEC_META_STRUCT_DISABLED

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,15 @@ x_compute_python_aws_scenarios:
295295
parallel:
296296
matrix:
297297
- ONBOARDING_FILTER_WEBLOG: [test-app-python]
298-
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT]
298+
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT, HOST_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
299299
- ONBOARDING_FILTER_WEBLOG: [test-app-python-container,test-app-python-alpine]
300-
SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT]
300+
SCENARIO: [CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT, CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
301301
- ONBOARDING_FILTER_WEBLOG: [
302302
test-app-python,
303303
test-app-python-container,
304304
test-app-python-alpine
305305
]
306-
SCENARIO: [INSTALLER_AUTO_INJECTION]
306+
SCENARIO: [INSTALLER_AUTO_INJECTION, SIMPLE_AUTO_INJECTION_PROFILING]
307307
- ONBOARDING_FILTER_WEBLOG: [test-app-python]
308308
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
309309
- ONBOARDING_FILTER_WEBLOG: [test-app-python-multicontainer,test-app-python-multialpine]

.vscode/launch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@
164164
"justMyCode": true,
165165
"python": "${workspaceFolder}/venv/bin/python"
166166
},
167+
{
168+
"name": "Replay APPSEC_STANDALONE scenario",
169+
"type": "debugpy",
170+
"request": "launch",
171+
"module": "pytest",
172+
"args": ["-S", "APPSEC_STANDALONE", "-p", "no:warnings", "--replay"],
173+
"console": "integratedTerminal",
174+
"justMyCode": true,
175+
"python": "${workspaceFolder}/venv/bin/python"
176+
},
167177
{
168178
"name": "Python: Current File",
169179
"type": "python",

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
### 2025-01 (179 PR merged)
6+
7+
* 2025-01-20 [Deserialize JSON in multipart](https://github.com/DataDog/system-tests/pull/3854) by @cbeauchesne
8+
* 2025-01-14 [[python] add new python weblog: django-py3.13](https://github.com/DataDog/system-tests/pull/3798) by @christophe-papazian
9+
* 2025-01-09 [Removes CircleCI job](https://github.com/DataDog/system-tests/pull/3792) by @cbeauchesne
10+
* 2025-01-03 [Add an option that skip all tests if scenario contains only xfail/skip](https://github.com/DataDog/system-tests/pull/3768) by @cbeauchesne
11+
* 2025-01-27 [Try to get TARGET_BRANCH from PR's title](https://github.com/DataDog/system-tests/pull/3675) by @iunanua
12+
* 2025-01-30 [[golang] new orchestrion go weblog](https://github.com/DataDog/system-tests/pull/3555) by @eliottness
13+
* 2025-01-16 [Add tests for Service Extension (Envoy External Processing)](https://github.com/DataDog/system-tests/pull/3377) by @e-n-0
514

615
### 2024-12 (138 PR merged)
716

conftest.py

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from manifests.parser.core import load as load_manifests
1717
from utils import context
18-
from utils._context._scenarios import scenarios
18+
from utils._context._scenarios import scenarios, Scenario
1919
from utils.tools import logger
2020
from utils.scripts.junit_report import junit_modifyreport
2121
from utils._context.library_version import LibraryVersion
@@ -150,16 +150,20 @@ def pytest_configure(config) -> None:
150150
config.option.skip_empty_scenario = True
151151

152152
# First of all, we must get the current scenario
153+
154+
current_scenario: Scenario | None = None
155+
153156
for name in dir(scenarios):
154157
if name.upper() == config.option.scenario:
155-
context.scenario = getattr(scenarios, name)
158+
current_scenario = getattr(scenarios, name)
156159
break
157160

158-
if context.scenario is None:
161+
if current_scenario is not None:
162+
current_scenario.pytest_configure(config)
163+
context.scenario = current_scenario
164+
else:
159165
pytest.exit(f"Scenario {config.option.scenario} does not exist", 1)
160166

161-
context.scenario.pytest_configure(config)
162-
163167
if not config.option.replay and not config.option.collectonly:
164168
config.option.json_report_file = f"{context.scenario.host_log_folder}/report.json"
165169
config.option.xmlpath = f"{context.scenario.host_log_folder}/reportJunit.xml"
@@ -184,11 +188,8 @@ def pytest_sessionstart(session) -> None:
184188

185189
# called when each test item is collected
186190
def _collect_item_metadata(item):
187-
result = {
188-
"details": None,
189-
"testDeclaration": None,
190-
"features": [marker.kwargs["feature_id"] for marker in item.iter_markers("features")],
191-
}
191+
details: str | None = None
192+
test_declaration: str | None = None
192193

193194
# get the reason form skip before xfail
194195
markers = [*item.iter_markers("skip"), *item.iter_markers("skipif"), *item.iter_markers("xfail")]
@@ -197,32 +198,36 @@ def _collect_item_metadata(item):
197198

198199
if skip_reason is not None:
199200
# if any irrelevant declaration exists, it is the one we need to expose
200-
if skip_reason.startswith("irrelevant") or result["details"] is None:
201-
result["details"] = skip_reason
202-
203-
if result["details"]:
204-
logger.debug(f"{item.nodeid} => {result['details']} => skipped")
205-
206-
if result["details"].startswith("irrelevant"):
207-
result["testDeclaration"] = "irrelevant"
208-
elif result["details"].startswith("flaky"):
209-
result["testDeclaration"] = "flaky"
210-
elif result["details"].startswith("bug"):
211-
result["testDeclaration"] = "bug"
212-
elif result["details"].startswith("incomplete_test_app"):
213-
result["testDeclaration"] = "incompleteTestApp"
214-
elif result["details"].startswith("missing_feature"):
215-
result["testDeclaration"] = "notImplemented"
216-
elif "got empty parameter set" in result["details"]:
201+
if skip_reason.startswith("irrelevant") or details is None:
202+
details = skip_reason
203+
204+
if details is not None:
205+
logger.debug(f"{item.nodeid} => {details} => skipped")
206+
207+
if details.startswith("irrelevant"):
208+
test_declaration = "irrelevant"
209+
elif details.startswith("flaky"):
210+
test_declaration = "flaky"
211+
elif details.startswith("bug"):
212+
test_declaration = "bug"
213+
elif details.startswith("incomplete_test_app"):
214+
test_declaration = "incompleteTestApp"
215+
elif details.startswith("missing_feature"):
216+
test_declaration = "notImplemented"
217+
elif "got empty parameter set" in details:
217218
# Case of a test with no parameters. Onboarding: we removed the parameter/machine with excludedBranches
218219
logger.info(f"No parameters found for ${item.nodeid}")
219220
else:
220-
raise ValueError(f"Unexpected test declaration for {item.nodeid} : {result['details']}")
221+
raise ValueError(f"Unexpected test declaration for {item.nodeid} : {details}")
221222

222-
return result
223+
return {
224+
"details": details,
225+
"testDeclaration": test_declaration,
226+
"features": [marker.kwargs["feature_id"] for marker in item.iter_markers("features")],
227+
}
223228

224229

225-
def _get_skip_reason_from_marker(marker):
230+
def _get_skip_reason_from_marker(marker) -> str | None:
226231
if marker.name == "skipif":
227232
if all(marker.args):
228233
return marker.kwargs.get("reason", "")
@@ -443,7 +448,7 @@ def pytest_runtest_call(item) -> None:
443448

444449

445450
@pytest.hookimpl(optionalhook=True)
446-
def pytest_json_runtest_metadata(item, call) -> None:
451+
def pytest_json_runtest_metadata(item, call) -> None | dict:
447452
if call.when != "setup":
448453
return {}
449454

@@ -521,7 +526,7 @@ def export_feature_parity_dashboard(session, data) -> None:
521526
json.dump(result, f, indent=2)
522527

523528

524-
def convert_test_to_feature_parity_model(test) -> dict:
529+
def convert_test_to_feature_parity_model(test) -> dict | None:
525530
result = {
526531
"path": test["nodeid"],
527532
"lineNumber": test["lineno"],

docs/weblog/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,17 @@ Examples:
768768
- `GET`: `/rasp/ssrf?user_id="' OR 1 = 1 --"`
769769
- `POST`: `{"user_id": "' OR 1 = 1 --"}`
770770

771+
### \[GET\] /rasp/multiple
772+
The idea of this endpoint is to have an endpoint where multiple rasp operation take place. All of them will generate a MATCH on the WAF but none of them will block. The goal of this endpoint is to verify that the `rasp.rule.match` telemetry entry is updated properly. While this seems easy, the WAF requires that data given on `call` is passed as ephemeral and not as persistent.
773+
774+
In order to make the test easier, the operation used here need to generate LFI matches. The request will have two get parameters(`file1`, `file2`) which will contain a path that needs to be used as the parameters of the choosen lfi function. Then there will be another call to the lfi function with a harcoded parameter `'../etc/passwd'`. This will make `rasp.rule.match` to be equal to 3. A code example look like:
775+
776+
```
777+
lfi_operation($request->get('file1'))
778+
lfi_operation($request->get('file2'))
779+
lfi_operation('../etc/passwd') //This one is harcoded
780+
```
781+
771782
### GET /dsm/inject
772783
This endpoint is used to validate DSM context injection injects the correct encoding to a headers carrier.
773784

manifests/cpp.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ tests/:
160160
Test_Config_TraceEnabled: v1.0.1.dev
161161
Test_Config_TraceLogDirectory: missing_feature
162162
Test_Config_UnifiedServiceTagging: v1.0.1.dev
163+
Test_Stable_Config_Default: missing_feature
163164
test_crashtracking.py: missing_feature
164165
test_dynamic_configuration.py:
165166
TestDynamicConfigV1_EmptyServiceTargets: missing_feature

0 commit comments

Comments
 (0)