-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new segment: analysis/toptalkers-metrics (#66)
* added first working version of toptalkers_metrics segment * moved ticker from records to DB, records are now tracking if they are elegible for export, cleanup runs as separate goroutine, bucket duration is now configurable * forward flows based on traffic levels * added a metric for the DB size after cleanup * defined the segment as a filter segment, so drops can be used in the pipeline * added documentation and example for toptalkers-metrics * go mod tidy * go mod tidy * go version bumped from 1.18 to 1.20 * fuck yaml * updated Dockerfile to go 1.20 * updated dependencies --------- Co-authored-by: Sebastian Neuner <[email protected]>
- Loading branch information
Showing
9 changed files
with
734 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.18 AS builder | ||
FROM golang:1.20 AS builder | ||
RUN apt-get update | ||
|
||
# add local repo into the builder | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
############################################################################### | ||
# Consume flow messages, it's best to use an enriched topic as flowdump | ||
# printing involves interface descriptions. | ||
- segment: kafkaconsumer | ||
config: | ||
server: kafka01.example.com:9093 | ||
topic: flow-messages-enriched | ||
group: myuser-flowdump | ||
user: myuser | ||
pass: $KAFKA_SASL_PASS | ||
|
||
############################################################################### | ||
# filter for some interesting traffic, in this case something | ||
# that is likely used for DDoS attacks (UDP with source port 123 | ||
# is seen during NTP amplification attacks) | ||
- segment: flowfilter | ||
config: | ||
filter: "proto udp and src port 123" | ||
|
||
############################################################################### | ||
# creates OpenMetrics endpoints for traffic data | ||
# default endpoints are: | ||
# <host>:8080/flowdata | ||
# <host>:8080/metrics | ||
# the given labels in this example are the default ones. | ||
# They are also applied if the labels field is omitted. | ||
- segment: prometheus | ||
config: | ||
endpoint: ":8080" | ||
# 12 buckets at 5 seconds each -> 1 minute of sliding window | ||
buckets: 12 | ||
bucketduration: 5 | ||
# set some thresholds (here 1 Gbps) | ||
thresholdbps: 1000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.