0

AWS EC2 で iptables を叩くだけでは再起動時に毎回リセットされてしまうので
再起動しても反映されるようにしたいのですが
Amazon Linux2 の場合どこに何を設定するのが普通なのでしょうか

他の Linux だと
/etc/sysconfig/iptables にコマンドを書いて
sudo systemctl enable iptables
でいいみたいなんですが Amazon Linux2 だと iptables コマンド自体はあるのですが
Failed to execute operation: No such file or directory
となってしまいます


AWS inspector の結果

rule 3.5.1.2 Ensure loopback traffic is configured

という項目に違反していて

Rationale


Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure.

Run the following commands to implement the loopback rules:
                # iptables -A INPUT -i lo -j ACCEPT
                # iptables -A OUTPUT -o lo -j ACCEPT
                # iptables -A INPUT -s 127.0.0.0/8 -j DROP

を行うためです

3
  • 1
    参考: "Amazon EC2ではセキュリティグループを使って簡単にファイアウォールの設定を行うことができるので、iptablesやfirewalldを使うことはあまりありません。" - bit-hive.com/articles/20190807
    – cubick
    2020年2月4日 12:40
  • 実用上はそうなんですがセキュリティ要件で AWS inspector の HIGH 以上が存在しないことをエビデンスに出す必要があって、その中に iptables が動いてないという項目が high で存在しているのでやむなく対応しなければいけなくなった次第です
    – user35303
    2020年2月5日 3:20
  • 関連サイトでの類似質問: unix.stackexchange.com/q/225319/298771
    – cubick
    2020年2月5日 4:31

0

この質問に回答するには、ログインする必要があります。