Skip to content
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

feat: add a bunch (but not all) of aspects for os.path #9114

Merged
merged 36 commits into from
Apr 29, 2024

Conversation

juanjux
Copy link
Collaborator

@juanjux juanjux commented Apr 29, 2024

Note: this branches from #9113 so it will be easier to review once that PR has been merged.

Description

Implements the aspects for all functions in the os.path module that split a string into parts (plus normpath because it's trivial):

  • os.path.split
  • os.path.splitext
  • os.path.basename
  • os.path.dirname
  • os.path.normcase
  • os.path.splitdrive
  • os.path.splitroot

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

juanjux and others added 26 commits April 25, 2024 19:32
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
@juanjux juanjux changed the title Juanjux/appsec 11369 ospath splitters propagation feat: add a bunch (but not all) of aspects for os.path Apr 29, 2024
@juanjux juanjux self-assigned this Apr 29, 2024
@juanjux juanjux added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring labels Apr 29, 2024
Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
@pr-commenter
Copy link

pr-commenter bot commented Apr 29, 2024

Benchmarks

Benchmark execution time: 2024-04-29 17:33:16

Comparing candidate commit a58221d in PR branch juanjux/APPSEC-11369-ospath-splitters-propagation with baseline commit 02f7908 in branch main.

Found 5 performance improvements and 5 performance regressions! Performance is the same for 191 metrics, 9 unstable metrics.

scenario:sethttpmeta-collectipvariant_exists

  • 🟥 max_rss_usage [+750.894KB; +821.970KB] or [+3.596%; +3.937%]

scenario:sethttpmeta-no-collectipvariant

  • 🟥 max_rss_usage [+697.151KB; +777.818KB] or [+3.339%; +3.725%]

scenario:sethttpmeta-obfuscation-disabled

  • 🟩 max_rss_usage [-783.151KB; -702.468KB] or [-3.614%; -3.242%]

scenario:sethttpmeta-obfuscation-no-query

  • 🟥 max_rss_usage [+723.989KB; +805.048KB] or [+3.467%; +3.855%]

scenario:sethttpmeta-obfuscation-regular-case-explicit-query

  • 🟩 max_rss_usage [-1001.260KB; -934.919KB] or [-4.581%; -4.278%]

scenario:sethttpmeta-obfuscation-regular-case-implicit-query

  • 🟩 max_rss_usage [-911.027KB; -830.183KB] or [-4.180%; -3.809%]

scenario:sethttpmeta-useragentvariant_exists_2

  • 🟩 max_rss_usage [-800.366KB; -719.659KB] or [-3.697%; -3.324%]

scenario:sethttpmeta-useragentvariant_exists_3

  • 🟩 max_rss_usage [-779.337KB; -702.186KB] or [-3.599%; -3.243%]

scenario:sethttpmeta-useragentvariant_not_exists_2

  • 🟥 max_rss_usage [+523.616KB; +590.906KB] or [+2.490%; +2.810%]

scenario:tracer-medium

  • 🟥 max_rss_usage [+953.107KB; +1038.368KB] or [+4.691%; +5.111%]

Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com>
@juanjux juanjux marked this pull request as ready for review April 29, 2024 14:28
@juanjux juanjux requested a review from a team as a code owner April 29, 2024 14:28
@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 414 lines in your changes are missing coverage. Please review.

Project coverage is 6.59%. Comparing base (a331454) to head (06efa71).

Files Patch % Lines
tests/appsec/iast/aspects/test_ospath_aspects.py 0.00% 323 Missing ⚠️
...ppsec/iast/aspects/test_ospath_aspects_fixtures.py 0.00% 57 Missing ⚠️
...s/appsec/iast/fixtures/aspects/module_functions.py 0.00% 14 Missing ⚠️
ddtrace/appsec/_iast/_taint_tracking/__init__.py 0.00% 8 Missing ⚠️
ddtrace/appsec/_iast/_taint_tracking/aspects.py 0.00% 7 Missing ⚠️
ddtrace/appsec/_iast/_ast/visitor.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9114       +/-   ##
===========================================
- Coverage   78.38%    6.59%   -71.80%     
===========================================
  Files        1265     1235       -30     
  Lines      119065   117602     -1463     
===========================================
- Hits        93334     7755    -85579     
- Misses      25731   109847    +84116     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Apr 29, 2024

Datadog Report

Branch report: juanjux/APPSEC-11369-ospath-splitters-propagation
Commit report: 06efa71
Test service: dd-trace-py

✅ 0 Failed, 109167 Passed, 3420 Skipped, 11m 9.75s Total duration (32m 38.8s time saved)

@juanjux juanjux enabled auto-merge (squash) April 29, 2024 15:14
@juanjux juanjux merged commit e7a3d62 into main Apr 29, 2024
82 checks passed
@juanjux juanjux deleted the juanjux/APPSEC-11369-ospath-splitters-propagation branch April 29, 2024 18:13
erikayasuda added a commit that referenced this pull request May 10, 2024
erikayasuda added a commit that referenced this pull request May 10, 2024
@erikayasuda erikayasuda mentioned this pull request May 10, 2024
17 tasks
brettlangdon pushed a commit that referenced this pull request May 10, 2024
Reverting the following IAST PRs: #9113, #9114, #9085

They will be re-introduced in 2.10 after some investigation, but
reverting for now to un-block the 2.9.0 release pipeline.

## 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] Risks are described (performance impact, potential for breakage,
maintainability)
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed or label `changelog/no-changelog` is set
- [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))
- [x] If this PR changes the public interface, I've notified
`@DataDog/apm-tees`.

## Reviewer Checklist

- [x] Title is accurate
- [x] All changes are related to the pull request's stated goal
- [x] Description motivates each change
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- [x] Testing strategy adequately addresses listed risks
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] Release note makes sense to a user of the library
- [x] Author has 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)
juanjux added a commit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASM Application Security Monitoring changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants