How to build Internet Server with Solaris 2.6

last update: 29 Sep 2004

home |index |contents |next |previous

tcpwrappers-7.6



"tcpwrappers"はログ機能つきのtcpdデーモンです。 tcpdを使うアプリケーション:ftp、telnetなどについて、外部からのアクセスを 拒否、許可に関わらず/etc/messagesや/etc/syslogなどに記録します。
注意 CERT/CCがTCPwrappersのセキュリティに関する問題点を指摘しました。

TCPwrappers自体のセキュリティ問題ではなく、トロイの木馬を仕掛けられたTCPwrappersが あるので注意せよとのことです。

http://www.cert.org/advisories/CA-99-01-Trojan-TCP-Wrappers.html

4.1 ソフトの入手
"tcpwrappers-7.6"を入手します。例えば以下のサイトから入手できます:
ftp://cert.org/pub/tools/tcp_wrappers
ftp://ftp.win.tue.nl/pub/security/
ftp://ftp.aist-nara.ac.jp/pub/Security/tool/tcp_wrappers

4.2 インストール
インストールはきわめて簡単です。 ファイルを展開するディレクトリ$Workに移動して、バイナリパッケージを展開します。作業ディレクトリ$Workは任意のディレクトリです。
    % cd $Work/
    % gzip -cd tcp_wrappers_7.6.tgz | tar xvf -

次に今作成されたディレクトリに移動し、makeを実行します。
make時のオプションとして次の二つを指定します:
    % cd $Work/tcp_wrappers_7.6
    % make REAL_DAEMON_DIR=/usr/sbin sunos5

次に生成されたtcpdデーモンをディレクトリ/usr/sbin以下にコピーして下さい。
    % mv /usr/sbin/tcpd /usr/sbin/tcpd.org
    % cp ./tcpd /usr/sbin/tcpd

4.3 コンフィギュレーション
tcpwrapperのコンフィギュレーションは/etc/hosts.allowと/etc/hosts.denyで行ないます。

読んで字の如く、"hosts.allow"でアクセスを許可するIPアドレスやドメインを指定し、 "hosts.deny"でアクセスを拒否するIPアドレスやドメインを指定します。

試しに以下の条件を実現する"hosts.allow"と"hosts.deny"を示します。


  1. hosts.allow
    以下のように、アクセスを許可するドメインを書き加えます。
    #
    # hosts.allow	This file describes the names of the hosts which are
    #		allowed to use the local INET services, as decided by
    #		the '/usr/sbin/tcpd' server.
    #
    # Version:	@(#)/etc/hosts.allow	1.00	05/28/93
    #
    # Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org
    #
    #
    ALL : 254.188.149.0/255.255.255.0
    ALL : 192.168.1.0/255.255.255.0
    ALL : 127.0.0.1
    
    # End of hosts.allow.
    

    /etc/hosts.allow


  2. hosts.deny
    アクセスを拒否するドメインを書きます。"hosts.allow"でアクセスを許可するドメインを書いている場合には、 単に"ALL : ALL"とするだけでそれ以外のドメインからのアクセスをすべて拒否することが出来ます。
    #
    # hosts.deny	This file describes the names of the hosts which are
    #		*not* allowed to use the local INET services, as decided
    #		by the '/usr/sbin/tcpd' server.
    #
    # Version:	@(#)/etc/hosts.deny	1.00	05/28/93
    #
    # Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org
    #
    #
    ALL : ALL
    # End of hosts.deny.
    

    /etc/hosts.deny



4.4 参考文献
以下の記事が参考になります。

・UNIX MAGAZINE 98.1 TCP wrapperを用いたセキュリティ (p.p.93-98)


home |index |contents |next |previous