Portál AbcLinuxu, 12. května 2024 14:30


Dotaz: Zabezpecenie DNS

12.11.2014 11:33 trittler
Zabezpecenie DNS
Přečteno: 384×
Odpovědět | Admin
Zdravim, mam bind9 server + verejna staticka IP. Dnes som si vsimol tohoto :
root@mail:~# tail -f /var/log/syslog
Nov 12 11:23:14 mail named[16894]: client 68.2.181.144#57619: query (cache) 'sema.cz/ANY/IN' denied
Tie zaznamy sa stale opakuju
root@mail:~# tail -f /var/log/query.log 
client 68.2.181.144#26821: query: sema.cz IN ANY +E (192.168.0.31)
Chcem len vediet ci to mam dobre zabezpecene, alebo nieco mi tam este chyba. Na nete som asi nieco ako open dns, ale to moc nechcem.

Konfiguraky: named.conf
root@mail:~# cat /etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/etc/bind/rndc.key";

controls {
        inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};
trusted-keys {
	dlv.isc.org. 257 3 5 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
	};
named.conf.local
root@mail:~# cat /etc/bind/named.conf.local 
logging {
    channel query.log {
        file "/var/log/query.log";
        // Set the severity to dynamic to see all the debug messages.
        severity debug 3;
    };
    category queries { query.log; };
};

+ Zonove zaznamy

named.conf.options
root@mail:~# cat /etc/bind/named.conf.options
acl "allowed" {
	192.168.5.0/24;
	192.168.10.0/24;
	localhost;
	localnets;
};
options {
	directory "/var/cache/bind";
	allow-query { any; };
	allow-recursion { allowed; };
	allow-query-cache { allowed; };

  		forwarders {
		8.8.8.8;
		8.8.4.4;
		195.210.29.64;
		};
	rate-limit {
    		responses-per-second 5;
  	          };	       
	forward only;
	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;	
	also-notify {};
	fetch-glue no;
};

Nástroje: Začni sledovat (1) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

12.11.2014 11:37 trittler
Rozbalit Rozbalit vše Re: Zabezpecenie DNS
Odpovědět | | Sbalit | Link | Blokovat | Admin
log pocas jednej sekundy
root@mail:~# time tail -f /var/log/query.log 
client 221.229.162.197#30569: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#30569: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#6948: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#6948: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#1216: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#1216: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#45720: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#45720: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#11571: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#11571: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#1768: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#1768: drop REFUSED response to 221.229.162.0/24
client 80.250.115.133#22297: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#22297: drop REFUSED response to 80.250.115.0/24
client 80.250.115.133#58805: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#58805: slip REFUSED response to 80.250.115.0/24
client 221.229.162.197#17687: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#17687: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#3585: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#3585: drop REFUSED response to 221.229.162.0/24
client 80.250.115.133#16553: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#16553: drop REFUSED response to 80.250.115.0/24
client 221.229.162.197#9780: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#9780: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#49030: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#49030: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#4523: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#4523: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#63228: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#63228: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#29943: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#29943: slip REFUSED response to 221.229.162.0/24
client 80.250.115.133#2142: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#2142: slip REFUSED response to 80.250.115.0/24
client 221.229.162.197#12853: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#12853: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#18454: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#18454: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#12803: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#12803: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#11976: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#11976: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#42548: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#42548: drop REFUSED response to 221.229.162.0/24
client 80.250.115.133#27375: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#27375: drop REFUSED response to 80.250.115.0/24
client 221.229.162.197#17555: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#17555: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#46601: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#46601: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#51315: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#51315: slip REFUSED response to 221.229.162.0/24
client 80.250.115.133#48420: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#48420: slip REFUSED response to 80.250.115.0/24
client 221.229.162.197#33798: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#33798: drop REFUSED response to 221.229.162.0/24
client 80.250.115.133#3435: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#3435: drop REFUSED response to 80.250.115.0/24
client 221.229.162.197#58059: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#58059: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#62829: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#62829: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#25584: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#25584: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#32870: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#32870: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#64117: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#64117: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#21581: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#21581: drop REFUSED response to 221.229.162.0/24
client 80.250.115.133#48471: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#48471: slip REFUSED response to 80.250.115.0/24
client 221.229.162.197#39125: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#39125: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#64811: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#64811: drop REFUSED response to 221.229.162.0/24
client 80.250.115.133#50582: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#50582: drop REFUSED response to 80.250.115.0/24
client 221.229.162.197#2589: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#2589: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#42520: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#42520: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#14914: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#14914: slip REFUSED response to 221.229.162.0/24
client 80.250.115.133#19227: query: wradish.com IN ANY +E (192.168.0.31)
client 80.250.115.133#19227: slip REFUSED response to 80.250.115.0/24
client 221.229.162.197#6794: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#6794: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#57811: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#57811: slip REFUSED response to 221.229.162.0/24
client 221.229.162.197#46059: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#46059: drop REFUSED response to 221.229.162.0/24
client 221.229.162.197#7354: query: wradish.com IN ANY +E (192.168.0.31)
client 221.229.162.197#7354: slip REFUSED response to 221.229.162.0/24


real	0m1.260s
user	0m0.004s
sys	0m0.000s

12.11.2014 15:29 Andrej | skóre: 51 | blog: Republic of Mordor
Rozbalit Rozbalit vše Re: Zabezpecenie DNS
Odpovědět | | Sbalit | Link | Blokovat | Admin

Nevidím tam nikde DNSSEC, takže to máš naprosto nezabezpečené.

12.11.2014 22:05 NN
Rozbalit Rozbalit vše Re: Zabezpecenie DNS
Odpovědět | | Sbalit | Link | Blokovat | Admin
Jako zarazejici vidim v acl parametr localnets, ktery povoluje resolving pro vsechny site na stroji vcetne verejne, to v kombinaci s otevrenym nastavenim allow-query, allow-recursion defacto povoluje vsechno vsem. Takze je otazka k cemu vlastne tento resolver slouzi a nedivil bych se, kdyby se ho nekdo nepokusil zneuzit. Viz dolozeny pokus pravdepodobne o DNS amplification utok. Mohl by jsi odchytit, kolik toho priblizne prochazi? Neni mozne, se server uz nestiha odpovidat?
13.11.2014 10:31 j
Rozbalit Rozbalit vše Re: Zabezpecenie DNS
Ta verejna sit bude tak maximaplne jedno Ccko, ostatne v logu je videt, ze DNS odmita preklad. A pokud na nem bezi nejaka vlastni domena, tak stim stejne nic jinyho neudelas. Jedine nasadit nejakej script, kterej bude vyhodnocovat opakovany rejecty v logu a nasledne blokne prislusnou adresu/rozsah na firewallu.

Pokud to ma fungovat jako DNS cache, tak jednoduse na firewallu odstrelit (drop) vse, co prichazi zvenku.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.