lost and found ( for me ? )

DNS Unbound

BINDの代替と言われているUnbound。

BINDに比べ、パフォーマンス、セキュリティで優れているらしい。
昨年はカミンスキー氏のポイズニング手法が発表されたこともあり、
セキュリティ面について、Unboundがどんなかんじなのかさわってみました。

すべてのオプションをチェックしたわけじゃないけど、
BINDよりセキュリティは優れていそうな感じ。

スプーフィングパケットを xx 個受けとると、自動でキャッシュをクリア
する機能がある。

unbound.conf の下記のオプション。

unwanted-reply-threshold: 1000

で、実際にテストしてみると、おー、すごい、シスログに下記の
メッセージを出して、キャッシュを自動でクリアした~。

unbound: [17643:0] warning: unwanted reply total reached threshold (1000) you may be under attack. defensive action: clearing the cache

他に、権威サーバに問い合わせるときに、大文字と小文字を混ぜるオプション
があるなー。

# Use 0x20-encoded random bits in the query to foil spoof attempts.
# This feature is an experimental implementation of draft dns-0x20.

use-caps-for-id: yes

で、dig( ファミコンでディグダグってやつあったなー) 、
してみると。

# dig @127.1 www.google.com.

おー、大文字と小文字混ぜてる。

# tshark -i eth0 port 53
unboundのIP -> 権威サーバのIP DNS Standard query A WwW.googLe.COm

カミンスキー攻撃の対策として、ソースポートのランダム化が有効らしいけど、
DNSプロトコルの実装上、ランダム化してもポイズニングされる確率が
減っただけで、ポイズニングされる確率がゼロになったわけではないらしい。

unbound だと、ソースポートのランダム化に加え、スプーフィングパケット
の検知・キャッシュクリア、大文字・小文字の混ぜ合わせとかあって、BINDより
セキュリティ強そうだな。
なかなかポイズニングされないのでは。。。と思う。

unwanted-reply-threshold 有効にしてれば、ログに出してくれるので、
ポイズニングが成功する前に、攻撃受けてるって気付きそうだし。

しかも統計情報に unwanted-replies って項目があって、スプーフィングパケット
をカウントしてる。すげ~。

# unbound-control stats

unwanted.replies=6605 <- これ

ナイスじゃないですか~。

統計情報もBINDより充実してるな~。
レスポンス時間のヒストグラムまである。。
これまたナイスじゃないですか~。

# unbound-control stats
thread0.num.queries=340
thread0.num.cachehits=11
thread0.num.cachemiss=329
thread0.num.recursivereplies=329
thread0.requestlist.avg=0.0273556
thread0.requestlist.max=8
thread0.requestlist.overwritten=0
thread0.requestlist.exceeded=0
thread0.requestlist.current.all=0
thread0.requestlist.current.user=0
thread0.recursion.time.avg=0.132001
thread0.recursion.time.median=0.0346645
total.num.queries=340
total.num.cachehits=11
total.num.cachemiss=329
total.num.recursivereplies=329
total.requestlist.avg=0.0273556
total.requestlist.max=8
total.requestlist.overwritten=0
total.requestlist.exceeded=0
total.requestlist.current.all=0
total.requestlist.current.user=0
total.recursion.time.avg=0.132001
total.recursion.time.median=0.0346645
time.now=1241025277.288877
time.up=935.553378
time.elapsed=23.144044
mem.total.sbrk=5410816
mem.cache.rrset=53020
mem.cache.message=102174
mem.mod.iterator=24664
mem.mod.validator=41392
histogram.000000.000000.to.000000.000001=0
histogram.000000.000001.to.000000.000002=0
histogram.000000.000002.to.000000.000004=0
histogram.000000.000004.to.000000.000008=0
histogram.000000.000008.to.000000.000016=0
histogram.000000.000016.to.000000.000032=0
histogram.000000.000032.to.000000.000064=0
histogram.000000.000064.to.000000.000128=0
histogram.000000.000128.to.000000.000256=0
histogram.000000.000256.to.000000.000512=0
histogram.000000.000512.to.000000.001024=0
histogram.000000.001024.to.000000.002048=0
histogram.000000.002048.to.000000.004096=0
histogram.000000.004096.to.000000.008192=0
histogram.000000.008192.to.000000.016384=0
histogram.000000.016384.to.000000.032768=0
histogram.000000.032768.to.000000.065536=0
histogram.000000.065536.to.000000.131072=311
histogram.000000.131072.to.000000.262144=13
histogram.000000.262144.to.000000.524288=4
histogram.000000.524288.to.000001.000000=1
histogram.000001.000000.to.000002.000000=0
histogram.000002.000000.to.000004.000000=0
histogram.000004.000000.to.000008.000000=0
histogram.000008.000000.to.000016.000000=0
histogram.000016.000000.to.000032.000000=0
histogram.000032.000000.to.000064.000000=0
histogram.000064.000000.to.000128.000000=0
histogram.000128.000000.to.000256.000000=0
histogram.000256.000000.to.000512.000000=0
histogram.000512.000000.to.001024.000000=0
histogram.001024.000000.to.002048.000000=0
histogram.002048.000000.to.004096.000000=0
histogram.004096.000000.to.008192.000000=0
histogram.008192.000000.to.016384.000000=0
histogram.016384.000000.to.032768.000000=0
histogram.032768.000000.to.065536.000000=0
histogram.065536.000000.to.131072.000000=0
histogram.131072.000000.to.262144.000000=0
histogram.262144.000000.to.524288.000000=0
num.query.type.A=340
num.query.class.IN=340
num.query.opcode.QUERY=340
num.query.tcp=0
num.query.ipv6=0
num.query.flags.QR=0
num.query.flags.AA=0
num.query.flags.TC=0
num.query.flags.RD=338
num.query.flags.RA=0
num.query.flags.Z=0
num.query.flags.AD=0
num.query.flags.CD=0
num.query.edns.present=0
num.query.edns.DO=0
num.answer.rcode.NOERROR=11
num.answer.rcode.NXDOMAIN=327
num.answer.rcode.REFUSED=2
num.answer.secure=0
num.answer.bogus=0
num.rrset.bogus=0
unwanted.queries=0
unwanted.replies=12198

ってことで、おもしろそうなので、もうちょいさわってみよう。

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.