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

Add support for dynamic exclusion filter data #316

Merged
merged 12 commits into from
Jul 11, 2024
Merged

Conversation

Anilm3
Copy link
Collaborator

@Anilm3 Anilm3 commented Jun 22, 2024

This PR introduces support for configurable exclusion filter data, allowing for exclusion filters with a specified matcher but undefined data from the get-go. This allows the update of the matcher without having to reinstantiate all exclusion filters and enables the suspicious attacker blocking features, which relies on a specific denylist.

The configuration key for this new dynamic data is exclusion_data, and the schema is exactly the same as the one used for rules_data, for example:

{
  "exclusion_data":  [
    {
      "id": "usr_data",
      "type": "data_with_expiration",
      "data": [
        {
          "value": "user",
          "expiration": 500
        }
      ]
    }
  ]
}

Related Jira: APPSEC-53545

@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2024

Codecov Report

Attention: Patch coverage is 80.70175% with 11 lines in your changes missing coverage. Please review.

Project coverage is 83.68%. Comparing base (4aa0a7a) to head (60ef9b7).

Files Patch % Lines
src/ruleset_builder.cpp 69.23% 5 Missing and 3 partials ⚠️
src/parser/data_parser.cpp 84.61% 0 Missing and 2 partials ⚠️
src/rule.hpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
- Coverage   83.70%   83.68%   -0.03%     
==========================================
  Files         137      137              
  Lines        6065     6086      +21     
  Branches     2869     2882      +13     
==========================================
+ Hits         5077     5093      +16     
- Misses        367      369       +2     
- Partials      621      624       +3     
Flag Coverage Δ
waf_test 83.68% <80.70%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@pr-commenter
Copy link

pr-commenter bot commented Jun 22, 2024

Benchmarks

Benchmark execution time: 2024-07-11 15:26:12

Comparing candidate commit 60ef9b7 in PR branch anilm3/exclusion-data with baseline commit 4aa0a7a in branch master.

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

scenario:lowercase_transformer.random

  • 🟩 execution_time [-72.569µs; -65.436µs] or [-3.971%; -3.580%]

scenario:remove_nulls_transformer.random

  • 🟩 execution_time [-2.102ms; -2.090ms] or [-17.124%; -17.021%]

scenario:ruleset_1.10.0.random

  • 🟩 execution_time [-9.432ms; -9.297ms] or [-3.419%; -3.370%]

@Anilm3 Anilm3 force-pushed the anilm3/exclusion-data branch from 73e52c7 to c526d8a Compare June 24, 2024 14:22
@Anilm3 Anilm3 marked this pull request as ready for review June 24, 2024 20:16
@Anilm3 Anilm3 requested a review from a team as a code owner June 24, 2024 20:16
@Anilm3 Anilm3 merged commit 38a4b0e into master Jul 11, 2024
44 checks passed
@Anilm3 Anilm3 deleted the anilm3/exclusion-data branch July 11, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants