Skip to content

Add event counter#312

Open
CapacitorSet wants to merge 4 commits into
honeytrap:masterfrom
CapacitorSet:feat-evt-ctr
Open

Add event counter#312
CapacitorSet wants to merge 4 commits into
honeytrap:masterfrom
CapacitorSet:feat-evt-ctr

Conversation

@CapacitorSet

Copy link
Copy Markdown
Contributor

Fixes #303, depends on #284.

Adds an event counter with a configurable period.

Example configuration:

[[filter]]
channel=["console"]
groupby=["category"]
period=5

This configuration groups events by the "category" key, so that eg. if one receives 10 HTTP requests in 3 seconds, the following event will be emitted:

transforms > group > original-category=http, group.count=10, token=[...], date=[...], category=group, sensor=transforms

Note that the event is fired 5 seconds after the first event, so a series of requests across 12 seconds will result in 3 separate events.

This feature opens interesting scenarios if used together with plugins (creating filters that could implement "count the number of root logins per hour", for example), which should probably be documented together with this feature. However, it's also somewhat pushing the limits of the "expressive power" granted by Honeytrap, which only allows for a data flow with a fixed order for transforms (eg. you can't use a filter after a plugin) and a fixed amount of transforms (there can only be one plugin, one group-by), an issue which might be worth looking into.

@CapacitorSet CapacitorSet force-pushed the feat-evt-ctr branch 4 times, most recently from c347c26 to 785db5e Compare May 3, 2018 13:53
@codecov-io

codecov-io commented Jul 10, 2018

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@674ac4f). Click here to learn what that means.
The diff coverage is 2.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #312   +/-   ##
=========================================
  Coverage          ?   43.57%           
=========================================
  Files             ?       70           
  Lines             ?     8336           
  Branches          ?        0           
=========================================
  Hits              ?     3632           
  Misses            ?     4288           
  Partials          ?      416
Impacted Files Coverage Δ
services/memcached.go 0% <ø> (ø)
services/dns-proxy.go 0% <ø> (ø)
services/counterstrike.go 0% <ø> (ø)
services/tftp.go 0% <ø> (ø)
server/honeytrap.go 3.05% <0%> (ø)
services/services.go 8.82% <6.25%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 674ac4f...a2090c6. Read the comment docs.

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.

channels: have repetitive event counters

2 participants