免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 874 | 回复: 0
打印 上一主题 下一主题

tripwire搞定 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-01 11:28 |只看该作者 |正序浏览
虽然是个很容易的东东,搞了两天我才把它理解啊。现在把它整理成文档,当做个记号。
##安装tripwire
wget http://kent.dl.sourceforge.net/sourceforge/tripwire/tripwire-2.4.1.2-src.tar.bz2
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) ;
}
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/85811/showart_1673903.html
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP