Bastille Linux


これも、Linuxディストリビューションの一つでもっとLinuxをセキュアにしようとしたものです。FireWallの設定で重宝できます。わざわざiptable を使った設定をする必要がなく、少し追加するぐらい?ですか。後、Linux Boxとしてのセキュアな環境を提供してくれます。

http://www.bastille-linux.org/ の所からBastille-1.2.0-1.1mdk.noarch.rpm(メインRPM)Bastille-Curses-module-1.2.0-1.1mdk.noarch.rpmperl-Curses-1.05-2mdk.i586.rpm を落としてきました。FWでXが動いてないんで当然の選択ですね。

これを早速、展開します。ただここで注意することがあって、

#rpm -i --nodeps perl-Curses-1.05-2mdk.i586.rpm 

をすることをRecHatを使う人は忘れないようにだそうです。それをインストールしたら

# InteractiveBastile -c

を実行して対話式に設定を進めていきます。

構成


設定は数字の上では13の構成に分かれていました。以下に順を追って説明を加えて行きます。

1 FireWall.pm
いわゆるFWの設定でした。内部と外部のそれぞれのインタフェースの指定、及びそれぞれのサービス(TCP,UDP,ICMP)の設定を行います。 ここでいうInternalは内部ネットワーク、Publicは外部ネットワークを指します。
Firewall.pm
filteringとmasquradingを使用するか? Yes
advanced Networking options
MasquradingとNATについて Yes
DNS Server
kernel2.2のipchainsを使うときはここは記述します。とりあえず[0.0.0.0/0]から[192.168.4.71/24]を指定しました。
interfaces names
信頼するinterfaceに関する設定。とりあえずDefaultのまま[lo0]と、内部ネットワークである[eth1]を指定します。。
Public interfaces
これデフォルトでは[eth+ ppp+ slip+]が指定されています。外部ネットワークのインタフェースなので[eth0]を指定しました。
Internal Interfaces
内部のインタフェースです。ここでは[eth1]を指定しました。
TCP services to audit
Public Interfaceに適用されるものです。このポートにアクセスがあったらlogとして残すそうです。デフォルトでは[telnet ftp imap pop-3 finger sunrpc exec login linuxconf ssh]が指定されています。ここではそのままにしておきます。
UDP services to audit
これは上のTCPをUDPに替えたものです。デフォルトでは[31337]です。
ICMP services to audit
ICMPについてです。
TCP service names or port numbers to allow on private services
外部に対しては何を開くか
UDP service names or port numbers to allow on private services
上と同じです。
Force passive mode
FTPのPassiveモードを認めるかです。ここは[Yes]にしました。[No]の場合はactiveモードのみの対応です。
TCP services to block

UDP services to block

これら二つはFTPに関する設定です。activeモードの時には念入りな設定がいるそうです。とりあえずデフォルトのままです。後で
# lsof -i
で確認できます。
ICMP allowed type
これはこの3つが基本です。 destination-unreachable,echo-reply,time-exceeded
Enable source address verification
ここは[Yes]にします。
Masqueraded networks
ここでは内部ネットワークを記述します。[192.168.10.0]
Kernel modules to masquerade
これは[ftp]にしておきました。
Reject method
これは DENY にしといていいでしょう。REJECTですと外から自分の存在がばれてしまうという事で。
Interface for DHCP queries
指定なし。
NTP servers to queries
上と同様。
ICMP types to disallow outbound
これはデフォルトでは[ ]です。
Should Bastille run the firewall and enable it at boot time?
これはboot時にbastille-firewallを起動するかどうかです。もちろん[Yes]。

2 File Permission.pm
ルート権限でないユーザがこれらのプログラムを実行できる。 このファイルのアクセス権を指定します。ルート権限でないユーザがこれらのプログラムを実行できます。

3 Account Security.pm
May we take strong steps to disallow the dangerous r-protocols ?
r系サービスを停止します。もちろん[Yes]。
Would you like to enforce passwored aging
Defaultで99,999dayパスワード変更なし。これを指定すると180日で変更するようにする。これをしなければアカウントが消える。/etc/login.defsで変更可。
Would you like to restrict the use of cron administrative accounts?
crondについて。これを設定していないと、全てのユーザがcronを使えることになる。/etc/cron.allow [Yes]。
Should we allow root to login on tty's1-6
リモートログインからのrootログインの無効。[Yes]。
Whold you like to password-protect the lilo boot?
Boot時に linux su とかでパスワードを要求する。[No]。
Would you like to reduce the LILO delay time to zero?
[No]。
Do you ever boot linux from the hard drive?
[Yes]。
Would you like to write the LILO changers to a boot floppy
[No]。
Would you like to disable Ctrl+Alt+Del rebooting
[Yes]。
Would you like to password protect single-user mode ?
[Yes]。

5 Secure Inetd.pm
inetd、xinetdの設定です。
default-deny on TCP Wrappers and xinetd
[No]。
May we deactivate telnet?
telnetdを起動しません[Yes]。
May we deactivate FTP?
ftpdを起動しません[Yes]。

6 Disable User Tools.pm

Would you like to disable compiler?
root権限以外でのアプリケーションのコンパイルを認めません。これもクラッカーによる不用意なアプリのインストールをさせないためです。[Yes]。

7 ConfigMiscPAM.pm

Would you like to put limits on system resource usage?
Dosを防ぐ役割です。[Yes]。
/etc/security/limits.confにこの内容がかかれています。
Should we restrict console access to a small group of user accounts?
[No]。
例としてCD-ROM driveをマウントできるような権利を区別します。

8 Logging.pm

Would you like to add additional logging ?
Alt-F7,Alt-F8のvirtual terminal上にlogメッセージを残す。log fileを変更しない。/var/log/kernel、/var/log/syslogに追加される。"warning","error"として表示されます。[Yes]。
Do you have a remote logging host?
[No]。
Would you like to set up process accounting ?
[No]。コマンドが実行された時間とUserIDの記録。CPUとHDの消費が激しい。

9 Miscelleneous Daemons.pm

Would you like to deactibate the routing daemon ?
[No]。

10 Sendmail.pm

Do you want to leave sendmail running in daemon mode ?
[Yes]。
Would you like to run sendmail running via cron to process the queue ?
[Yes]。上のsendmail daemon modeは不要。ここではcronによる定期的なsendmail
Would you like to disable the VRFY and EXPN sendmail commands ?
[Yes]。

13 Printing.pm

Would you like to disable printing ?
プリンタ必要なしならYesにしておく。

15 TMPDER.pm

Would you like to install TMPDER/TMP scripts /etc/profile.d scripts
マルチユーザ上での/tmpファイル書き込みをやめさせる。