溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

tripwire怎么用呢

發布時間:2021-11-02 09:43:38 來源:億速云 閱讀:239 作者:柒染 欄目:系統運維

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 LicenseAgreement.       ###回車閱讀協議  license agreement.[donot accept] accept     ###同意協議Continuewith installation?[y/n] y        ###確認繼續安裝Enter the site keyfile passphrase:              ###需要記住的keyfileVerify the site keyfile passphrase:             ###重復Enter the local keyfile passphrase:             ###需要記住的local keyfileVerify 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

看完上述內容,你們掌握tripwire怎么用呢的方法了嗎?如果還想學到更多技能或想了解更多相關內容,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女