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

chore(iast): move inner funcions #11570

Merged
merged 21 commits into from
Dec 23, 2024
Merged

chore(iast): move inner funcions #11570

merged 21 commits into from
Dec 23, 2024

Conversation

avara1986
Copy link
Member

@avara1986 avara1986 commented Nov 28, 2024

Remove inner functions from IAST code

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, 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

@avara1986 avara1986 added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring labels Nov 28, 2024
Copy link
Contributor

github-actions bot commented Nov 28, 2024

CODEOWNERS have been resolved as:

ddtrace/appsec/_iast/_listener.py                                       @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_context.py                        @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_debug.py                          @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_errors.py                         @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_taint_objects.py                  @DataDog/asm-python
benchmarks/appsec_iast_aspects/scenario.py                              @DataDog/asm-python
ddtrace/appsec/__init__.py                                              @DataDog/asm-python
ddtrace/appsec/_asm_request_context.py                                  @DataDog/asm-python
ddtrace/appsec/_common_module_patches.py                                @DataDog/asm-python
ddtrace/appsec/_iast/_handlers.py                                       @DataDog/asm-python
ddtrace/appsec/_iast/_iast_request_context.py                           @DataDog/asm-python
ddtrace/appsec/_iast/_patch.py                                          @DataDog/asm-python
ddtrace/appsec/_iast/_patches/json_tainting.py                          @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/__init__.py                        @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/_native.cpp                        @DataDog/asm-python
ddtrace/appsec/_iast/_taint_tracking/aspects.py                         @DataDog/asm-python
ddtrace/appsec/_iast/_taint_utils.py                                    @DataDog/asm-python
ddtrace/appsec/_iast/_utils.py                                          @DataDog/asm-python
ddtrace/appsec/_iast/reporter.py                                        @DataDog/asm-python
ddtrace/appsec/_iast/taint_sinks/command_injection.py                   @DataDog/asm-python
ddtrace/appsec/_iast/taint_sinks/header_injection.py                    @DataDog/asm-python
ddtrace/appsec/_iast/taint_sinks/insecure_cookie.py                     @DataDog/asm-python
ddtrace/appsec/_iast/taint_sinks/path_traversal.py                      @DataDog/asm-python
ddtrace/appsec/_iast/taint_sinks/ssrf.py                                @DataDog/asm-python
ddtrace/contrib/internal/langchain/patch.py                             @DataDog/ml-observability
riotfile.py                                                             @DataDog/apm-python
scripts/iast/leak_functions.py                                          @DataDog/asm-python
scripts/iast/mod_leak_functions.py                                      @DataDog/asm-python
scripts/iast/test_references.py                                         @DataDog/asm-python
tests/appsec/app.py                                                     @DataDog/asm-python
tests/appsec/iast/aspects/aspect_utils.py                               @DataDog/asm-python
tests/appsec/iast/aspects/test_add_aspect.py                            @DataDog/asm-python
tests/appsec/iast/aspects/test_add_aspect_fixtures.py                   @DataDog/asm-python
tests/appsec/iast/aspects/test_add_inplace_aspect.py                    @DataDog/asm-python
tests/appsec/iast/aspects/test_add_inplace_aspect_fixtures.py           @DataDog/asm-python
tests/appsec/iast/aspects/test_asyncio.py                               @DataDog/asm-python
tests/appsec/iast/aspects/test_bytearray_extend_aspect.py               @DataDog/asm-python
tests/appsec/iast/aspects/test_common_replace_aspects.py                @DataDog/asm-python
tests/appsec/iast/aspects/test_encode_decode_aspect.py                  @DataDog/asm-python
tests/appsec/iast/aspects/test_format_aspect_fixtures.py                @DataDog/asm-python
tests/appsec/iast/aspects/test_index_aspect_fixtures.py                 @DataDog/asm-python
tests/appsec/iast/aspects/test_io_aspects.py                            @DataDog/asm-python
tests/appsec/iast/aspects/test_join_aspect_fixtures.py                  @DataDog/asm-python
tests/appsec/iast/aspects/test_modulo_aspect_fixtures.py                @DataDog/asm-python
tests/appsec/iast/aspects/test_ospath_aspects.py                        @DataDog/asm-python
tests/appsec/iast/aspects/test_ospath_aspects_fixtures.py               @DataDog/asm-python
tests/appsec/iast/aspects/test_other_patching.py                        @DataDog/asm-python
tests/appsec/iast/aspects/test_re_aspects.py                            @DataDog/asm-python
tests/appsec/iast/aspects/test_replace_aspect.py                        @DataDog/asm-python
tests/appsec/iast/aspects/test_side_effects.py                          @DataDog/asm-python
tests/appsec/iast/aspects/test_slice_aspect_fixtures.py                 @DataDog/asm-python
tests/appsec/iast/aspects/test_split_aspect.py                          @DataDog/asm-python
tests/appsec/iast/aspects/test_str_aspect.py                            @DataDog/asm-python
tests/appsec/iast/fixtures/entrypoint/views.py                          @DataDog/asm-python
tests/appsec/iast/fixtures/taint_sinks/sql_injection_psycopg2.py        @DataDog/asm-python
tests/appsec/iast/fixtures/taint_sinks/sql_injection_sqlalchemy.py      @DataDog/asm-python
tests/appsec/iast/fixtures/taint_sinks/sql_injection_sqlite3.py         @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_command_injection.py                 @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_command_injection_redacted.py        @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_header_injection_redacted.py         @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_path_traversal.py                    @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_path_traversal_redacted.py           @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_sql_injection.py                     @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_sql_injection_redacted.py            @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_ssrf.py                              @DataDog/asm-python
tests/appsec/iast/taint_sinks/test_ssrf_redacted.py                     @DataDog/asm-python
tests/appsec/iast/taint_tracking/test_native_taint_range.py             @DataDog/asm-python
tests/appsec/iast/taint_tracking/test_taint_tracking.py                 @DataDog/asm-python
tests/appsec/iast/test_env_var.py                                       @DataDog/asm-python
tests/appsec/iast/test_grpc_iast.py                                     @DataDog/asm-python
tests/appsec/iast/test_iast_propagation_path.py                         @DataDog/asm-python
tests/appsec/iast/test_json_tainting.py                                 @DataDog/asm-python
tests/appsec/iast/test_taint_utils.py                                   @DataDog/asm-python
tests/appsec/iast/test_telemetry.py                                     @DataDog/asm-python
tests/appsec/iast_memcheck/test_iast_mem_check.py                       @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_attrs.py                        @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_beautifulsoup4.py               @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_cachetools.py                   @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_chartset_normalizer.py          @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_cryptography.py                 @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_docutils.py                     @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_exceptiongroup.py               @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_idna.py                         @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_iniconfig.py                    @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_jinja2.py                       @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_lxml.py                         @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_multidict.py                    @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_platformdirs.py                 @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_pyasn1.py                       @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_pygments.py                     @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_pynacl.py                       @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_pyparsing.py                    @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_python_multipart.py             @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_pyyaml.py                       @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_rsa.py                          @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_soupsieve.py                    @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_sqlalchemy.py                   @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_tomli.py                        @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_wrapt.py                        @DataDog/asm-python
tests/appsec/iast_packages/packages/pkg_yarl.py                         @DataDog/asm-python
tests/appsec/iast_packages/packages/utils.py                            @DataDog/asm-python
tests/appsec/iast_tdd_propagation/flask_orm_app.py                      @DataDog/asm-python
tests/appsec/iast_tdd_propagation/flask_propagation_views.py            @DataDog/asm-python
tests/appsec/iast_tdd_propagation/flask_taint_sinks_views.py            @DataDog/asm-python
tests/appsec/integrations/pygoat_tests/test_pygoat.py                   @DataDog/asm-python
tests/appsec/integrations/test_flask_iast_patching.py                   @DataDog/asm-python
tests/appsec/integrations/test_langchain.py                             @DataDog/asm-python
tests/appsec/integrations/test_psycopg2.py                              @DataDog/asm-python
tests/contrib/dbapi/test_dbapi_appsec.py                                @DataDog/asm-python
tests/contrib/django/django_app/appsec_urls.py                          @DataDog/asm-python
tests/contrib/django/test_django_appsec_iast.py                         @DataDog/asm-python
tests/contrib/fastapi/test_fastapi_appsec_iast.py                       @DataDog/asm-python
tests/contrib/flask/test_flask_appsec_iast.py                           @DataDog/asm-python
tests/smoke_test.py                                                     @DataDog/apm-core-python
.riot/requirements/10f3c55.txt                                          @DataDog/apm-python
.riot/requirements/1532dd6.txt                                          @DataDog/apm-python
.riot/requirements/1655cb3.txt                                          @DataDog/apm-python
.riot/requirements/1aa41b2.txt                                          @DataDog/apm-python
.riot/requirements/1c5581b.txt                                          @DataDog/apm-python
.riot/requirements/1f06d17.txt                                          @DataDog/apm-python
.riot/requirements/4de03a5.txt                                          @DataDog/apm-python
.riot/requirements/556d901.txt                                          @DataDog/apm-python
.riot/requirements/b6e9905.txt                                          @DataDog/apm-python

@avara1986 avara1986 marked this pull request as ready for review November 28, 2024 13:11
@avara1986 avara1986 requested a review from a team as a code owner November 28, 2024 13:11
@pr-commenter
Copy link

pr-commenter bot commented Nov 28, 2024

Benchmarks

Benchmark execution time: 2024-12-23 13:55:54

Comparing candidate commit 993f723 in PR branch avara1986/django_iast_tests with baseline commit 58ef74f in branch main.

Found 2 performance improvements and 0 performance regressions! Performance is the same for 392 metrics, 2 unstable metrics.

scenario:iast_aspects-ospathbasename_aspect

  • 🟩 max_rss_usage [-2.886MB; -2.598MB] or [-8.470%; -7.623%]

scenario:iast_aspects-ospathsplitext_aspect

  • 🟩 max_rss_usage [-2.799MB; -2.461MB] or [-8.222%; -7.231%]

@avara1986 avara1986 requested a review from a team as a code owner December 19, 2024 08:16
@avara1986 avara1986 requested review from a team as code owners December 19, 2024 15:19
@avara1986 avara1986 changed the title chore(ci): more django iast tests chore(iast): move inner funcions Dec 19, 2024
Copy link
Contributor

@Yun-Kim Yun-Kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Langchain changes look good from the MLObs team!

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

datadog-dd-trace-py-rkomorn bot commented Dec 23, 2024

Datadog Report

Branch report: avara1986/django_iast_tests
Commit report: 7a26f5a
Test service: dd-trace-py

✅ 0 Failed, 5 Passed, 1463 Skipped, 1m 50.15s Total duration (1h 10m 23.99s time saved)

@avara1986 avara1986 force-pushed the avara1986/django_iast_tests branch from 64d856e to 7a26f5a Compare December 23, 2024 10:37
@avara1986 avara1986 merged commit d46206c into main Dec 23, 2024
608 checks passed
@avara1986 avara1986 deleted the avara1986/django_iast_tests branch December 23, 2024 14:03
github-actions bot pushed a commit that referenced this pull request Jan 13, 2025
Remove inner functions from IAST code

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, 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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

(cherry picked from commit d46206c)
juanjux pushed a commit that referenced this pull request Jan 14, 2025
Remove inner functions from IAST code


## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, 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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
@juanjux juanjux mentioned this pull request Jan 14, 2025
3 tasks
erikayasuda pushed a commit that referenced this pull request Jan 14, 2025
Backport d46206c from #11570 to 2.19.

Remove inner functions from IAST code


## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, 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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

Co-authored-by: Alberto Vara <alberto.vara@datadoghq.com>
Co-authored-by: Taegyun Kim <taegyun.kim@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASM Application Security Monitoring backport 2.19 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.

7 participants