Skip to content

Commit 112f8f0

Browse files
fix: avoid early and potentially unneeded iast import [backport 1.18] (#6722)
Backport edc7a42 from #6721 to 1.18. ## Checklist - [X] Change(s) are motivated and described in the PR description. - [X] Testing strategy is described if automated tests are not included in the PR. - [X] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [X] Change is maintainable (easy to change, telemetry, documentation). - [X] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [X] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [X] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Juanjo Alvarez Martinez <[email protected]>
1 parent 4ff9ac6 commit 112f8f0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ddtrace/contrib/subprocess/patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from ddtrace import Pin
1919
from ddtrace import config
20-
from ddtrace.appsec.iast.taint_sinks.command_injection import CommandInjection
2120
from ddtrace.contrib import trace_utils
2221
from ddtrace.contrib.subprocess.constants import COMMANDS
2322
from ddtrace.ext import SpanTypes
@@ -197,6 +196,8 @@ def __init__(self, shell_args, shell=False):
197196
)
198197

199198
if report_cmdi:
199+
from ddtrace.appsec.iast.taint_sinks.command_injection import CommandInjection
200+
200201
CommandInjection.report(evidence_value=report_cmdi)
201202

202203
def scrub_env_vars(self, tokens):
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fixes:
2+
- |
3+
ASM: avoid potentially unneeded import of the IAST native module.

0 commit comments

Comments
 (0)