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

ASM Data listener to update rule data #2588

Merged
merged 8 commits into from
Dec 15, 2022
Merged

Conversation

CarlesDD
Copy link
Contributor

@CarlesDD CarlesDD commented Dec 5, 2022

What does this PR do?

Updates rule data to libddwaf from RC client

Motivation

Rule data on DDWaf must be updated with the one available from RC

@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Merging #2588 (beed7c7) into master (8f6343f) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2588      +/-   ##
==========================================
+ Coverage   88.96%   89.01%   +0.04%     
==========================================
  Files         296      296              
  Lines       10295    10340      +45     
  Branches       33       33              
==========================================
+ Hits         9159     9204      +45     
  Misses       1136     1136              
Impacted Files Coverage Δ
packages/dd-trace/src/config.js 98.50% <ø> (-0.02%) ⬇️
packages/dd-trace/src/appsec/callbacks/ddwaf.js 100.00% <100.00%> (ø)
packages/dd-trace/src/appsec/index.js 100.00% <100.00%> (ø)
...ackages/dd-trace/src/appsec/remote_config/index.js 100.00% <100.00%> (ø)
...kages/dd-trace/src/appsec/remote_config/manager.js 100.00% <100.00%> (ø)
packages/dd-trace/src/appsec/rule_manager.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pr-commenter
Copy link

pr-commenter bot commented Dec 5, 2022

Benchmarks

Comparing candidate commit beed7c7 in PR branch live-update-rules-data-with-rc with baseline commit 8f6343f in branch master.

Found 5 performance improvements and 22 performance regressions! Performance is the same for 939 cases.

scenario:startup-with-tracer-14

  • 🟥 instructions [+5641163; +5985127] or [+1.604%; +1.702%]

scenario:log-without-log-14

  • 🟥 instructions [+5876445; +6015084] or [+1.663%; +1.702%]

scenario:log-skip-log-14

  • 🟥 instructions [+5882286; +6030074] or [+1.665%; +1.706%]

scenario:plugin-http-client-with-tracer-14

  • 🟥 max_rss_usage [+3.047KB; +3.286KB] or [+5.329%; +5.748%]

scenario:log-with-debug-14

  • 🟥 instructions [+5850656; +6025079] or [+1.656%; +1.705%]

scenario:plugin-bluebird-with-tracer-14

  • 🟥 max_rss_usage [+0.872KB; +0.925KB] or [+1.666%; +1.766%]

scenario:log-with-error-14

  • 🟥 instructions [+5875062; +6036263] or [+1.663%; +1.709%]

scenario:plugin-http-server-querystring-obfuscation-14

  • 🟥 cpu_usage_percentage [+0.616%; +1.094%]
  • 🟩 execution_time [-26.666ms; -14.323ms] or [-2.877%; -1.545%]

scenario:net-with-tracer-14

  • 🟩 cpu_user_time [-9.775ms; -5.871ms] or [-3.879%; -2.330%]
  • 🟩 execution_time [-9.284ms; -7.570ms] or [-2.395%; -1.953%]

scenario:startup-with-tracer-16

  • 🟥 instructions [+5580644; +5717923] or [+1.569%; +1.608%]

scenario:log-without-log-16

  • 🟥 execution_time [+2.315ms; +2.951ms] or [+1.591%; +2.028%]
  • 🟥 instructions [+5668688; +5746879] or [+1.587%; +1.609%]

scenario:log-skip-log-16

  • 🟥 instructions [+5704813; +5767577] or [+1.597%; +1.615%]

scenario:log-with-debug-16

  • 🟥 instructions [+5701071; +5774843] or [+1.596%; +1.617%]

scenario:log-with-error-16

  • 🟥 instructions [+5618564; +5688171] or [+1.573%; +1.592%]

scenario:plugin-dns-with-tracer-16

  • 🟥 max_rss_usage [+2.783KB; +3.115KB] or [+5.382%; +6.024%]

scenario:startup-with-tracer-18

  • 🟥 instructions [+5762503; +6022222] or [+1.522%; +1.591%]

scenario:log-without-log-18

  • 🟥 instructions [+5775433; +5908520] or [+1.513%; +1.548%]

scenario:appsec-control-18

  • 🟥 execution_time [+8.848ms; +11.905ms] or [+2.855%; +3.842%]

scenario:log-skip-log-18

  • 🟥 instructions [+5880305; +6023746] or [+1.541%; +1.579%]

scenario:log-with-debug-18

  • 🟥 instructions [+5878042; +5991175] or [+1.540%; +1.570%]

scenario:appsec-control-with-attacks-18

  • 🟥 execution_time [+8.413ms; +10.840ms] or [+2.694%; +3.471%]

scenario:plugin-q-with-tracer-18

  • 🟩 execution_time [-19.813ms; -14.010ms] or [-2.200%; -1.556%]
  • 🟩 instructions [-40052099; -30698962] or [-2.680%; -2.054%]

scenario:log-with-error-18

  • 🟥 instructions [+5814707; +5977427] or [+1.524%; +1.567%]

@uurien uurien force-pushed the live-update-rules-data-with-rc branch from 68537a1 to f677fb7 Compare December 13, 2022 14:19
@uurien uurien marked this pull request as ready for review December 14, 2022 10:53
@uurien uurien requested a review from a team as a code owner December 14, 2022 10:53
iunanua
iunanua previously approved these changes Dec 14, 2022
packages/dd-trace/src/appsec/remote_config/index.js Outdated Show resolved Hide resolved
packages/dd-trace/src/appsec/rule_manager.js Show resolved Hide resolved
@uurien uurien merged commit d975716 into master Dec 15, 2022
Qard pushed a commit that referenced this pull request Dec 22, 2022
* ASM Data listener to update rule data

* Update index.spec.js

* Merge rule data from RC

* Fixes and test

* Fix and test

* extract reducer function

* fixes

* Check remote config manager is initialized before call it

Co-authored-by: simon-id <simon.id@datadoghq.com>
Co-authored-by: Ugaitz Urien <ugaitz.urien@datadoghq.com>
Qard pushed a commit that referenced this pull request Dec 22, 2022
* ASM Data listener to update rule data

* Update index.spec.js

* Merge rule data from RC

* Fixes and test

* Fix and test

* extract reducer function

* fixes

* Check remote config manager is initialized before call it

Co-authored-by: simon-id <simon.id@datadoghq.com>
Co-authored-by: Ugaitz Urien <ugaitz.urien@datadoghq.com>
juan-fernandez pushed a commit that referenced this pull request Jan 3, 2023
* ASM Data listener to update rule data

* Update index.spec.js

* Merge rule data from RC

* Fixes and test

* Fix and test

* extract reducer function

* fixes

* Check remote config manager is initialized before call it

Co-authored-by: simon-id <simon.id@datadoghq.com>
Co-authored-by: Ugaitz Urien <ugaitz.urien@datadoghq.com>
juan-fernandez pushed a commit that referenced this pull request Jan 4, 2023
* ASM Data listener to update rule data

* Update index.spec.js

* Merge rule data from RC

* Fixes and test

* Fix and test

* extract reducer function

* fixes

* Check remote config manager is initialized before call it

Co-authored-by: simon-id <simon.id@datadoghq.com>
Co-authored-by: Ugaitz Urien <ugaitz.urien@datadoghq.com>
@simon-id simon-id deleted the live-update-rules-data-with-rc branch January 8, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants