7.1. 基本的なシステムのセットアップ

次のものは、基本的なシステムをセットアップする設定のサンプルです。
# Protect System Binaries
# システムバイナリの保護
#
/sbin/lidsconf -A -o /sbin                               -j READONLY
/sbin/lidsconf -A -o /bin                                -j READONLY

# Protect all of /usr and /usr/local
# (This assumes /usr/local is on a separate file system).
# /usr と /usr/local の保護
# (ここでは /usr/local は別のファイルシステム上にあると想定しています)
#
/sbin/lidsconf -A -o /usr                                -j READONLY
/sbin/lidsconf -A -o /usr/local                          -j READONLY

# Protect the System Libraries
#(/usr/lib is protected above since /usr/lib generally isn't
# on a separate file system than /usr)
# システムライブラリの保護
# (/usr/lib は普通 /usr と別のファイルシステム上にはないので、
#  すでに上で保護されています)
#
/sbin/lidsconf -A -o /lib                                -j READONLY

# Protect /opt
# /opt を保護
#
/sbin/lidsconf -A -o /opt				-j READONLY

# Protect System Configuration files
# システムの設定ファイルを保護
#
/sbin/lidsconf -A -o /etc                                -j READONLY
/sbin/lidsconf -A -o /usr/local/etc                      -j READONLY
/sbin/lidsconf -A -o /etc/shadow                         -j DENY
/sbin/lidsconf -A -o /etc/lilo.conf                      -j DENY

# Enable system authentication
# システムの認証を有効に
#
/sbin/lidsconf -A -s /bin/login -o /etc/shadow           -j READONLY
/sbin/lidsconf -A -s /usr/bin/vlock -o /etc/shadow       -j READONLY
/sbin/lidsconf -A -s /bin/su -o /etc/shadow              -j READONLY
/sbin/lidsconf -A -s /bin/su \
                  -o CAP_SETUID                          -j GRANT
/sbin/lidsconf -A -s /bin/su \
                  -o CAP_SETGID                          -j GRANT

# Protect the boot partition
# boot パーティションの保護
#
/sbin/lidsconf -A -o /boot                               -j READONLY

# Protect root's home dir, but allow bash history
# root のホームディレクトリを保護するが、bash の履歴は許可
#
/sbin/lidsconf -A -o /root                               -j READONLY
/sbin/lidsconf -A -s /bin/bash -o /root/.bash_history    -j WRITE

# Protect system logs
# システムログの保護
#
/sbin/lidsconf -A -o /var/log                            -j APPEND
/sbin/lidsconf -A -s /bin/login -o /var/log/wtmp         -j WRITE
/sbin/lidsconf -A -s /bin/login -o /var/log/lastlog      -j WRITE
/sbin/lidsconf -A -s /sbin/init -o /var/log/wtmp         -j WRITE
/sbin/lidsconf -A -s /sbin/init -o /var/log/lastlog      -j WRITE
/sbin/lidsconf -A -s /sbin/halt -o /var/log/wtmp         -j WRITE
/sbin/lidsconf -A -s /sbin/halt -o /var/log/lastlog      -j WRITE
/sbin/lidsconf -A -s /etc/rc.d/rc.sysinit \
                  -o /var/log/wtmp -i 1                  -j WRITE
/sbin/lidsconf -A -s /etc/rc.d/rc.sysinit \
                  -o /var/log/lastlog -i 1               -j WRITE

# Startup
#
/sbin/lidsconf -A -s /sbin/hwclock -o /etc/adjtime       -j WRITE


# Shutdown
#
/sbin/lidsconf -A -s /sbin/init -o CAP_INIT_KILL         -j GRANT
/sbin/lidsconf -A -s /sbin/init -o CAP_KILL              -j GRANT

# Give the following init script the proper privileges to kill processes and
# unmount the file systems.  However, anyone who can execute these scripts
# by themselves can effectively kill your processes.  It's better than
# the alternative, however.
# これらの起動スクリプトに、プロセスを kill したり ファイルシステムを
# アンマウントするための適切な権限を与えてください。とはいえ、これらの
# スクリプトを自分で実行る人はみな、効果的にプロセスを kill することが
# できます。ですが、他の方法よりはマシなはずです。
#
# Any ideas on how to get around this are welcome!
# これを解決するアイデアを歓迎します!
#
/sbin/lidsconf -A -s /etc/rc.d/init.d/halt \
                  -o CAP_INIT_KILL -i 1                  -j GRANT
/sbin/lidsconf -A -s /etc/rc.d/init.d/halt \
                  -o CAP_KILL -i 1                       -j GRANT
/sbin/lidsconf -A -s /etc/rc.d/init.d/halt \
                  -o CAP_NET_ADMIN -i 1                  -j GRANT
/sbin/lidsconf -A -s /etc/rc.d/init.d/halt \
                  -o CAP_SYS_ADMIN -i 1                  -j GRANT

# Other
#
/sbin/lidsconf -A -s /sbin/update -o CAP_SYS_ADMIN       -j GRANT