CentOS tripwire-文件指纹
Tripwire是目前最为著名的unix下文件系统完整性检查的软件工具,这一软件采用的技术核心就是对每个要监控的文件产生一个数字签名,保留下来。当文件现在的数字签名与保留的数字签名不一致时,那么现在这个文件必定被改动过了。
Tripwire可以对要求校验的系统文件进行类似md5的运行,而生成一个唯一的标识,即“快照”snapshot。当这些系统文件的大小、inode号、权限、时间等任意属性被修改后,再次运行Tripwire,其会进行前后属性的对比,并生成相关的详细报告。
1、下载并安装
[root@ipython ~]# wget http://nchc.dl.sourceforge.net/project/tripwire/tripwire-src/tripwire-2.4.2.2/tripwire-2.4.2.2-src.tar.bz2 [root@ipython ~]# tar jxf tripwire-2.4.2.2-src.tar.bz2
[root@ipython ~]# cd tripwire-2.4.2.2-src [root@ipython tripwire-2.4.2.2-src]# ./configure --prefix=/software/tripwire
[root@ipython tripwire-2.4.2.2-src]# make
[root@ipython tripwire-2.4.2.2-src]# make install ############INSTALL 交互#################
Press ENTER to view the License Agreement. ###回车阅读协议
license agreement. [do not accept] accept ###同意协议
Continue with installation? [y/n] y ###确认继续安装
Enter the site keyfile passphrase: ###需要记住的keyfile
Verify the site keyfile passphrase: ###重复
Enter the local keyfile passphrase: ###需要记住的local keyfile
Verify the local keyfile passphrase: ###重复
Please enter your site passphrase: ###输入
Please enter your site passphrase: ###输入
############交互结束,完成安装################# [root@ipython tripwire-2.4.2.2-src]# ls /software/tripwire/etc/ | sort
ipython.me-local.key ####加密本地密钥文件
site.key ####加密站点密钥文件
tw.cfg ####加密配置变量文件
tw.pol ####加密策略文件
twcfg.txt ####定义数据库、策略文件和Tripwire可执行文件的位置
twpol.txt ####定义检测的对象及违规时采取的行为
2、初始化(生成基准数据库)
[root@ipython ~]# /software/tripwire/sbin/tripwire --init
Please enter your local passphrase: ###键入密码,后面省略此交互
...
...
Wrote database file: /software/tripwire/lib/tripwire/ipython.me.twd
The database was successfully generated.
3、第一次完整性检查,和常用检查参数
[root@ipython ~]# /software/tripwire/sbin/tripwire --check ##默认检查报告存放路径##
/software/tripwire/lib/tripwire/report/
##指定存放路径##
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --twrfile ./test.twr
###Email 发送报告###
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --email-report
###指定Email 报告的级别###
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --email-report --email-report-level 2
###使用指定严重性等级的规则进行检查###
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --severity 80
###使用指定的规则名检查##
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --rule-name rulename
###只检查指定的文件或目录
[root@ipython ~]# /software/tripwire/sbin/tripwire --check object1 object2 object3
###检查是忽略某属性###
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --ignore "property, property, property, property"
###获取帮助
[root@ipython ~]# /software/tripwire/sbin/tripwire --help all ##检视报告##
[root@ipython ~]# /software/tripwire/sbin/twprint --print-report --twrfile ./test.twr ##重定向加密报告的内容##
[root@ipython ~]# /software/tripwire/sbin/twprint --print-report --twrfile ./test.twr > output.text ##指定报告输出时的级别##
[root@ipython ~]# /software/tripwire/sbin/twprint --print-report --report-level 4 --twrfile ./test.twr > output.text
4、升级基准数据库文件
###升级的目的是很正常的,因为check 是基于基准数据的###
[root@ipython ~]# /software/tripwire/sbin/tripwire --update --twrfile ./test.twr
###检测后立即自动update###
[root@ipython ~]# /software/tripwire/sbin/tripwire --check --interactive
5、升级策略文件
更新策略稳健,需要修改策略的规则,先将策略重定向出来
[root@ipython ~]# /software/tripwire/sbin/twadmin --print-polfile > twpol.txt
###照猫画虎修改吧,然后update###
[root@ipython ~]# /software/tripwire/sbin/tripwire --update-policy twpol.txt
Parsing policy file: /root/twpol.txt
Please enter your local passphrase:
Please enter your site passphrase:
6、修改site key 和 local key
###修改前记得备份下###
[root@ipython ~]# /software/tripwire/sbin/twadmin --generate-keys --site-keyfile /software/tripwire/etc/site.key
[root@ipython ~]# /software/tripwire/sbin/twadmin --generate-keys --local-keyfile /software/tripwire/etc/site.key #配置文件通过site key 假面,数据文件和报告文件用local key 加密#
[root@ipython ~]# /software/tripwire/sbin/twadmin --encrypt --site-keyfile /software/tripwire/etc/site.key
[root@ipython ~]# /software/tripwire/sbin/twadmin --encrypt --local-keyfile /software/tripwire/etc/ipython.me-local.key
» 转载保留版权:IT辰逸 » 《tripwire-文件指纹》» 本文版权采取:BY-NC-SA 协议进行授权,转载注明出处。除IT-Tools、News以及特别标注,本站所有文章均为原创。» 如果喜欢可以:点此订阅本站
CentOS tripwire-文件指纹的更多相关文章
- Centos给文件设置了777权限仍不能访问解决方案
Centos给文件设置了777权限仍不能访问: 开启了SELinux导致 1.查看SELinux状态:/usr/sbin/sestatus -v ##如果SELinux status参数为enable ...
- 2017-7-19-每日博客-关于Linux下的CentOS中文件夹基本操作命令.doc
CentOS中文件夹基本操作命令 文件(夹)查看类命令 ls--显示指定目录下内容 说明:ls 显示结果以不同的颜色来区分文件类别.蓝色代表目录,灰色代表普通文件,绿色代表可执行文件,红色代表压缩文件 ...
- centos查找文件
centos查找文件 [root@localhost ~]# find / -name libmysqlclient.so
- (转)CentOS最大文件描述符限制更改
CentOS最大文件描述符限制更改 原文:https://www.cnblogs.com/TonyXiaoClub/p/4747736.html 系统级的限制:/proc/sys/fs/file-ma ...
- Centos之文件搜索命令locate
locate命令 locate 文件名 在后台数据库中按文件名搜索,搜索速度更快 /var/lib/mlocate #locate命令所搜索的后台数据库 updatedb 更新数据库 locate搜索 ...
- Centos locate 文件搜索命令(十一)
locate命令 locate 文件名 在后台数据库中按文件名搜索,搜索速度更快 /var/lib/mlocate #locate命令所搜索的后台数据库 updatedb 更新数据库 locate搜索 ...
- 解决WIN7与虚拟机CentOS的文件夹共享问题
一.系统与软件 WIN7 64bit.VirtualBox 5.0.14.CentOS 6.5.SecureCRT 7.2.3 二.使用文件夹共享需要安装增强功能,但是安装时无法读取光盘iso文件 三 ...
- 通过 Xftp5 管理 centOS 7 文件
一. 在安装好了centOS 7 的服务上,打开终端 运行 ip -s addr 命令 获取服务的IP地址 [root@localhost ~]# ip -s addr1: lo: <LOOPB ...
- CentOS中文件夹基本操作命令
摘自:http://www.centoscn.com/CentOS/help/2013/1024/1967.html 文件(夹)查看类命令 ls--显示指定目录下内容 说明:ls 显示结果以不同的颜色 ...
随机推荐
- [C#基础] 继承
虚方法和覆写方法 虚方法可以使基类的引用访问"升至"派生类中 可以使用基类引用调用派生类的方法,只需满足下面的条件 派生类的方法和基类的方法有相同的签名和返回类型 基类的方法使用v ...
- XPSP2 PSDK(还有lostspeed)
XPSP2 PSDK Full Download with Local Install Use the full download to copy the entire Windows XP SP2 ...
- jsp 中对jar 包的引用
<%@ page language="java" import="你需要的带包名的类" pageEncoding="gb2312"%& ...
- AIR
There is a meaning for wings that cannot fly,it's a previous memory of when you once flew through th ...
- 每天一个JavaScript实例-动态省份选择城市
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- 拆分字符串,GetHtmlByWebBrowser,UnicodeToMBCS,提升进程权限
1. // 根据字符串,拆分字符串,相当于vb中的split函数 function SplitString(const Source, ch: string): TStringList; var te ...
- ps中图层混合模式算法公式
网上已经有很多讲解ps的图层混合模式,有些不详细甚至是错误的,参考网上给出的公式及其自己在验证推倒的,给出27种的混合模式算法公式.也许存在一定的错误性,毕竟没有官方给出公式,只能说以供参考吧. 只考 ...
- RH033读书笔记(17) - Summary
End of Unit 1 • Questions and Answers • Summary • Open source and the right to modify • The GNU Proj ...
- vijos P1352 最大获利(最小割)
请不要随便指点别人该怎么做.每一个人的人生都应该自己掌握.你给不了别人一切.你也不懂别人的忧伤. 微笑不代表快乐.哭泣不一定悲伤 不努力怎么让关心你的人幸福.不努力怎么让看不起你的人绝望. 我用生命在 ...
- Opencv246+vs2012生成不依赖编译环境的exe文件
我们都知道,vs2012编译项目有两个版本号:Debug和Release,这里我们在Release下生成exe文件,为什么要在Release以下生成呢,原因是你在Debug模式下生成的exe须要vs2 ...