18.3. 配置/etc/tw.config文件

/etc/tw.config文件是 Tripwire 配置文件,您可以在其中决定并设置要监控的系统文件和目录。 请注意,在编辑此文件之前,需要进行广泛的测试和经验积累才能获得可用的文件报告。 以下是一个可供您开始自定义的工作示例。

  1. 创建tw.config文件,使用 touch 命令/etc/tw.config并在该文件中添加所有您想监控的文件和目录。配置文件的格式在其头部和 man 手册 tw.config(5) 中进行了描述。
              # Gerhard Mourani: gmourani@videotron.ca
              # last updated: 1999/11/12 
    
              #  First, root's "home"
              /root	R
              !/root/.bash_history
              /	R
    
              # OS itself
              /boot/vmlinuz	R
    
              # critical boot resources
              /boot	R
    
              # Critical directories and files
              /chroot	R
              /etc	R
              /etc/inetd.conf	R
              /etc/nsswitch.conf	R
              /etc/rc.d	R
              /etc/mtab	L
              /etc/motd	L
              /etc/group	R
              /etc/passwd	L
    
              # other popular filesystems
              /usr	R
              /usr/local	R
              /dev	L-am
              /usr/etc	R
    
              # truncate home
              =/home	R
    
              # var tree
              =/var/spool	L
              /var/log	L
              /var/lib	L
              /var/spool/cron	L
              !/var/lock
    
              # unusual directories
              =/proc	E
              =/tmp
              =/mnt/cdrom
              =/mnt/floppy
              

  2. 现在,出于安全原因,将此文件的模式更改为0600使用以下命令
              [root@deep] /# chmod 600  /etc/tw.config