This is a prototype Fluent Bit container using a filter plugin which calls the GreyNoise API to drop, re-route, or enrich records. This specific filter leverages the Fluent Bit Lua script filter.
These instructions will cover usage information and for the docker container
In order to run this container you'll need docker installed.
In order to run make stats
you will need jq
installed
- Sign-Up for GreyNoise
- Copy
.env_example
to.env
- Copy your GreyNoise API key from the
Account
section in the top right corner - Replace the
<REPLACE_ME>
in.env
with your API key
docker run --env-file .env -it -p 2020:2020 -v $(PWD):/app greynoise/greynoise-fluentbit-lua:latest -c /app/conf/myconfig.conf
GREYNOISE_API_KEY
- GreyNoise API key to use for HTTP requests.GREYNOISE_IP_FIELD
- Named field from the Fluent Bit parser to use for IP lookups.GREYNOISE_LUA_LOG_LEVEL
- Lua logging level (info/error/warning/debug)GREYNOISE_LUA_CACHE_SIZE
- The number of IP records to cache in-memory before overwriting.
/app
- Core working directory (mounted from the base repo folder)
The sample data tests are meant to be run from the repo base folder.
This example just generates the same JSON line over and over.
- Copy
.env_example
to.env
- Copy your GreyNoise API key from the
Account
section in the top right corner - Replace the
<REPLACE_ME>
in.env
with your API key - Run
make build
- Run
make run
This example watches reads a log file in and watches for new lines.
- Run
make run-tail
- Run
make stats
in another terminal to see metrics
This is the same as #2 except this leverages rewrite_tag filter to drop records. This config drops invalid IPv4 records, bogon address space, GreyNoise RIOT records, and GreyNoise Noise records.
- Run
make run-rewrite
- Run
make stats
in another terminal to see metrics (note the drop rates)
- Create a directory for your configs
mkdir conf
- Add your Fluent Bit configs and parsers to
conf/
- Create a directory for your outputs
mkdir output
- You should now have a directory tree that looks something like the following:
conf/ parser.conf myconfig.conf output/ .env
- Run the docker command
docker run --env-file .env -it -p 2020:2020 -v $(PWD):/app greynoise/greynoise-fluentbit-lua:latest -c /app/conf/myconfig.conf
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Matt Lehman - Initial work - Obsecurus
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Eduardo Silva (https://github.com/edsiper) - guidance on Fluent Bit Lua optimizations
- leite (https://github.com/leite) -
greynoise/src/iputil.lua
module - rxi (https://github.com/rxi) -
greynoise/src/log.lua
module
Have any questions or comments about GreyNoise? Contact us at [email protected]