■環境
Debian8.1 (jessie)ufw 0.33-2
■ufw default denyでも内から外へは許可状態
以下のように設定した場合でも内から外への接続開始パケットは許可されている。
# ufw default deny
# ufw reset
# ufw enable
# ufw reset
# ufw enable
直接iptablesを叩いて設定状況を見てみると状況が確認できる。
# iptables -L | less
ちなみに名前解決せず直接IPアドレスで見たい場合はオプションに -n を追加。
# iptables -L -n | less
結果を見てみると、以下のような行が確認できる。
Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
ufw-before-logging-forward all -- anywhere anywhere
ufw-before-forward all -- anywhere anywhere
ufw-after-forward all -- anywhere anywhere
ufw-after-logging-forward all -- anywhere anywhere
ufw-reject-forward all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- anywhere anywhere
ufw-before-output all -- anywhere anywhere
ufw-after-output all -- anywhere anywhere
ufw-after-logging-output all -- anywhere anywhere
ufw-reject-output all -- anywhere anywhere
ufw-track-output all -- anywhere anywhere
注目箇所は Chain OUTPUT (policy ACCEPT)。target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
ufw-before-logging-forward all -- anywhere anywhere
ufw-before-forward all -- anywhere anywhere
ufw-after-forward all -- anywhere anywhere
ufw-after-logging-forward all -- anywhere anywhere
ufw-reject-forward all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- anywhere anywhere
ufw-before-output all -- anywhere anywhere
ufw-after-output all -- anywhere anywhere
ufw-after-logging-output all -- anywhere anywhere
ufw-reject-output all -- anywhere anywhere
ufw-track-output all -- anywhere anywhere
これがデフォルトACCEPTになっている為、内から外へは許可。
Chain INPUT、Chain FORWARDはpolicy DROPとなっているので通さない。
- Chain INPUT (policy DROP):
- 外部からNICに入ってくるパケットは全て破棄。DROPなのでログにも残さない。
- Chain FORWARD (policy DROP):
- 外部(NIC1)~内部~外部(NIC2)といった通過していくパケットは全て破棄。DROPなのでログにも残さない。
所謂ゲートウェイやルータの用途で使う場合が多い(例外もあった記憶。この辺は少しややこしい)。
- 外部(NIC1)~内部~外部(NIC2)といった通過していくパケットは全て破棄。DROPなのでログにも残さない。
0 件のコメント:
コメントを投稿