GithubHelp home page GithubHelp logo

whotwagner / dblfetch Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 46 KB

Fetches dynamic blacklists from web-sources and executes commands with the ip-ranges.

License: GNU General Public License v3.0

Dockerfile 0.62% Rust 99.38%
downloader firewall ipset linux security denylist

dblfetch's Introduction

dblfetch

Fetches dynamic denylists from web sources and executes commands with the IP-ranges.

How it works

dblfetch downloads denylists or ipsets from web-sources and parses all ip-ranges(in cidr-format or single ip-addresses). These IP ranges are then used in commands that are executed by dblfetch. Typically, these are commands for adding addresses to ipsets. dblfetch distinguishes whether it is an ipv4 or ipv6 address and executes different commands for each IP version. All downloaded denylists are stored in a cache, which is only updated when the time for this cache has expired. In this way, downloads are optimized to a minimum.

Features

  • Use cache with timeouts
  • Allow seperated commands for IPv4 and IPv6
  • Write logs
  • Multiple sources
  • Use http-loader

Build

Use cargo to build a release

cargo build -r

Using Docker

First create a build-container:

$ docker build -t dblfetchbuilder .

Use this builder to compile the app:

$ docker run -v $PWD/.:/myapp --rm dblfetchbuilder cargo build -r

Install

Copy the binary to $PATH

$ sudo cp target/release/dblfetch /usr/local/bin

Configure

Copy the config-file to /etc/dblfetch.yaml and edit its content.

$ sudo cp dblfetch.yaml /etc/dblfetch.yaml 

After that create the logfile /var/log/dblfetch.log and make it writeable for the user that runs dblfetch:

$ sudo touch /var/log/dblfetch.log
$ sudo chown dblfetch.dblfetch /var/log/dblfetch.log
$ sudo chmod 660 /var/log/dblfetch.log

You need to create the dblfetch-user first. Please note that dblfetch will write the cache-files to $HOME/.cache/dblfetch

Schedule Task

Set the following cronjob:

*/15 * * * * /usr/local/bin/dblfetch

Please note that it is recommended to execute dblfetch manually for the first time in order to find out how long it takes to run the task

License

GPL v3.0

Author

Wolfgang Hotwagner

dblfetch's People

Contributors

whotwagner avatar

Stargazers

b3n avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.