Skip to content

Commit 3f4261e

Browse files
authored
Merge branch 'main' into avara1986/APPSEC-56447-taint-fastapi-http-request-parameter-name
2 parents f708701 + 922c71b commit 3f4261e

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

hatch.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ dependencies = [
342342
test = [
343343
"uname -a",
344344
"pip freeze",
345-
"DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 _DD_APPSEC_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/django_tests/}",
345+
"DD_TRACE_AGENT_URL=\"http://testagent:9126\" DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 _DD_APPSEC_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/django_tests/}",
346346
]
347347

348348
[[envs.appsec_integrations_django.matrix]]
@@ -374,7 +374,7 @@ dependencies = [
374374
test = [
375375
"uname -a",
376376
"pip freeze",
377-
"DD_TRACE_AGENT_URL=http://localhost:9126 DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 _DD_APPSEC_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/flask_tests/}",
377+
"DD_TRACE_AGENT_URL=\"http://testagent:9126\" DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 _DD_APPSEC_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/flask_tests/}",
378378
]
379379

380380
[[envs.appsec_integrations_flask.matrix]]
@@ -444,8 +444,8 @@ fastapi = ["~=0.114.2"]
444444

445445
## ASM Appsec Aggregated Leak Testing
446446

447-
[envs.appsec_aggregated_leak_testing]
448-
template = "appsec_aggregated_leak_testing"
447+
[envs.iast_aggregated_leak_testing]
448+
template = "iast_aggregated_leak_testing"
449449
dependencies = [
450450
"pytest",
451451
"pytest-cov",
@@ -457,19 +457,20 @@ dependencies = [
457457
"pydantic-settings",
458458
]
459459

460-
[envs.appsec_aggregated_leak_testing.env-vars]
460+
[envs.iast_aggregated_leak_testing.env-vars]
461461
CMAKE_BUILD_PARALLEL_LEVEL = "12"
462462
DD_IAST_ENABLED = "true"
463+
_DD_IAST_PATCH_MODULES = "scripts.iast"
463464

464-
[envs.appsec_aggregated_leak_testing.scripts]
465+
[envs.iast_aggregated_leak_testing.scripts]
465466
test = [
466467
"uname -a",
467468
"pip freeze",
468469
"python -m pytest tests/appsec/iast_aggregated_memcheck/test_aggregated_memleaks.py",
469470
]
470471

471-
[[envs.appsec_aggregated_leak_testing.matrix]]
472-
python = ["3.10", "3.11", "3.12", "3.13"]
472+
[[envs.iast_aggregated_leak_testing.matrix]]
473+
python = ["3.10", "3.11", "3.12"]
473474

474475

475476

scripts/gen_gitlab_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def __str__(self) -> str:
5050
if wait_for:
5151
lines.append(" before_script:")
5252
lines.append(f" - !reference [{base}, before_script]")
53-
lines.append(f" - riot -v run -s --pass-env wait -- {' '.join(wait_for)}")
53+
if self.runner == "riot":
54+
lines.append(f" - riot -v run -s --pass-env wait -- {' '.join(wait_for)}")
5455

5556
env = self.env
5657
if not env or "SUITE_NAME" not in env:

tests/appsec/integrations/flask_tests/test_flask_remoteconfig.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def _request_403(client, debug_mode=False, max_retries=40, sleep_time=1):
187187
raise AssertionError("request_403 failed, max_retries=%d, sleep_time=%f" % (max_retries, sleep_time))
188188

189189

190-
@flaky(until=1706677200, reason="TODO(avara1986): We need to migrate testagent to gitlab")
191190
@pytest.mark.skipif(sys.version_info >= (3, 11), reason="Gunicorn is only supported up to 3.10")
192191
def test_load_testing_appsec_ip_blocking_gunicorn_rc_disabled():
193192
token = "test_load_testing_appsec_ip_blocking_gunicorn_rc_disabled_{}".format(str(uuid.uuid4()))
@@ -203,7 +202,6 @@ def test_load_testing_appsec_ip_blocking_gunicorn_rc_disabled():
203202
_unblock_ip(token)
204203

205204

206-
@flaky(until=1706677200, reason="TODO(avara1986): We need to migrate testagent to gitlab")
207205
@pytest.mark.skipif(sys.version_info >= (3, 11), reason="Gunicorn is only supported up to 3.10")
208206
def test_load_testing_appsec_ip_blocking_gunicorn_block():
209207
token = "test_load_testing_appsec_ip_blocking_gunicorn_block_{}".format(str(uuid.uuid4()))
@@ -221,7 +219,6 @@ def test_load_testing_appsec_ip_blocking_gunicorn_block():
221219
_request_200(gunicorn_client)
222220

223221

224-
@flaky(until=1706677200, reason="TODO(avara1986): We need to migrate testagent to gitlab")
225222
@pytest.mark.skipif(list(sys.version_info[:2]) != [3, 10], reason="Run this tests in python 3.10")
226223
def test_load_testing_appsec_ip_blocking_gunicorn_block_and_kill_child_worker():
227224
token = "test_load_testing_appsec_ip_blocking_gunicorn_block_and_kill_child_worker_{}".format(str(uuid.uuid4()))

tests/appsec/suitespec.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ suites:
7373
- '@remoteconfig'
7474
retry: 2
7575
runner: hatch
76+
iast_aggregated_leak_testing:
77+
parallelism: 3
78+
paths:
79+
- '@appsec_iast'
80+
- tests/appsec/iast_aggregated_memcheck/*
81+
runner: hatch
82+
timeout: 50m
7683
appsec_iast_packages:
7784
parallelism: 4
7885
paths:
7986
- '@appsec_iast'
8087
- tests/appsec/iast_packages/*
81-
retry: 2
8288
runner: hatch
8389
timeout: 50m
8490
appsec_integrations_pygoat:
@@ -107,7 +113,9 @@ suites:
107113
- tests/appsec/integrations/flask_tests/*
108114
retry: 2
109115
runner: hatch
110-
timeout: 30m
116+
services:
117+
- testagent
118+
timeout: 40m
111119
appsec_integrations_django:
112120
parallelism: 6
113121
paths:
@@ -120,6 +128,8 @@ suites:
120128
- tests/appsec/integrations/django_tests/*
121129
retry: 2
122130
runner: hatch
131+
services:
132+
- testagent
123133
timeout: 30m
124134
appsec_threats_django:
125135
parallelism: 12

0 commit comments

Comments
 (0)