-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtest_command_injection.py
More file actions
38 lines (31 loc) · 1.58 KB
/
Copy pathtest_command_injection.py
File metadata and controls
38 lines (31 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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.
from utils import context, coverage, missing_feature, features
from .._test_iast_fixtures import BaseSinkTest
@features.iast_sink_command_injection
@coverage.basic
class TestCommandInjection(BaseSinkTest):
"""Test command injection detection."""
vulnerability_type = "COMMAND_INJECTION"
http_method = "POST"
insecure_endpoint = "/iast/cmdi/test_insecure"
secure_endpoint = "/iast/cmdi/test_secure"
data = {"cmd": "ls"}
location_map = {
"java": "com.datadoghq.system_tests.iast.utils.CmdExamples",
"nodejs": "iast/index.js",
"python": {"flask-poc": "app.py", "django-poc": "app/urls.py"},
}
@missing_feature(library="nodejs", reason="Endpoint not implemented")
def test_secure(self):
super().test_secure()
@missing_feature(context.library < "java@1.13.0", reason="Not implemented yet")
@missing_feature(library="dotnet", reason="Not implemented yet")
@missing_feature(library="python", reason="Not implemented yet")
def test_telemetry_metric_instrumented_sink(self):
super().test_telemetry_metric_instrumented_sink()
@missing_feature(context.library < "java@1.13.0", reason="Not implemented yet")
@missing_feature(library="python", reason="Not implemented yet")
def test_telemetry_metric_executed_sink(self):
super().test_telemetry_metric_executed_sink()