Skip to content

Commit d4343d3

Browse files
authored
chore(asm): iast remove trailing slash from non full path in vulnerability report (#5528)
IAST: Removes misleading trailing slash appearing on non-full path vulnerability reports ## 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/contributing.html#Release-Note-Guidelines) are followed. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] PR description includes explicit acknowledgement/acceptance of the performance implications of this PR as reported in the benchmarks PR comment. ## Reviewer Checklist - [ ] Title is accurate. - [ ] No unnecessary changes are introduced. - [ ] Description motivates each change. - [ ] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [ ] Testing strategy adequately addresses listed risk(s). - [ ] Change is maintainable (easy to change, telemetry, documentation). - [ ] Release note makes sense to a user of the library. - [ ] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment.
1 parent e5141b2 commit d4343d3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ddtrace/appsec/iast/taint_sinks/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def report(cls, evidence_value="", sources=None):
7474

7575
# Remove CWD prefix
7676
if file_name.startswith(CWD):
77-
file_name = file_name[len(CWD) :]
77+
file_name = os.path.relpath(file_name, start=CWD)
7878

7979
if isinstance(evidence_value, (str, bytes, bytearray)):
8080
evidence = Evidence(value=evidence_value)

tests/appsec/iast/test_weak_cipher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from tests.appsec.iast.fixtures.weak_algorithms import cryptography_algorithm
1212

1313

14-
FIXTURES_PATH = "/tests/appsec/iast/fixtures/weak_algorithms.py"
14+
FIXTURES_PATH = "tests/appsec/iast/fixtures/weak_algorithms.py"
1515

1616

1717
@pytest.mark.parametrize(

tests/appsec/iast/test_weak_hash.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from tests.appsec.iast.fixtures.weak_algorithms import parametrized_week_hash
1111

1212

13-
WEAK_ALGOS_FIXTURES_PATH = "/tests/appsec/iast/fixtures/weak_algorithms.py"
14-
WEAK_HASH_FIXTURES_PATH = "/tests/appsec/iast/test_weak_hash.py"
13+
WEAK_ALGOS_FIXTURES_PATH = "tests/appsec/iast/fixtures/weak_algorithms.py"
14+
WEAK_HASH_FIXTURES_PATH = "tests/appsec/iast/test_weak_hash.py"
1515

1616

1717
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)