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): ast deny list #10540

Merged
merged 15 commits into from
Sep 13, 2024
Merged

chore(iast): ast deny list #10540

merged 15 commits into from
Sep 13, 2024

Conversation

avara1986
Copy link
Member

@avara1986 avara1986 commented Sep 6, 2024

Update the deny list of IAST AST patching. The objective of this PR is to improve the django startup applications

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

Copy link
Contributor

github-actions bot commented Sep 6, 2024

CODEOWNERS have been resolved as:

ddtrace/appsec/_iast/_ast/ast_patching.py                               @DataDog/asm-python

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

datadog-dd-trace-py-rkomorn bot commented Sep 6, 2024

Datadog Report

Branch report: avara1986/ast_denylist
Commit report: 0416a11
Test service: dd-trace-py

✅ 0 Failed, 1869 Passed, 212 Skipped, 41m 9.62s Total Time
❄️ 2 New Flaky

New Flaky Tests (2)

  • test_cmdi - test_pygoat.py - Last Failure

    Expand for error
     assert False
      +  where False = vulnerability_in_traces('COMMAND_INJECTION', <requests.sessions.Session object at 0x7f24c04d4990>)
      +    where <requests.sessions.Session object at 0x7f24c04d4990> = <class 'tests.appsec.integrations.pygoat_tests.test_pygoat.client.<locals>.RetClient'>.agent_session
    
  • test_sqli - test_pygoat.py - Last Failure

    Expand for error
     assert False
      +  where False = vulnerability_in_traces('SQL_INJECTION', <requests.sessions.Session object at 0x7f24c042c290>)
      +    where <requests.sessions.Session object at 0x7f24c042c290> = <class 'tests.appsec.integrations.pygoat_tests.test_pygoat.client.<locals>.RetClient'>.agent_session
    

@pr-commenter
Copy link

pr-commenter bot commented Sep 6, 2024

Benchmarks

Benchmark execution time: 2024-09-13 07:33:27

Comparing candidate commit 0416a11 in PR branch avara1986/ast_denylist with baseline commit de9f33b in branch main.

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

@avara1986 avara1986 marked this pull request as ready for review September 6, 2024 13:53
@avara1986 avara1986 requested a review from a team as a code owner September 6, 2024 13:53
@avara1986 avara1986 added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring labels Sep 6, 2024
Copy link
Collaborator

@juanjux juanjux left a comment

Choose a reason for hiding this comment

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

Blocking for now. I don't see the logic of banning all these modules, some of them look like could have propagation if properly patched, so I want to discuss that first.

@avara1986 avara1986 enabled auto-merge (squash) September 12, 2024 11:43
@avara1986 avara1986 changed the title feat(iast): ast deny list chore(iast): ast deny list Sep 12, 2024
@avara1986 avara1986 merged commit 111519b into main Sep 13, 2024
506 of 507 checks passed
@avara1986 avara1986 deleted the avara1986/ast_denylist branch September 13, 2024 08:16
avara1986 added a commit that referenced this pull request Sep 29, 2024
Introduced in #10540

We patch the problem, now we must figure out where is the error in
pydantic and pypika packages

## 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: Juanjo Alvarez Martinez <[email protected]>
github-actions bot pushed a commit that referenced this pull request Sep 29, 2024
Introduced in #10540

We patch the problem, now we must figure out where is the error in
pydantic and pypika packages

## 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: Juanjo Alvarez Martinez <[email protected]>
(cherry picked from commit 7e8eb0b)
avara1986 added a commit that referenced this pull request Sep 30, 2024
Backport 7e8eb0b from #10846 to 2.14.

Introduced in #10540

We patch the problem, now we must figure out where is the error in
pydantic and pypika packages

## 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 <[email protected]>
avara1986 added a commit that referenced this pull request Oct 8, 2024
A memory leak was introduced in #10540 when "py" was removed from the
deny list. This caused a leak in FastAPI with the `pypika` package.
#10846 patched the issue, and #10947 resolved it. Now, we're re-enabling
those packages.

This PR is tested in #10902

## 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)
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.

3 participants