Chinaunix首页 | 论坛 | 博客
  • 博客访问: 89693
  • 博文数量: 36
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 410
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 10:43
文章分类

全部博文(36)

文章存档

2009年(31)

2008年(5)

我的朋友

分类: LINUX

2008-12-01 11:28:22

虽然是个很容易的东东,搞了两天我才把它理解啊。现在把它整理成文档,当做个记号。
##安装tripwire
wget
bunzip2 tripwire-2.4.1.2-src.tar.bz2
tar -xvf tripwire-2.4.1.2-src.tar
cd tripwire-2.4.1.2-src
./configure
   
make install

##中间会问global(site)和local密码,要记住啊。安装后配置文件都在 /usr/local/etc下。local密码生成数据库的时候需要,site密码在签名配置文件和策略文件需要
##site和local密钥也可以手动生成
# twadmin --generate-keys --site-keyfile site.key
# twadmin --generate-keys --local-keyfile zz130-local.key

##安装完修改配置文件和策略文件
cd /usr/local/etc/
vi twcfg.txt
cd /usr/local/etc/
vi twpol.txt

##生成新的策略文件 twpol.cfg
cd /usr/local/etc
twadmin -m P twpol.txt
或者 twadmin --create-polfile --cfgfile /usr/local/etc/tw.pol --site-keyfile /usr/local/etc/site_key /usr/local/etc/twpol.txt
##如果出现如下错误,说明没有找到策略文件或者策略文件配置有错误。
### Error: File could not be opened.
### Filename: /usr/local/etc/twpol.txt

##生成新的配置文件 tw.cfg
twadmin -m F twcfg.txt
或者twadmin --create-cfgfile --cfgfile /usr/local/etc/tw.cfg --site-keyfile site_key /usr/local/etc/twcfg.txt



##初始化指纹库
tripwire -m i -v
##初始化数据库
tripwire  --init
##更新数据库
cd /usr/local/lib/tripwire
tripwire --update --twrfile mail.zoosoft.net-20070615-040442.twr

###tripware 做初始化检查
tripwaire --check
tripwire  --check  --rule-name "name"
tripware  --check  /usr/lib
# 严重程度检查
tripwire --check --severity 40

##查看数据库   
cd /usr/local/lib/tripwire
 twprint --print-dbfile --dbfile  zz130.twd |more
或者 twprint -m d  --dbfile  zz130.twd |more

##报告列表
cd /usr/local/lib/tripwire/report
twprint --print-report --twrfile mail.linuxfly.org-20070614-155313.twr
或者  twprint -m r  --twrfile  mail.linuxfly.org-20070614-155313.twr


## 修改配置文件规则,完整行检查项目:
  ##############################################################################
 #  Predefined Variables                                                      #
##############################################################################
#
#  Property Masks
#
#  -  ignore the following properties
#  +  check the following properties
#
#  a  access timestamp (mutually exclusive with +CMSH)
#  b  number of blocks allocated
#  c  inode creation/modification timestamp
#  d  ID of device on which inode resides
#  g  group id of owner
#  i  inode number
#  l  growing files (logfiles for example)
#  m  modification timestamp
#  n  number of links
#  p  permission and file mode bits
#  r  ID of device pointed to by inode (valid only for device objects)
#  s  file size
#  t  file type
#  u  user id of owner
#
#  C  CRC-32 hash
#  H  HAVAL hash
#  M  MD5 hash
#  S  SHA hash
#
##############################################################################
#配置变量
 
Device        = +pugsdr-intlbamcCMSH ;
Dynamic       = +pinugtd-srlbamcCMSH ;
Growing       = +pinugtdl-srbamcCMSH ;
IgnoreAll     = -pinugtsdrlbamcCMSH ;
IgnoreNone    = +pinugtsdrbamcCMSH-l ;
ReadOnly      = +pinugtsdbmCM-rlacSH ;
Temporary     = +pugt ;

##配置规则
(
  rulename = "My funky files",
  severity = 50
)
{
  /sbin/e2fsck                         -> $(ReadOnly) ;
  /bin/cp                              -> $(ReadOnly) ;
  /usr/tmp                             -> $(ReadOnly) ;
  /etc/csh.cshrc                       -> $(ReadOnly) ;
}
阅读(494) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~