0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure DNS security policyの実機検証

Posted at

背景

Azure DNS security policyはとても便利な機能です。VNetAにリンクして、ドメインリスト+DNS traffic action rulesを設定すれば、このVnetA配下のリソースの全部のDNS requestがログされますし、指定したDomainのAllow/Block/Alertの設定もできます。
実現できる内容は:
1.DNS Security policyをVnetにリンクした時点で、該当VnetリソースからのDNS通信は全部ログに記録されます。
2.特定のDomainのDNS Blockも設定できます。(Allow とAlertはあまり意味ないので、略します)

実機検証

環境構築は:

AzureVM: testVM ,
Vnet : VnetA,
DNS Security Policy :testdnspolicy
DNS Domain lists: googledomain1,yahoodomain2,baidudomain3

testVMがVnetAの配下にあり、testdnspolicyはVnetとリンク済み。診断設定のログを有効化しました。
DNS domain list の1,2,3に対して、それぞれAlert,Allow, BlockのActionsを設定しました。

nslookup コマンド結果と診断ログの結果

C:\Users\tanhiroshi>nslookup www.google.com
Server:  UnKnown
Address:  168.63.129.16

Non-authoritative answer:
Name:    www.google.com
Addresses:  2404:6800:4004:827::2004
          142.250.199.100

C:\Users\tanhiroshi>
C:\Users\tanhiroshi>nslookup www.yahoo.co.jp
Server:  UnKnown
Address:  168.63.129.16

Non-authoritative answer:
Name:    edge12.g.yimg.jp
Address:  183.79.250.251
Aliases:  www.yahoo.co.jp

C:\Users\tanhiroshi>
C:\Users\tanhiroshi>nslookup www.baidu.com
Server:  UnKnown
Address:  168.63.129.16

Non-authoritative answer:
Name:    www.baidu.com

image.png

結論

1.診断ログからみると、resolver policy rule action の値で以下の情報が分かります。
 1.No Matchの場合、つまりこのドメインはdomain listに載っていないです。
 2.Allowの場合、このドメインはDomainlistに載り、許可Actionで設定されています。
 3.Denyの場合、このドメインはDomainlistに載り、拒否Actionで設定されています。
 4.Noneの場合、このドメインはDomainlistに載り、Alert Actionで設定されています。

2.応答の状態が NOERROR や SERVFAIL などによって OperationName が変わると考えられる。

公開文章の中でdigでSERVFAIL statusで、DNSquerylogもOperationNameがFailureと表記していましたが、
現状 DNS Security Policy でブロックしたときの応答は NOERROR になる。
このため OperationName が RESPONSE_SUCCESS になります。
つまり、OperationNameでBlockを判断するのはできないですね。
https://learn.microsoft.com/en-us/azure/dns/dns-traffic-log-how-to?tabs=sign-portal#view-and-test-dns-logs

image.png

ログはあまり親切ではないですので、改善する余地があります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?