-
Notifications
You must be signed in to change notification settings - Fork 14
python_lambda: re-enable appsec tests #5867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
florentinl
merged 3 commits into
main
from
florentin.labelle/APPSEC-60014/enable-appsec-lambda-tests
Dec 15, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| from utils import context, interfaces, missing_feature, rfc, scenarios, weblog, features, logger, flaky, bug | ||
| from utils import context, interfaces, missing_feature, rfc, scenarios, weblog, features, logger, flaky | ||
| from utils._weblog import HttpResponse | ||
| from types import EllipsisType | ||
|
|
||
|
|
@@ -263,7 +263,6 @@ def setup_request_method(self): | |
| headers={"user-agent": "dd-test-scanner-log-block"}, | ||
| ) | ||
|
|
||
| @bug(context.library >= "[email protected]", reason="APPSEC-60014") | ||
| def test_request_method(self): | ||
| """Can provide response body schema""" | ||
| assert self.request_noblock.status_code == 200 | ||
|
|
@@ -320,7 +319,6 @@ def setup_request_method(self): | |
| ) | ||
|
|
||
| @missing_feature(context.library < "[email protected]") | ||
| @bug(context.library >= "[email protected]", reason="APPSEC-60014") | ||
| def test_request_method(self): | ||
| """Can provide request header schema""" | ||
| schema_cookies = get_schema(self.request, "req.cookies") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,20 +4,14 @@ | |
|
|
||
| import json | ||
| import urllib.parse | ||
| import pytest | ||
|
|
||
| from utils import features, weblog, interfaces, scenarios, rfc, context | ||
| from utils import features, weblog, interfaces, scenarios, rfc | ||
|
|
||
| from tests.appsec.rasp.utils import ( | ||
| find_series, | ||
| validate_metric_variant_v2, | ||
| ) | ||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
| API10_TAGS = [ | ||
| "_dd.appsec.trace.req_headers", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import pytest | ||
|
|
||
| from utils import features, weblog, interfaces, scenarios, rfc, context | ||
| from utils.dd_constants import Capabilities | ||
|
|
@@ -16,12 +15,6 @@ | |
| BaseWAFVersion, | ||
| ) | ||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| @rfc("https://docs.google.com/document/d/1DDWy3frMXDTAbk-BfnZ1FdRwuPx6Pl7AWyR4zjqRFZw") | ||
| @features.rasp_command_injection | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import pytest | ||
|
|
||
| from utils import features, weblog, interfaces, scenarios, rfc, context | ||
| from utils import remote_config as rc | ||
|
|
@@ -19,13 +18,6 @@ | |
| ) | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| @rfc("https://docs.google.com/document/d/1vmMqpl8STDk7rJnd3YBsa6O9hCls_XHHdsodD61zr_4/edit#heading=h.3nydvvu7sn93") | ||
| @features.rasp_local_file_inclusion | ||
| @scenarios.appsec_rasp | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import pytest | ||
|
|
||
| from utils import features, weblog, interfaces, scenarios, rfc, context | ||
| from utils.dd_constants import Capabilities | ||
|
|
@@ -17,12 +16,6 @@ | |
| BaseWAFVersion, | ||
| ) | ||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| class Test_Shi_Base: | ||
| def get_shell_value(self): | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import pytest | ||
|
|
||
| from utils import features, weblog, interfaces, scenarios, rfc, context | ||
| from utils.dd_constants import Capabilities | ||
|
|
@@ -17,13 +16,6 @@ | |
| ) | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| @rfc("https://docs.google.com/document/d/1vmMqpl8STDk7rJnd3YBsa6O9hCls_XHHdsodD61zr_4/edit#heading=h.gv4kwto3561e") | ||
| @features.rasp_sql_injection | ||
| @scenarios.appsec_rasp | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import pytest | ||
|
|
||
| from utils import features, weblog, interfaces, scenarios, rfc, context | ||
| from utils.dd_constants import Capabilities | ||
|
|
@@ -17,13 +16,6 @@ | |
| ) | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| @rfc("https://docs.google.com/document/d/1vmMqpl8STDk7rJnd3YBsa6O9hCls_XHHdsodD61zr_4/edit#heading=h.3r1lwuv4y2g3") | ||
| @features.rasp_server_side_request_forgery | ||
| @scenarios.appsec_rasp | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import json | ||
| import pytest | ||
|
|
||
| from utils import ( | ||
| bug, | ||
|
|
@@ -19,12 +18,6 @@ | |
| HttpResponse, | ||
| ) | ||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| def _assert_custom_event_tag_presence(expected_value: str): | ||
| def wrapper(span: dict): | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,20 +3,11 @@ | |
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
|
|
||
| import pytest | ||
|
|
||
| from utils import weblog, context, interfaces, missing_feature, irrelevant, rfc, scenarios, features | ||
| from utils.tools import nested_lookup | ||
| from utils.dd_constants import PYTHON_RELEASE_GA_1_1 | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| TELEMETRY_REQUEST_TYPE_GENERATE_METRICS = "generate-metrics" | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import re | ||
| import pytest | ||
| from utils.dd_constants import Capabilities | ||
| from utils import features | ||
| from utils import interfaces | ||
|
|
@@ -13,12 +12,6 @@ | |
| ARACHNI_HEADERS = {"User-Agent": "Arachni/v1.5.1"} | ||
| DD_BLOCK_HEADERS = {"User-Agent": "dd-test-scanner-log-block"} | ||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| def get_span_meta(r: HttpResponse): | ||
| res = [span.get("meta", {}) for _, _, span in interfaces.library.get_spans(request=r)] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,18 +2,10 @@ | |
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
|
|
||
| import pytest | ||
|
|
||
| from utils import context, features, interfaces, irrelevant, scenarios, flaky | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| @scenarios.appsec_blocking | ||
| @scenarios.appsec_lambda_blocking | ||
| @scenarios.appsec_rasp | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,16 @@ | ||
| # Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0. | ||
| # This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| # Copyright 2021 Datadog, Inc. | ||
| import pytest | ||
|
|
||
| from utils import ( | ||
| interfaces, | ||
| scenarios, | ||
| weblog, | ||
| features, | ||
| context, | ||
| ) | ||
| from utils.dd_constants import Capabilities, SamplingPriority | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| @features.appsec_trace_tagging_rules | ||
| @scenarios.appsec_blocking | ||
| @scenarios.appsec_lambda_blocking | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| from pathlib import Path | ||
| import pytest | ||
|
|
||
| from utils import interfaces, bug, scenarios, weblog, rfc, missing_feature, flaky, features | ||
| from utils._context.core import context | ||
|
|
@@ -10,13 +9,6 @@ | |
| ) | ||
|
|
||
|
|
||
| if context.library > "[email protected]": | ||
| pytestmark = [ | ||
| pytest.mark.xfail(reason="bug (APPSEC-60014)"), | ||
| pytest.mark.declaration(declaration="bug", details="APPSEC-60014"), | ||
| ] | ||
|
|
||
|
|
||
| BLOCK_TEMPLATE_JSON_MIN_V1 = "blocked.v1.min.json" | ||
| BLOCK_TEMPLATE_HTML_MIN_V2 = "blocked.v2.min.html" | ||
| BLOCK_TEMPLATE_JSON_MIN_V3 = "blocked.v3.min.json" | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.