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

fix(asm): switch back to default if remote config stop sending the security rule file [backport 2.10] #10052

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

christophe-papazian
Copy link
Contributor

@christophe-papazian christophe-papazian commented Aug 2, 2024

backporting #10030

APPSEC-54105

(cherry picked from commit bc50e9c)

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

…curity rule file (#10030)

Security rule file is provided by ASM_DD through remote config.
This PR fix an issue where the WAF could be disabled if remote config
was deleting or deprecating the ASM_DD rule file.

After that PR, the WAF will stay enabled with the default recommended
rule file.

Also
- rename `rules` attribute to the more precise `rule_filename` in
`AppSecSpanProcessor`
- add a unit test to ensure that we never send an empty rule list to the
waf
- this will also be tested with the new system tests :
DataDog/system-tests#2839

APPSEC-54105

- [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 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 bc50e9c)
@christophe-papazian christophe-papazian added bug ASM Application Security Monitoring backport 2.9 labels Aug 2, 2024
@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: backport-10030-to-2.10
Commit report: fe0e28d
Test service: dd-trace-py

✅ 0 Failed, 119253 Passed, 57530 Skipped, 4h 18m 26.53s Total duration (5h 31m 21.35s time saved)

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 14.28571% with 24 lines in your changes missing coverage. Please review.

Project coverage is 10.19%. Comparing base (6de96d3) to head (fe0e28d).

Files Patch % Lines
tests/appsec/appsec/test_remoteconfiguration.py 0.00% 10 Missing ⚠️
ddtrace/appsec/_remoteconfiguration.py 0.00% 9 Missing ⚠️
ddtrace/appsec/_processor.py 50.00% 4 Missing ⚠️
tests/appsec/appsec/test_processor.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             2.10   #10052       +/-   ##
===========================================
- Coverage   74.37%   10.19%   -64.18%     
===========================================
  Files        1331     1308       -23     
  Lines      126443   124768     -1675     
===========================================
- Hits        94043    12724    -81319     
- Misses      32400   112044    +79644     

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

@christophe-papazian christophe-papazian marked this pull request as ready for review August 2, 2024 09:30
@romainkomorndatadog romainkomorndatadog merged commit e3f9004 into 2.10 Aug 2, 2024
171 of 174 checks passed
@romainkomorndatadog romainkomorndatadog deleted the backport-10030-to-2.10 branch August 2, 2024 09:53
github-actions bot pushed a commit that referenced this pull request Aug 2, 2024
…curity rule file [backport 2.10] (#10052)

backporting #10030

APPSEC-54105

(cherry picked from commit bc50e9c)

## 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 e3f9004)
christophe-papazian added a commit that referenced this pull request Aug 2, 2024
…curity rule file [backport 2.9] (#10053)

Backport e3f9004 from #10052 to 2.9.

backporting #10030

APPSEC-54105

(cherry picked from commit bc50e9c)

## 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: Christophe Papazian <114495376+christophe-papazian@users.noreply.github.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.9 bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants