くすくすっ探検隊がサーバー構築に立ち向かう -3ページ目

くすくすっ探検隊がサーバー構築に立ち向かう

うまくいかなくても笑ってないといけないよね。

■TCPラッパー
 inetdが管理するサービスにどのネットワークを許可するかのセキュリティ層をかぶせます。

Red Hat Enterprise Linux 4: リファレンスガイド TCPラッパーとxinetd

Red Hat Enterprise Linux 4: リファレンスガイド TCPラッパーの設定ファイル

■/etc/hosts.allow
 適合する規則があれば接続を許可します。

■/etc/hosts.deny
 適合する規則があれば接続は拒否されます。
以下はhosts.allowで許可させなかった場合に接続を拒否してログ出力します。

ALL : ALL : ( /bin/echo "$(/bin/date + '%%b %%d %%H:%%M:%%S') %H TCPW: %d >> /var/log/secure )

■ユーティリティ
tcpdchk

tcpdmacth in.telnetd 192.168.0.1



実践ネットワークセキュリティ監査―リスク評価と危機管理/クリス マクナブ
¥4,410
Amazon.co.jp

ネットワークセキュリティHacks 第2版 ―プロが使うテクニック & ツール 100+/Andrew Lockhart
¥3,360
Amazon.co.jp


■initdデーモン
 TCP/IPネットワークのほぼ全ての着信要求を処理するのがinitdデーモンです。initdデーモンはinitd.confのサービスに従いFTPのin.ftpdデーモンなどの処理を要求する。

Red Hat Enterprise Linux 4: リファレンスガイド xinetd

■/etc/initd.confの設定
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a
#telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd ← 不要なサービスはコメント化

■/etc/servicesの設定
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
ftp-data 20/tcp
ftp 21/tcp
ssh 22/tcp
ssh 22/udp
telnet 23/tcp ← 不要なサービスは削除



Linuxセキュリティトータルガイド―ファイアウォール・暗号化・侵入検知/アロン シャオ
¥4,410
Amazon.co.jp


■Linuxローダー(LILO)
 BIOSが制御をOSへ引き渡し、LinuxカーネルをロードするプログラムがLILOです。ブート時に以下のメッセージが表示されます。
 
 LILO boot:     ①
 Loading linux...  ②
 
 ①ブートプロンプトでカーネルイメージを選択したり
  引数を渡したりします。
  ・LILO boot:linux single
  ・LILO boot:linux init=/bin/bash
 ②カーネルロード時に表示されるメッセージです。

■/etc/lilo.confの設定
#
# /etc/lilo.confのグローバルセクション
#
boot=/dev/hda
install=/boot/boot.b
prompt
timeout=100
default=linux
password="password"   ←パスワードの設定
#
# /etc/lilo.confのグローバルセクション
#
other=/dec/hda1
  label=win
  image=/boot/vmlinuz-2.2.16
label=linux
  root=/dev/hda4
  vga=775
  append="hdc=ide-scsi"
  restricted   ←パスワード要求しない
  read-only

■/etc/lilo.confのアクセス権
chmod 600 /etc/lilo.conf


Linuxセキュリティトータルガイド―ファイアウォール・暗号化・侵入検知/アロン シャオ
¥4,410
Amazon.co.jp