Skip to content

Conversation

@blotus
Copy link
Member

@blotus blotus commented Oct 30, 2025

Allow to manually block requests from a pre_eval hook.

This allows for example to easily implement geoblocking by reusing existing crowdsec helpers:

 - filter: IsInBand == true && GeoIPEnrich(req.RemoteAddr)?.Country.IsoCode not in ["FR", "US"]
   apply:
     - SetReturnCode(400)
     - DropRequest("Forbidden Country")

@github-actions
Copy link

@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

@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.

@blotus
Copy link
Member Author

blotus commented Oct 30, 2025

/kind feature
/area appsec

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 79.92126% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.72%. Comparing base (41a6419) to head (af1ff05).

Files with missing lines Patch % Lines
pkg/acquisition/modules/appsec/appsec_runner.go 70.14% 11 Missing and 9 partials ⚠️
pkg/acquisition/modules/appsec/utils.go 84.55% 11 Missing and 8 partials ⚠️
pkg/appsec/appsec.go 80.00% 7 Missing and 3 partials ⚠️
pkg/appsec/tx.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4016      +/-   ##
==========================================
- Coverage   62.72%   62.72%   -0.01%     
==========================================
  Files         416      416              
  Lines       32969    33136     +167     
==========================================
+ Hits        20681    20783     +102     
- Misses      10168    10215      +47     
- Partials     2120     2138      +18     
Flag Coverage Δ
bats 46.29% <38.97%> (-0.12%) ⬇️
unit-linux 35.51% <79.92%> (+0.16%) ⬆️
unit-windows 24.84% <59.44%> (+0.12%) ⬆️

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 blotus added this to the 1.7.4 milestone Nov 7, 2025
interrupt = dropInfo.Interruption
}

if dropInfo != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge the ifs for clarity ?

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.

3 participants