Giter VIP home page Giter VIP logo

Comments (2)

tlhackque avatar tlhackque commented on June 27, 2024

You don't need to change BlockCountries to write a new logfile. But you do need to change $LOG for the analysis to work if you change the file name or location.

The actual log entry is created by the kernel (netfilter).

To get output sent to another logfile, you need to configure the syslog daemon on your system.

There are a couple of them, depending on your distribution (and your choices). The most basic is syslogd; another popular one is rsyslogd.

rsyslogd will give you more choices, you can filter on the log prefix [Blocked CC]: I recommend it.

Edit /etc/syslog.conf, /etc/rsyslogd.conf, or /etc/rsyslog.d/iptables.conf -- see man syslog.conf or rsyslog.conf

You'll also need to update logrotate - or whatever you use to manage your log files.

Finally, you do need to update $LOG in BlockCountries so that it can read it when you ask for analysis. The '*' at the end of the filename is important. It allows BlockCountries to look at log files that have been rotated.

There's a pretty good general description of how to do this (not BlockCountries -specific) at https://blog.shadypixel.com/log-iptables-messages-to-a-separate-file-with-rsyslog/

Google will turn up other tutorials and other syslogd alternatives.

The latest release of BlockCountries allows you to set $LOGLEVEL to a non-default priority level, which may help with syslog filtering. However, because the kernel generates so many different message types and every priority is used by someone, you're better off using rsyslogd to filter.

The values for $LOGLEVEL are defined by syslog; usually 0-6 (or as names, EMERGENCY, ALERT, CRITICAL,ERROR,WARNING,NOTICE,INFORMATIONAL, and DEBUG)

As a practical matter, only NOTICE or INFORMATIONAL are useful.

from blockcountries.

tlhackque avatar tlhackque commented on June 27, 2024

Since I haven't heard from you in a week, I assume you are satisfied. I'm closing this issue.

In the future, please indicate whether issues that you raised are addressed satisfactorily and close your issues when they are.

Thanks.

from blockcountries.

Related Issues (19)

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.