Skip to content

WAF: enforce body size limitation#4355

Open
blotus wants to merge 4 commits intomasterfrom
enforce-max-body-size
Open

WAF: enforce body size limitation#4355
blotus wants to merge 4 commits intomasterfrom
enforce-max-body-size

Conversation

@blotus
Copy link
Member

@blotus blotus commented Mar 5, 2026

Allow to enforce body size limitation in the appsec datasource itself:

  • Action can be drop (drops the request) / partial (only process up to X bytes from the body) / allow (do not process the body at all)

This configuration is different from the one in coraza. Because we read the body ourselves before passing it to coraza, we need to be able to properly limit the amount of body buffered in memory.

For now, this only allows setting a global value used for all requests as handling this properly in pre_eval would require a lot of refactoring/changes.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

@blotus: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

@blotus: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 56.00000% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.02%. Comparing base (b509db4) to head (1447741).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
pkg/appsec/appsec.go 17.64% 14 Missing ⚠️
pkg/appsec/waf_helpers.go 0.00% 11 Missing ⚠️
pkg/acquisition/modules/appsec/appsec_runner.go 53.84% 3 Missing and 3 partials ⚠️
pkg/appsec/request.go 93.93% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4355      +/-   ##
==========================================
+ Coverage   63.00%   63.02%   +0.02%     
==========================================
  Files         473      473              
  Lines       33497    33540      +43     
==========================================
+ Hits        21105    21139      +34     
- Misses      10279    10288       +9     
  Partials     2113     2113              
Flag Coverage Δ
bats 46.53% <25.33%> (-0.04%) ⬇️
unit-linux 36.20% <54.66%> (+0.25%) ⬆️
unit-windows 24.67% <50.66%> (+0.24%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blotus
Copy link
Member Author

blotus commented Mar 5, 2026

/kind enhancement
/area appsec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/appsec kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant