LoginSignup
3

More than 5 years have passed since last update.

NATサーバにDSAをインストールする(Deep Security 9.5 / DSaaS)

Last updated at Posted at 2015-07-10

こんにちは、ひろかずです。

NATにDeep Security Agentをインストールする際の注意点です。
比較的有名なネタですが、Deep Security 9.5 / DSaaSでも同じことが起きますので、一筆書きます。

前提

  • Deep Security Manager 9.5sp1、またはDSaaSの導入が完了していること。
  • ライセンスを投入していること。
  • NATサーバを用意していること。

参照情報

インストールガイド(基本コンポーネント)の35頁

トレンドマイクロQ&Aページ
OS標準のファイアウォール機能の無効化について

知っておきたい注意点

結論から言うと、Deep Security Agentのds_filterが起動すると、iptablesのルーティング情報を消してしまいます。
Deep Security Agentのds_filterが起動する契機は、以下になります。

  • ファイアウォール機能、侵入防御機能のいずれかをオンにする。
  • ファイアウォール機能、侵入防御機能がオンになっている状態で、Deep Security Agentが起動する。

また、Deep Security Agentは、度々再起動しているようです。

回避策

参考資料に掲載されるとおり、iptablesに影響を及ぼさないファイルを作成しておく必要があります。
当該ファイルを作成するタイミングは、以下が考えられます。
- Deep Security Agentインストール前に作成しておく
- Deep Security Agentインストール後、ファイアウォール機能、侵入防御機能のいずれかを有効化する前に作成しておく

# touch /etc/use_dsa_with_iptables

復旧方法

上記回避策を実施する前に、Deep Security Agentをインストールし、ファイアウォール機能、侵入防御機能のいずれかを有効化した場合、以降の手順で状況を確認して、復旧させます。

1.状態確認

NATサーバを経由してインターネットに疎通できない場合、以下のように状況を確認します。
▽iptables 正常動作状態(例)

# /etc/rc.d/init.d/iptables status
テーブル: nat
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination
1    LOG        all  --  0.0.0.0/0            0.0.0.0/0            LOG flags 0 level 4
2    MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0

▽iptables ルーティング情報消去時(例)

# /etc/rc.d/init.d/iptables status
テーブル: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

テーブル: nat
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination

2.復旧作業

iptablesに影響を及ぼさないファイルを作成しておく。

# touch /etc/use_dsa_with_iptables

iptablesを再起動する。

# /etc/rc.d/init.d/iptables restart
iptables: ファイアウォールルールを消去中:                  [  OK  ]
iptables: チェインをポリシー ACCEPT へ設定中filter nat     [  OK  ]
iptables: モジュールを取り外し中:                          [  OK  ]
iptables: ファイアウォールルールを適用中:                  [  OK  ]

Deep Security Agnetを再起動する。

# /etc/init.d/ds_agent restart
ds_agent を停止中:                                         [  OK  ]
Unloading dsa_filter module...                             [  OK  ]
ds_agent を起動中:                                         [  OK  ]

3.動作確認

NATを経由してインターネットに出るサーバから、インターネットにcurlを実行して、内容が表示されれば、復旧です。

$ curl http://yahoo.co.jp
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Yahoo! - 301 Moved Permanently</title><style>
/* nn4 hide */
/*/*/
後略

意外と忘れてしまうので、注意しましょう。
お疲れ様でした。

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
3