Wykorzystujemy pliki cookies i podobne technologie w celu usprawnienia korzystania z serwisu Chomikuj.pl oraz wyświetlenia reklam dopasowanych do Twoich potrzeb.

Jeśli nie zmienisz ustawień dotyczących cookies w Twojej przeglądarce, wyrażasz zgodę na ich umieszczanie na Twoim komputerze przez administratora serwisu Chomikuj.pl – Kelo Corporation.

W każdej chwili możesz zmienić swoje ustawienia dotyczące cookies w swojej przeglądarce internetowej. Dowiedz się więcej w naszej Polityce Prywatności - http://chomikuj.pl/PolitykaPrywatnosci.aspx.

Jednocześnie informujemy że zmiana ustawień przeglądarki może spowodować ograniczenie korzystania ze strony Chomikuj.pl.

W przypadku braku twojej zgody na akceptację cookies niestety prosimy o opuszczenie serwisu chomikuj.pl.

Wykorzystanie plików cookies przez Zaufanych Partnerów (dostosowanie reklam do Twoich potrzeb, analiza skuteczności działań marketingowych).

Wyrażam sprzeciw na cookies Zaufanych Partnerów
NIE TAK

Wyrażenie sprzeciwu spowoduje, że wyświetlana Ci reklama nie będzie dopasowana do Twoich preferencji, a będzie to reklama wyświetlona przypadkowo.

Istnieje możliwość zmiany ustawień przeglądarki internetowej w sposób uniemożliwiający przechowywanie plików cookies na urządzeniu końcowym. Można również usunąć pliki cookies, dokonując odpowiednich zmian w ustawieniach przeglądarki internetowej.

Pełną informację na ten temat znajdziesz pod adresem http://chomikuj.pl/PolitykaPrywatnosci.aspx.

Nie masz jeszcze własnego chomika? Załóż konto
kazbiel
  • Prezent Prezent
  • Ulubiony
    Ulubiony
  • Wiadomość Wiadomość

Mężczyzna bikwa

widziany: 16.09.2025 17:18

dodatkowe uprawnienia
  • pliki muzyczne
    1300
  • pliki wideo
    1157
  • obrazy
    8196
  • dokumenty
    3448

41032 plików
796,53 GB

Ukryj opis
First install the Debian fail2ban package. By default it only watches and bans ssh. That is probably a good idea, further discussion of which is somewhat beyond the scope of this article.

apt-get install fail2ban

Then inspect the contents of /etc/fail2ban/jail.conf
As per the notes at the end of that file, you'll need to modify your bind logging so fail2ban can understand it.

First make the directory for the bind log file.

mkdir /var/log/named
chmod a+w /var/log/named

I'm sure a reader will complain about making a log file a+w, but it is the simplest way to make this demo work. In your spare time, once everything works, find a better way.

Next, edit /etc/bind/named.conf.local and add the following lines

logging {
channel security_file {
file "/var/log/named/security.log" versions 3 size 30m;
severity dynamic;
print-time yes;
};
category security {
security_file;
};
};

Restart Bind using /etc/init.d/bind9 restart
Test bind to make sure it's still working and also verify the log file /var/log/named/security.log is filling up with lines like this:

21-Jan-2009 07:19:54.835 client 66.230.160.1#28310: query (cache) './NS/IN' denied

OK, now to set up fail2ban. Edit the /etc/fail2ban/jail.conf file and change from:

[named-refused-udp]

enabled = false

to:

[named-refused-udp]

enabled = true

and from:

[named-refused-tcp]

enabled = false

to:

[named-refused-tcp]

enabled = true

Then restart fail2ban in the usual manner,

/etc/init.d/fail2ban restart

Now verify that fail2ban is doing something by checking out the log file located at /var/log/fail2ban.log it should contain something like

2009-01-21 07:34:32,800 fail2ban.actions: WARNING [named-refused-udp] Ban 76.9.16.171
2009-01-21 07:34:32,902 fail2ban.actions: WARNING [named-refused-tcp] Ban 76.9.16.171

Verify that fail2ban is modifying the iptables rules

iptables -L

Now verify that fail2ban's iptables rules are actually stopping access

tail -f /var/log/named/security.log

DNS error messages should be several minutes apart rather than multiple per second.

Now for some fine tuning.

First we have to modify logcheck to look at the new location of named error messages. Edit /etc/logcheck/logcheck.logfiles and add this to the end of the file:

/var/log/named/security.log

Next modify logcheck to report what fail2ban is doing. edit the same file, /etc/logcheck/logcheck.logfiles and add this line to the end of the file:

/var/log/fail2ban.log

Now verify you are getting both named and fail2ban messages in your hourly logcheck emails.

It would be a good idea to research, change, and test the [DEFAULT] ignoreip stanza in the /etc/fail2ban/jail.conf file. Maybe the package default should change to ignore all RFC1918 addresses. Probably you should ignore your LAN, just in case. At least ignore the source ip address of the machine that you usually use to SSH into your DNS server.

It would also be a good idea to think about the bantime = 600 setting in the /etc/fail2ban/jail.conf file. Maybe more than ten minutes would be appropriate. Since the DDOS attacks last "days", perhaps "hours" would be most appropriate.

As per above, think of a better way to assign permissions to the logfile directory /var/log/named. Maybe modify /etc/bind/named.conf.local and /etc/logcheck/logcheck.logfiles and /etc/fail2ban/jail.conf to not use that directory... maybe just use a file named /var/log/named.log

Last, but certainly not least, please compliment the maintainer of the debian package Yaroslav Halchenko and also the author of fail2ban, Cyril Jaquier

Thanks, and have a pleasant day.

http://www.debian-administration.org/articles/623

Nie ma plików w tym folderze

  • dokumenty
    0
  • obrazy
    0
  • pliki wideo
    0
  • pliki muzyczne
    0

0 plików
0 KB




Zaprzyjaźnione i polecane chomiki (663)Zaprzyjaźnione i polecane chomiki (663)
Zgłoś jeśli naruszono regulamin
W ramach Chomikuj.pl stosujemy pliki cookies by umożliwić Ci wygodne korzystanie z serwisu. Jeśli nie zmienisz ustawień dotyczących cookies w Twojej przeglądarce, będą one umieszczane na Twoim komputerze. W każdej chwili możesz zmienić swoje ustawienia. Dowiedz się więcej w naszej Polityce Prywatności