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

appsec: allow to load multiple appsec-config per appsec datasource #2999

Closed
blotus opened this issue May 13, 2024 · 5 comments
Closed

appsec: allow to load multiple appsec-config per appsec datasource #2999

blotus opened this issue May 13, 2024 · 5 comments
Labels
area/appsec kind/enhancement New feature or request triage/accepted value/high Doing this significantly improves some areas
Milestone

Comments

@blotus
Copy link
Member

blotus commented May 13, 2024

Currently, only one appsec config is allowed per appsec datasource.
This is quite limiting, as if a user wants to have multiple set of rules (for example, vpatch rules + CRS), they will need to create a custom appsec config, which might or might not get new appsec rules depending on how it is written.

We should allow to load multiple appsec config, each config would be stand-alone (ie, hooks from one config would not affect the other one)

@blotus blotus added this to the 1.6.3 milestone May 13, 2024
Copy link

@blotus: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
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.

Copy link

@blotus: There are no 'kind' label on this issue. You need a 'kind' label to start the triage process.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind bug
  • /kind packaging
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.

@LaurenceJJones LaurenceJJones added the question Further information is requested label Jun 25, 2024
@LaurenceJJones
Copy link
Contributor

LaurenceJJones commented Jun 25, 2024

keep for 1.6.3 or not ? @blotus @buixor

@buixor buixor modified the milestones: 1.6.3, 1.6.4 Jul 5, 2024
@buixor buixor added kind/enhancement New feature or request triage/accepted area/appsec value/high Doing this significantly improves some areas and removed question Further information is requested needs/triage needs/kind labels Oct 15, 2024
@buixor
Copy link
Contributor

buixor commented Oct 30, 2024

Currently, several approaches are possible:

Solution 1 : We merge/concat everything

  • We append out of band/Inband Rules and on_load/pre_eval/post_eval/on_match Hooks.

  • For all possibly conflicting options ( default_pass_action, default_remediation , blocked_http_code, passed_http_code, user_blocked_http_code and user_passed_http_code) and (disable_body_inspection / request_body_in_memory_limit) the last one take the precedence.

  • For Hooks, they are all evaluated in-line, which means that in case of conflicting instructions (ie. SetRemediation), the last one will take the precedence.

# Solution 2 : We deal with them sequentially
We keep each AppsecRuntimeConfig on its own, and we process each of them sequentially

Loking at the code, solution #2 will imply an explosion of memory costs and doesn't look like a viable solution.

@buixor
Copy link
Contributor

buixor commented Nov 15, 2024

fixed in #3314

@buixor buixor closed this as completed Nov 15, 2024
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 triage/accepted value/high Doing this significantly improves some areas
Projects
None yet
Development

No branches or pull requests

3 participants