B.2. 配置清单

This appendix briefly reiterates points from other sections in this manual in a condensed checklist format. This is intended as a quick summary for someone who has already read the manual. There are other good checklists available, including Kurt Seifried’s http://seifried.org/security/os/linux/20020324-securing-linux-step-by-step.html and http://www.cert.org/tech_tips/usc20_full.html.

FIXME: 这些内容基于手册的 1.4 版, 也许需要更新了..

  • 限制物理访问和启动

    • Enable a password in the BIOS.

    • Disable floppy/cdrom/… booting in the system’s BIOS.

    • 设置 LILO 或 GRUB 密码(/etc/lilo.conf/boot/grub/menu.lst, 分别); 检查LILO 或 GRUB 配置文件是否为只读保护.

  • 分区

    • 用户可写数据, 非系统数据, 和运行时频繁改变的数据与安装分区分离.

    • Set nosuid,noexec,nodev mount options in /etc/fstab on ext2/3 partitions that should not hold binaries such as /home or /tmp.

  • 密码学和登陆安全

    • 设置一个好的 root 密码

    • 安装并使用 PAM

      • 增加PAM 对 MD5 的支持, 并确保(一般而言) /etc/pam.d/ 下的文件中授权对机器的访问条目, 第二个域设为 requisiterequired

      • 调整 /etc/pam.d/login 以使只允许本地 root 登陆.

      • /etc/security/access.conf 中标记 authorized tty:s ,通常配置此文件以尽量限制 root 登录.

      • 如果要对每个用户设置限制, 增加 pam_limits.so.

      • 调整 /etc/pam.d/passwd: 增大密码的最小长度设置(可能为 6 字符) 并启用 MD5

      • 如果需要, 在 /etc/group 中增加 wheel 组; 在 /etc/pam.d/su 中增加 pam_wheel.so group=wheel条目

      • 适当的使用 pam_listfile.so 条目, 以习惯每个用户的控制

      • 增加 /etc/pam.d/other 文件, 以设置更高的安全性.

  1. - 配置 `/etc/security/limits.conf`(注意 如果您使用 PAM, `/etc/limits`不会被使用)
  2. - 配置 `/etc/login.defs`; 还有, 如果您启用了 MD5 和/或 PAM, 确保在对应处也做了修改
  3. - Tighten up `/etc/pam.d/login`
  4. - `/etc/ftpusers` 中禁止 root ftp 访问
  5. - Disable network root login; use su(1) or sudo(1). (consider installing sudo)
  6. - 使用 PAM 登录时强制附加另外的限制?
  • 网络访问限制

    • 安装和配置 ssh(建议在 /etc/ssh/sshd_config 中设置 PermitRootLogin No, 注意文章中的其它建议)

    • Disable or remove in.telnetd, if installed

    • 通常, 使用 update-inetd --disable 禁用 /etc/inetd.conf 中无用的服务(或全部禁用 inetd, 或使用 xinetdrlinetd 替换)

    • Disable other gratuitous network services; ftp, DNS, WWW etc should not be running if you do not need them and monitor them regularly. In most cases mail should be running but configured for local delivery only.

    • 对于您需要的那些服务, 不要仅仅使用通用版本, 寻找引入 Debian(或从其它地方)的更加安全的版本.无论使用什么, 都应当了解其风险.

    • 为外部用户和守护进程设置 chroot jail.

    • Configure firewall and tcpwrappers (i.e. hosts_access(5)); note trick for /etc/hosts.deny in text.

    • 如果运行了ftp, 设置您的ftpd服务器总是运行在chroot 了的用户家目录内

    • 如果运行了 X, 禁用 xhost 认证, 使用 ssh 替代; 最好禁用远程X 如果可以的话(为X命令行增加 -nolisten tcp 选项,通过在 /etc/X11/xdm/xdm-config中设置 requestPort 为 0, 关闭 XDMCP)

    • Disable remote access to printers

    • 任何 IMAP 或 POP 会话都使用 SSL 或 ssh 隧道; 如果为远程邮件用户提供此项服务,安装 stunnel

    • 配置日志主机, 并设置其它机器将日志发送到此主机(/etc/syslog.conf)

    • 增强 BIND, Sendmail, 和其它复杂守护进程的安全性.(运行在 chroot 中; 以非root pseduo 用户运行)

    • Install tiger or a similar network intrusion detection tool.

    • Install snort or a similar network intrusion detection tool.v

    • 如果可能不要使用 NIS 和 RPC(禁用 portmap).

  • 策略问题

    • 培训用户了解您的策略. 当您禁止某些在其它系统通常可以使用的事项时, 提供文档, 解释如何使用其它的以达到近似的效果, 或更安全的方法.

    • 禁止使用明文密码的协议(telnet, rsh 和类似的; ftp, imap, http, …).

    • 禁止使用 SVGAlib 的程序.

    • 启用磁盘配额.