5 Ocak 2020 Pazar

UFW - The Uncomplicated Firewall

Giriş
UFW mesajlarını dmesg ile görebiliriz. Şöyle yaparız.
[22661.447946] [UFW BLOCK] IN=eth0 OUT= MAC=ee:54:32:37:94:5f:f0:4b:3a:4f:80:30:08:00
 SRC=35.162.106.154 DST=104.248.41.4 LEN=40 TOS=0x00 PREC=0x00 TTL=37 ID=52549 DF
PROTO=TCP SPT=25 DPT=50616 WINDOW=0 RES=0x00 RST URGP=0
insert
Örnek
Açıklaması şöyle.
UFW rules are checked in sequence. The first rule that matches source and destination applies and remaining rules are ignored.

When you use a plain ufw deny the rule is added after the others (use ufw status to list the rules in order). If the soruce address matches an allow or limit line above your deny (and there is likely one), that allow/limit line applies and you rule is not checked.

To make sure your rule appears first, do:
Kurala sıra vermek için şöyle yaparız.
ufw insert 1 deny from 78.128.113.58/24 to any 
status
Örnek
Şöyle yaparız
$ sudo ufw status
Status: active

To                 Action      From
--                 ------      ----
22                 ALLOW       Anywhere
9200               DENY        Anywhere
6379/tcp           ALLOW       Anywhere
22 (v6)            ALLOW       Anywhere (v6)
9200 (v6)          DENY        Anywhere (v6)
6379/tcp (v6)      ALLOW       Anywhere (v6)

Hiç yorum yok:

Yorum Gönder