🔥

AWS Network Firewall のルール評価順序を厳格(Strict Order) にしてもドメインリストルールグループが使える!

2023/02/03に公開

https://zenn.dev/nbxvxb/articles/96b693df69ea5a
ではまだドメインリストルールグループはルール評価順序を厳格(Strict Order) にすると使えないという話をしてましたが……

使えるようになったよ~!

https://docs.aws.amazon.com/network-firewall/latest/developerguide/document-history.html

Added evaluation order for stateful domain list rule groups

You can now configure evaluation order for your own stateful domain list rule groups.

December 21, 2022

これで煩わしい Suricata ルールを自前で書かなくても良くなりましたね。便利便利!
ただ、これには少しだけ罠がありまして

https://docs.aws.amazon.com/network-firewall/latest/developerguide/rule-group-stateful-creating.html

Choose Strict to provide your rules in the order that you want them to be evaluated. In your firewall policy, choose the Drop established option for the drop action. For information about strict evaluation order, see Strict evaluation order .

ドメインリストルールグループをルール評価順序 厳格(Strict Order) で使う場合、ステートフルルールのデフォルトアクションは "確立された接続のパケットをドロップ(Drop Established)" を選ばなきゃいけない ということ。
"すべてドロップ(Drop All)" を選んでいる場合、ドメインリストルールグループは機能しないので注意しなければなりませんね。

実際に "すべてドロップ(Drop All)" を選んだ場合、TCP 3-way Handshake が落とされるのでドメインリストルールグループは機能しません。
また、"確立された接続のパケットをドロップ(Drop Established)" を選ばないで、アクション選択無し、つまりルール評価順序は厳格(Strict Order) かつアクションはデフォルトの状態だと、ドメインリストルールグループの制御が及ばないので、これもまた正常に機能しないんですね。

要注意ポイントなので間違えないようにしましょう。

Discussion