github crowdsecurity/crowdsec v1.7.7

7 hours ago

CrowdSec 1.7.7 brings 2 major changes:

  • On linux, RE2 is now used by default for evaluating regexp in parsers
  • WAF rules can now contain a mix of AND/OR conditions without any limits, giving much greater flexibility when writing new rules

RE2 by default on linux

CrowdsSec has supported for a long time using RE2 as the regexp engine, and with this release we make it the default.

CrowdSec has always used the builtin Go regexp package, which is a Go reimplementation of the RE2 library, but with known performance limitations.

The switch to RE2 will bring significantly increased regexp performance (one of the most critical part of CrowdSec) at the cost of slightly longer regexp compilation and higher baseline memory usage.

Important

If you encounter any issues with the new regexp engine, you can fallback to the previous Go implementation by setting the feature flag re2_disable_grok_support (see the documentation).

Other changes

Other notable changes include:

  • a new kind attribute for alerts used to identify its source (a scenario, a WAF rule, a manual decision creation, ...)
  • a new cscli allowlist import command
  • support for the HTTP_PROXY environment variable in the notification-http plugin
  • A resource leak under high load was fixed

Full changelog

New Features

  • add LookupFile and FileMap expr helpers (#4372) @buixor
  • waf rules: allow arbitrary mix of AND and OR conditions (#4358) @blotus

Improvements

Bug Fixes

  • allowlists: apply items to existing decisions in batch (#4095) @blotus
  • waf: fix tests for modsec rules generation (#4385) @blotus
  • windows: add file notification plugin in MSI package (#4367) @blotus
  • leakroutine: call cancel after leakroutine returns (#4369) @blotus
  • notification-sentinel: lower-case x-ms-date header for correct HMAC (#4288) @ebirn
  • tests: remove temporary sqlite/plugin files from /tmp/ (#4332) @mmetc
  • pkg/apiserver: fix scenario count in debug log (#4333) @mmetc
  • pkg/csplugin: prevent race condition, deadlock (#4294) @mmetc
  • pkg/acquisitioncontext: minimal fix for data race in tests (#4327) @mmetc
  • acquisition/file: minimal fix for data race in tests (#4326) @mmetc
  • fix lint fsutil/freebsd: unnecessary conversion (#4324) @mmetc
  • cscli: consistent status and usage message for unknown subcommands (#4320) @mmetc
  • cscli detect: set log type for caddy unit to "syslog" (#4321) @mmetc
  • CI: add published_at to version.crowdsec.net/latest (#4291) @blotus
  • cmd/crowdsec: assign overflow after parsing (#4226) @mmetc
  • waf: format as CRS match only if anomaly score is not 0 (#4230) @blotus

Changes

  • build(deps): bump cryptography from 46.0.3 to 46.0.5 in /build/docker/test (#4298) @dependabot[bot]
  • support for waf- alias in cscli (#4347) @buixor
  • refact pkg/dumps: reduce complexity (#4209) @mmetc
  • lint: refact pkg/dumps for nilaway (#4208) @mmetc
  • refact pkg/parser: redundant indirection (#4344) @mmetc
  • refact pkg/parser: extract+embed NodeConfig in Node struct (#4343) @mmetc
  • move calls to trace.ReportPanic() on top of goroutines (#4338) @mmetc
  • pkg/csplugin: simplify notification loop; noop with empty queue (#4328) @mmetc
  • pkg/parsers: light refact, remove redundant code (#4213) @mmetc
  • refact cmd/crowdsec: encapsulate cache into alertBuffer (#4300) @mmetc
  • cmd/notification-*: don't provide the same context twice for request (#4316) @mmetc
  • don't flush 127.0.0.1 (#4315) @sabban
  • clipapi: replace tomb with errgroup (#4207) @mmetc
  • refact cmd/crowdsec: remove redundant global variable (#4299) @mmetc
  • refact: remove unused code in crowdsec-cli, apiserver, acquisition, database (#4304) @mmetc
  • refact pkg/leakybucket: trim down redundant Leaky struct fields (#4290) @mmetc
  • pkg/leakybucket: remove global bucketStore, unused parameters + tags (#4286) @mmetc
  • pkg/leakybucket: remove Simulated field from Leaky, keep it in config (#4285) @mmetc
  • pkg/leakybucket: extract BucketSpec from BucketFactory (#4284) @mmetc
  • refact pkg/leakybucket: extract methods from LoadBucket() part 2 (#4282) @mmetc
  • pkg/leakybucket: refact test loop, more explicit failures in testFile() (#4281) @mmetc
  • refact pkg/leakybucket: extract methods from LoadBucket() (#4279) @mmetc
  • pkg/leakybucket: replace Signal chan with explicit read/done chans (#4277) @mmetc
  • pkg/leakybucket: replace waitgroups with single rwlock (#4276) @mmetc
  • pkg/leakybucket: garbage collect: compare float with epsilon (#4275) @mmetc
  • pkg/leakybucket: refactor tests (#4272) @mmetc
  • pkg/leakybucket: replace sycn.Map with map + mutex (#4271) @mmetc
  • pkg/leakybucket: replace global counter with call to bucket store (#4273) @mmetc
  • pkg/leakybucket: review README.md (#4274) @mmetc
  • pkg/leakybucket: encapsulate store map + add methods (#4253) @mmetc
  • pkg/leakybucket: remove redundant bool var (#4252) @mmetc
  • fix hub console side (#4266) @sabban
  • version workflow fix (#4262) @sabban
  • rename the prod branch to main (#4261) @sabban
  • add version workflow (#4210) @sabban
  • pkg/leakybucket: remove unused global (#4251) @mmetc
  • pkg/leakybucket: pass bucket factories by pointer (#4250) @mmetc
  • pkt/leakybucket: compileScopeFilter() -> ScopeType.CompileFilter() (#4247) @mmetc
  • pkg/leakybucket: rename OverflowFilter -> OverflowProcessor (#4248) @mmetc
  • pkg/leakybucket: rename Buckets -> BucketStore (#4246) @mmetc
  • refact leaky bayesian: method to function, unlock w/defer (#4242) @mmetc
  • pkg/leakybucket: early return (#4244) @mmetc
  • pkg/leakybucket: variable shorthand (#4245) @mmetc
  • pkg/leakybucket: move LeakRoutine to method, rename parameters (#4243) @mmetc
  • pkg/leakybucket: review bucket validation and tests (#4241) @mmetc
  • refact: remove unnecessary pointers to map, string, mutex (#4212) @mmetc
  • pkg/leakybucket: function to method BucketFactory.LoadBucket() (#4229) @mmetc
  • pkg/leakybucket: BucketType interface, method BucketFactory.Validate() (#4228) @mmetc

Chore / Deps

Geolite2 notice

This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.

Installation

Take a look at the installation instructions.

Don't miss a new crowdsec release

NewReleases is sending notifications on new releases.