Jump to content

Open Source Tripwire: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
hashing performance
Iamleot (talk | contribs)
m Create an anchor for Gene Kim
 
(39 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Short description|Free software data integrity tool}}
{{other uses|Tripwire (disambiguation)}}
{{other uses|Tripwire (disambiguation)}}

{{Infobox software
{{Infobox software
|name = Open Source Tripwire
|name = Open Source Tripwire
Line 10: Line 10:
|latest release date = {{Start date and age|2018|03|31|df=yes}}
|latest release date = {{Start date and age|2018|03|31|df=yes}}
|operating_system = [[Linux]], all [[POSIX]]/[[UNIX]] Systems
|operating_system = [[Linux]], all [[POSIX]]/[[UNIX]] Systems
|genre = Security, Monitoring, [[Host-based intrusion detection system|HIDS]]
|genre = Security, monitoring, [[Host-based intrusion detection system|HIDS]]
|programming language = [[C++]], [[Perl]]
|programming language = [[C++]], [[Perl]]
|license = [[GPL#Version_2|GPLv2]]<ref name="license">{{cite web |title=LICENSE |url=https://github.com/Tripwire/tripwire-open-source/blob/master/LICENSE |website=Github |accessdate=5 September 2019}}</ref>
|license = [[GPL#Version_2|GPLv2]]<ref name="license">{{cite web |title=LICENSE |url=https://github.com/Tripwire/tripwire-open-source/blob/master/LICENSE |website=Github |accessdate=5 September 2019}}</ref>
|website = [https://github.com/Tripwire/tripwire-open-source https://github.com/Tripwire/tripwire-open-source]
|website = [https://github.com/Tripwire/tripwire-open-source https://github.com/Tripwire/tripwire-open-source]
}}
}}
'''Open Source Tripwire''' is a [[free software]] security and data [[File integrity monitoring|integrity tool]] for monitoring and alerting on specific file change(s) on a range of systems<ref name="kwaku">{{cite web |url=https://opensource.com/article/18/1/securing-linux-filesystem-tripwire |title=Securing the Linux filesystem with Tripwire |website=opensource.com |author=Michael Kwaku Aboagye |date=January 18, 2018 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20230506040042/https://opensource.com/article/18/1/securing-linux-filesystem-tripwire |archive-date=May 6, 2023 |url-status=live}}</ref><ref name="monitor">{{cite web |url=https://www.cs.ucf.edu/~xinwenfu/Classes/91.530.202/tripwire.pdf |title=Monitor and Secure Linux System with Open Source Tripwire |publisher=University of Massachusetts Lowell |first1=Hui |last1=Li |first2=Michael |last2=McGinty |first3=Xinwen |last3=Fu |year=2012 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20240114113411/https://www.cs.ucf.edu/~xinwenfu/Classes/91.530.202/tripwire.pdf |archive-date=January 14, 2024 |url-status=live}}</ref> originally developed by [[Gene Spafford|Eugene H. Spafford]] and [[Gene Kim]].<ref name="spafford"/> The project is based on code originally contributed by [[Tripwire, Inc.]] in 2000.<ref>{{cite web |url=https://sourceforge.net/projects/tripwire/ |title=Open Source Tripwire on SourceForge |date=21 October 2018 |access-date=January 14, 2024}}</ref><ref name="bauer">{{cite journal |url=https://dl.acm.org/doi/fullHtml/10.5555/509446.509454 |title=Paranoid penguin: intrusion detection for the masses |journal=Linux Journal |first=Mick |last=Bauer |date=July 1, 2001 |access-date=January 14, 2024 |volume=2001 |issue=87 |archive-url=https://web.archive.org/web/20240114155132/https://dl.acm.org/doi/fullHtml/10.5555/509446.509454 |archive-date=January 14, 2024 |url-status=live}}</ref> It is released under the terms of [[GNU General Public License]].<ref name="license"/><ref name="mellem">{{cite web |url=https://uia.brage.unit.no/uia-xmlui/bitstream/handle/11250/137228/master_ikt_2004_mellem.pdf?sequence=1&isAllowed=y |title=Real time Integrity Control of Operating systems |publisher=Agder University College |first1=Erik |last1=Mellem |first2=Frode |last2=Olsen |date=June 2004 |access-date=January 17, 2024}}</ref>


It works by creating a baseline [[database]], and then regularly comparing the state of the [[file system]] with the database. If it detects changes (e.g. addition or modification of some files), it includes these changes in its report, so that the security administrators could check these changes.<ref name="kwaku"/>
'''Open Source Tripwire''' is a [[free software]] security and data [[File integrity monitoring|integrity tool]] for monitoring and alerting on specific file change(s) on a range of systems.<ref name="kwaku">{{cite web |url=https://opensource.com/article/18/1/securing-linux-filesystem-tripwire |title=Securing the Linux filesystem with Tripwire |website=opensource.com |author=Michael Kwaku Aboagye |date=January 18, 2018 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20230506040042/https://opensource.com/article/18/1/securing-linux-filesystem-tripwire |archive-date=May 6, 2023 |url-status=live}}</ref><ref name="monitor">{{cite web |url=https://www.cs.ucf.edu/~xinwenfu/Classes/91.530.202/tripwire.pdf |title=Monitor and Secure Linux System with Open Source Tripwire |publisher=University of Massachusetts Lowell |first1=Hui |last1=Li |first2=Michael |last2=McGinty |first3=Xinwen |last3=Fu |year=2012 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20240114113411/https://www.cs.ucf.edu/~xinwenfu/Classes/91.530.202/tripwire.pdf |archive-date=January 14, 2024 |url-status=live}}</ref> The project is based on code originally contributed by [[Tripwire, Inc.]] in 2000.<ref>{{cite web |url=https://sourceforge.net/projects/tripwire/ |title=Open Source Tripwire on SourceForge |access-date=January 14, 2024}}</ref><ref name="bauer">{{cite journal |url=https://dl.acm.org/doi/fullHtml/10.5555/509446.509454 |title=Paranoid penguin: intrusion detection for the masses |journal=Linux Journal |first=Mick |last=Bauer |date=July 1, 2001 |access-date=January 14, 2024 |volume=2001 |issue=87 |archive-url=https://web.archive.org/web/20240114155132/https://dl.acm.org/doi/fullHtml/10.5555/509446.509454 |archive-date=January 14, 2024 |url-status=live}}</ref> It is released under the terms of [[GNU General Public License]].<ref name="license"/>


==History==
==History==
The Tripwire was created by Dr. Eugene Spafford and Gene Kim in 1992 in response to a series of stealthy intrusions that occurred in early 1991. These attacks circumvented the existing security systems by [[Computer virus|infecting]] the [[Shared library|shared libraries]] in a way that their [[Cyclic redundancy check|CRC checksums]] were unchanged. Tripwire was designed to use [[Cryptographic hash function|message digest functions]] from different hash families (e.g. [[MD5]] and [[Snefru]]) in order to stay reliable even after one of the hashing algorithms gets compromised.{{r|spafford}}


The name "Tripwire" comes from the ''trap or tripwire'' files which alert administrators upon being accessed by intruders.<ref>{{cite journal |title=Mitigation of network tampering using dynamic dispatch of mobile agents |journal=Computers & Security |first1=Ronald F |last1=DeMara |first2=Adam J |last2=Rocke |date=February 2004 |volume=23 |issue=1 |pages=31–42 |doi=10.1016/S0167-4048(04)00068-9}}</ref>{{r|kim|p=4}} Spafford recalls:
The Tripwire was created by [[Gene Spafford|Dr. Eugene Spafford]] and Gene Kim in 1992 in response to a series of stealthy intrusions that occurred in early 1991. These attacks circumvented the existing security systems by [[Computer virus|infecting]] the [[Shared library|shared libraries]] in a way that their [[Cyclic redundancy check|CRC checksums]] were unchanged. Tripwire was designed to use [[Cryptographic hash function|message digest functions]] from different hash families (e.g. [[MD5]] and [[Snefru]]) in order to stay reliable even when a vulnerability is uncovered in some of the hashing algorithms. The name "Tripwire" comes from the ''trap or tripwire'' files which alert administrators upon being accessed by intruders.<ref name="spafford"/>{{r|kim|p=4}}

{{blockquote|We heard several stories where tripwire files were established, as per our original intent, which were used to detect insiders snooping into files and directories where they had no reason to explore. At least one such use was related to us as a trigger that uncovered insider-perpetrated fraud.<ref name="spafford"/>}}


Tripwire was written in [[C (programming language)|C]] and its design emphasized the program and database [[Software portability|portability]]. On November 2, 1992, it was released for a [[Software release life cycle#Beta|beta testing]]. In December 1993, the formal release was made after identifying and fixing several bugs. Early releases were developed in a [[Cleanroom software engineering|cleanroom style]], where Gene Kim did the development and Eugene Spafford ran the [[acceptance testing]].<ref name="spafford"/>
Tripwire was written in [[C (programming language)|C]] and its design emphasized the program and database [[Software portability|portability]]. On November 2, 1992, it was released for a [[Software release life cycle#Beta|beta testing]]. In December 1993, the formal release was made after identifying and fixing several bugs. Early releases were developed in a [[Cleanroom software engineering|cleanroom style]], where Gene Kim did the development and Eugene Spafford ran the [[acceptance testing]].<ref name="spafford"/>


The Tripwire was initially free and open-source, but it went commercial in 1997. Open Source Tripwire was released in October, 2000.<ref name="bauer"/>
The Tripwire was initially free and open-source, but it went commercial in 1997. Open Source Tripwire was released in October, 2000,<ref name="bauer"/> under the GNU General Public License.<ref name="mellem"/>


On May 4, 2015, the source code was moved from [[SourceForge]] to [[GitHub]].<ref>{{cite web |url=https://github.com/Tripwire/tripwire-open-source/commit/c8dc58df50f59e26b670240e0e0493210258acb8 |title=Initial commit of code from Sourceforge repository |access-date=January 14, 2024}}</ref>
On May 4, 2015, the source code was moved from [[SourceForge]] to [[GitHub]].<ref>{{cite web |url=https://github.com/Tripwire/tripwire-open-source/commit/c8dc58df50f59e26b670240e0e0493210258acb8 |title=Initial commit of code from Sourceforge repository |website=[[GitHub]] |access-date=January 14, 2024}}</ref>


==Overview==
==Overview==
[[Image:Diagram of high level operation model of Tripwire.png|thumb|Diagram of high level operation model of Tripwire{{r|kim|p=10}}]]
[[Image:Diagram of high level operation model of Tripwire.png|320px|thumb|Diagram of high level operation model of Tripwire{{r|kim|p=10}}]]
During the installation, Open Source Tripwire asks the user to set the site-key and local key [[passphrase]]s. The site-key passphrase is used to protect files across several systems (policy and configuration files) and the local passphrase is used to protect files on a specific machine. The policy file contains the list of files and directories to scan and the rules (e.g. which [[File attribute|attribute]]s of the [[Directory structure|directory tree]] to get).<ref name="kwaku"/>
During the installation, Open Source Tripwire asks the user to set the site-key and local key [[passphrase]]s. The site-key passphrase encrypts the policy and configuration files which are shared across multiple systems. The local passphrase is used to protect files on a specific machine. The policy file contains the list of files and directories to scan and the rules (e.g. which [[File attribute|attribute]]s of the [[Directory structure|directory tree]] to look at).<ref name="kwaku"/>


Open Source Tripwire later asks for the local passphrase when creating an initial [[database]] containing file [[Checksum|signatures]]. It runs the first scan of the system and saves the result to the database. Afterwards, it runs integrity checks and compares the result with the database. For example, if a new file is created then it will be listed in the subsequent integrity check report.<ref name="monitor"/> The database file is designed to be [[Human-readable medium and data|human-readable]], so that the user is able to verify properties of individual files or even check the database for potential tampering.<ref name="spafford">{{cite web |url=https://www.acsac.org/2022/program/artifacts_competition/Tripwire-final.pdf |title=Tripwire: Pioneering Integrity Scanning for Cybersecurity |publisher=Purdue University |first=Eugene H. |last=Spafford |author-link=Gene Spafford |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20230204221003/https://www.acsac.org/2022/program/artifacts_competition/Tripwire-final.pdf |archive-date=February 4, 2023 |url-status=live}}</ref>{{r|kim|p=7}} It is important that the database is initialized before the system is at risk of being compromised.<ref>{{cite journal |url=https://arxiv.org/ftp/arxiv/papers/0906/0906.5060.pdf |title=Incidence Handling and Response System |journal=International Journal of Computer Science and Information Security |author1=Prof. Dhananjay R. Kalbande |author2=Dr. G. T. Thampi |author3=Mr. Manish Singh |year=2009 |volume=2 |issue=1 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20240114203525/https://arxiv.org/ftp/arxiv/papers/0906/0906.5060.pdf |archive-date=January 14, 2024 |url-status=live}}</ref>
Open Source Tripwire later asks for the local passphrase when creating an initial database with file [[Checksum|signatures]]. It runs the first scan of the system and saves the result to the database. Afterwards, it runs integrity checks and compares the result with the database. For example, if a new file is created then it will be listed in the subsequent integrity check report.<ref name="monitor"/> Open Source Tripwire can be configured to regularly run integrity checks and send report e-mails to the system administrator.<ref name="lynch">{{cite web |url=https://linuxsecurity.com/features/getting-started-with-tripwire-open-source-linux-edition |title=Getting Started with Tripwire (Open Source Linux Edition) |website=LinuxSecurity |first=William |last=Lynch |date=March 21, 2001 |access-date=January 17, 2024}}</ref> The database should be initialized before the system is at risk of being compromised.{{cn|date=February 2024}}


A more sophisticated usage would include creating the so-called ''tripwire'' files and configuring Open Source Tripwire to track these files in order to catch snooping intruders. When the intruder reads these files, their [[timestamp]]s get updated and the security administrators get notified about this incident.<ref name="spafford"/>
The user can create the ''tripwire'' files which look like they have valuable information (e.g. the file called <code>master-password.txt</code>) and configure Open Source Tripwire to track these files in order to catch snooping intruders. When the intruder reads these files, their access [[timestamp]]s get updated and the security administrators get notified about this incident.<ref name="spafford"/>


Unlike Tripwire Enterprise, Open Source Tripwire is not available for [[Windows]] and has only basic policies.<ref>{{cite web |url=https://www.upguard.com/blog/tripwire-enterprise-vs-tripwire-open-source |title=Tripwire Enterprise vs Free Tripwire Open Source |website=UpGuard |first=Kaushik |last=Sen |date=October 17, 2021 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20220119132932/https://www.upguard.com/blog/tripwire-enterprise-vs-tripwire-open-source |archive-date=January 19, 2022 |url-status=live}}</ref>
Unlike Tripwire Enterprise, Open Source Tripwire is not available for [[Windows]] and has only basic policies.<ref>{{cite web |url=https://www.upguard.com/blog/tripwire-enterprise-vs-tripwire-open-source |title=Tripwire Enterprise vs Free Tripwire Open Source |website=UpGuard |first=Kaushik |last=Sen |date=October 17, 2021 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20220119132932/https://www.upguard.com/blog/tripwire-enterprise-vs-tripwire-open-source |archive-date=January 19, 2022 |url-status=live}}</ref> Windows users can run the Open Source Tripwire using the [[Cygwin]], but it will not scan Windows specific attributes such as [[Windows Registry]].<ref>{{cite web |url=https://www.utupub.fi/bitstream/handle/10024/153045/Jauhiainen_Juho_Thesis.pdf?sequence=1 |title=Ensuring system integrity and security on limited environment systems |publisher=University of Turku |first=Juho |last=Jauhiainen |date=December 2021 |access-date=January 17, 2024 |page=18}}</ref>


==Details==
==Implementation details==
===Policy file===
The policy file is called <code>twpol.txt</code><ref name="lynch"/> (or <code>tw.config</code> in the previous versions), and it tells which files and directories need to be monitored. It supports [[Preprocessor|preprocessing]] which allows administrators to write only one policy file for many different machines. In the policy file, along with each file or directory there is a [[Mask (computing)|selection-mask]] that tells which attributes to ignore and which to report. For example, the selection-mask could be written to report changes in modification timestamp, number of [[Symbolic link|links]], size of the file, [[File-system permissions|permission]] and [[Chmod#Special modes|modes]], but ignore changes to the access timestamp. Also, there is an option to specify whether or not Tripwire should be [[Recursion (computer science)|recursing]] into a directory, i.e. checking the subdirectories, subdirectories of those subdirectories, etc.<ref name="tansley">{{cite web |url=http://www.ibm.com/developerworks/aix/library/au-usingtripwire/ |title=Running with Tripwire: Using Tripwire to monitor file changes |website=IBM developerWorks |first=David |last=Tansley |date=December 13, 2011 |archive-url=https://web.archive.org/web/20120503032242/http://www.ibm.com/developerworks/aix/library/au-usingtripwire/#author1 |archive-date=May 3, 2012}}</ref>{{r|kim|pp=11-12}}


Example of the policy file:<ref name="tansley"/>
The configuration file is called <code>tw.config</code> and it tells which files and directories need to be monitored for creations, deletions or modifications. It supports [[Preprocessor|preprocessing]], so that the administrators would need to write only one configuration file which would work on many different machines. In the configuration file, along with each file or directory there is a [[Mask (computing)|selection-mask]] that tells which attributes to ignore and which to report. For example, the selection-mask could be written to report changes in modification timestamp, number of [[Symbolic link|links]], size of the file, [[File-system permissions|permission]] and [[Chmod#Special modes|modes]], but ignore changes to the access timestamp. Also, there is an option to specify whether or not Tripwire should be [[Recursion (computer science)|recursing]] into a directory, i.e. checking the subdirectories, subdirectories of those subdirectories, etc.{{r|kim|pp=11-12}}
<syntaxhighlight lang="makefile">
# system binaries
SYSBIN = +pngu+sm;


/usr/local/bin/pwgen -> $(SYSBIN);
The database file is unique for each machine, as opposed to the configuration file which could be shared across multiple machines. It stores signatures of the files, and not the content itself, because storing the content of the files would use too much disk space. For each file, the database can store up to ten signatures. There are six types of changes to the database: adding, deleting or updating a file, and adding, deleting or updating an entry. Most of them are straightforward except for adding a file when it does not have an entry in the <code>tw.config</code> file. In this case Tripwire chooses the "closest" ancestor entry in the configuration file and copies its selection-mask, or uses the default selection-mask if the entry could not be found at all. Tripwire also has an interactive update mode which simplifies the process of reviewing every updated file. For each created, deleted or modified file it asks whether or not the corresponding database entry should be changed.{{r|kim|pp=13-15}}
/usr/bin -> $(SYSBIN);
/usr/sbin -> $(SYSBIN);


/etc/security -> +pug (recurse=-1);
Because different hashing algorithms have different performances, Tripwire allows to configure which signatures to use and how frequently. For example, the system could be configured to compare CRC32 signatures every hour and compare MD5 signatures every day.{{r|kim|p=15}}

# ignore last log
!/etc/security/lastlog;

# logs
SYSLOGS = +p-lum;

/var/adm/messages -> $(SYSLOGS);
/opt -> $(SYSBIN);
# ignore these do not scan
!/opt/dump;
!/opt/freeware;
</syntaxhighlight>

The following example of the policy file from "The Design and Implementation of Tripwire: A File System Integrity Checker" by Spafford and Kim makes use of the preprocessing language. Here it is used to ignore the directory with printer logs on a specific host, and this directory will be scanned on all other hosts. Thus, the preprocessing allows to use the same policy file on this specific host and on other hosts, otherwise the user would need to write separate policy files.{{r|kim|p=12}}
<syntaxhighlight lang="makefile">
# file/dir selection-mask
/etc R # all files under /etc
@@ifhost solaria.cs.purdue.edu
!/etc/lp # except for SVR4 printer logs
@@endif
/etc/passwd R+12 # you can't be too careful
/etc/mtab L # dynamic files
/etc/motd L
/etc/utmp L
=/var/tmp R # only the directory, not its contents
</syntaxhighlight>

===Configuration file===

The configuration file is called <code>twcfg.txt</code>, and it contains information about paths to the policy file, database file, report file, etc. It also has entries for mail settings (for instance, which program to use to send an e-mail with the report).<ref name="tansley"/><ref>{{cite web |url=https://www.thegeekstuff.com/2008/12/tripwire-tutorial-linux-host-based-intrusion-detection-system/ |title=Tripwire Tutorial: Linux Host Based Intrusion Detection System |website=The Geek Stuff |first=Ramesh |last=Natarajan |date=December 8, 2008 |access-date=January 17, 2024}}</ref> Example of the configuration file:<ref name="tansley"/>
<syntaxhighlight lang="makefile">
ROOT =/opt/freeware/sbin
POLFILE =/etc/tripwire/tw.pol
DBFILE =/var/lib/tripwire/$(HOSTNAME).twd
REPORTFILE =/var/lib/tripwire/report/$(HOSTNAME)-$(DATE).twr
SITEKEYFILE =/etc/tripwire/site.key
LOCALKEYFILE =/etc/tripwire/$(HOSTNAME)-local.key
EDITOR =/usr/bin/vi
LATEPROMPTING =false
LOOSEDIRECTORYCHECKING =false
MAILNOVIOLATIONS =true
EMAILREPORTLEVEL =3
REPORTLEVEL =3
MAILMETHOD =SENDMAIL
SYSLOGREPORTING =false
MAILPROGRAM =/usr/sbin/sendmail -oi -t
</syntaxhighlight>

===Database file===
The database file is unique for each machine, as opposed to the policy and configuration files which could be shared across multiple machines. It stores file permissions, modification dates and signatures of the files. For each file, the database can store up to ten signatures. The database does not store the content itself, because storing the content of the files would use too much disk space. {{r|kim|pp=13-15}} The database file is [[Human-readable medium and data|human-readable]], and the user can verify properties of individual files and check the database for potential tampering.{{r|spafford}}{{r|kim|p=7}}

When the integrity check detects a new file, but its path does not have an entry in the policy file, Tripwire chooses the closest ancestor entry and copies its selection-mask, or uses the default selection-mask if the entry could not be found at all. Tripwire has an interactive update mode which simplifies the process of reviewing every updated file. For each created, deleted or modified file it asks whether or not the corresponding database entry should be changed.{{r|kim|pp=13-15}}

===Signatures===
In order to minimize the impact of [[hash collision]]s (i.e. the signature would not change even when the file was changed) on the security, Tripwire uses multiple different hashing algorithms to compute multiple signatures for each file.{{r|spafford}} Because different hashing algorithms have different [[Computer performance|performances]], Tripwire allows to configure which signatures to use and how frequently. For example, the system could be configured to compare CRC32 signatures every hour and compare MD5 signatures every day. This way the hourly integrity checks would run faster, and even if some file gets modified without changing its CRC32 checksum, it will get reported during the daily integrity check.{{r|kim|p=7,15}} Tripwire provides a generic interface to signature routines, so the user can include their own checksum methods.{{r|kim|p=15}}


==See also==
==See also==
Line 54: Line 121:


==References==
==References==
{{Reflist|refs=
{{Reflist|refs=<ref name="kim">{{cite journal |url=https://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2083&context=cstech |title=The design and implementation of tripwire: a file system integrity checker |journal=CCS '94: Proceedings of the 2nd ACM Conference on Computer and communications security |doi=10.1145/191177.191183 |first1=Gene H. |last1=Kim |first2=Eugene H. |last2=Spafford |author-link2=Gene Spafford |date=November 19, 1993 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20160322022252/https://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2083&context=cstech |archive-date=March 22, 2016 |url-status=live}}</ref>}}
<ref name="kim">{{cite book |chapter-url=https://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2083&context=cstech |title=Proceedings of the 2nd ACM Conference on Computer and communications security - CCS '94 |doi=10.1145/191177.191183 |first1=Gene H. |last1=Kim |first2=Eugene H. |last2=Spafford |chapter=The design and implementation of tripwire: A file system integrity checker |author-link2=Gene Spafford |date=November 19, 1993 |pages=18–29 |isbn=0-89791-732-4 |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20160322022252/https://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2083&context=cstech |archive-date=March 22, 2016 |url-status=live}}</ref>
<ref name="spafford">{{cite web |url=https://www.acsac.org/2022/program/artifacts_competition/Tripwire-final.pdf |title=Tripwire: Pioneering Integrity Scanning for Cybersecurity |publisher=Purdue University |first=Eugene H. |last=Spafford |author-link=Gene Spafford |access-date=January 14, 2024 |archive-url=https://web.archive.org/web/20230204221003/https://www.acsac.org/2022/program/artifacts_competition/Tripwire-final.pdf |archive-date=February 4, 2023 |url-status=live}}</ref>
}}


==External links==
==External links==

Latest revision as of 17:42, 29 December 2024

Open Source Tripwire
Developer(s)Tripwire, Inc.
Stable release
2.4.3.7 / 31 March 2018; 6 years ago (2018-03-31)
Repository
Written inC++, Perl
Operating systemLinux, all POSIX/UNIX Systems
TypeSecurity, monitoring, HIDS
LicenseGPLv2[1]
Websitehttps://github.com/Tripwire/tripwire-open-source

Open Source Tripwire is a free software security and data integrity tool for monitoring and alerting on specific file change(s) on a range of systems[2][3] originally developed by Eugene H. Spafford and Gene Kim.[4] The project is based on code originally contributed by Tripwire, Inc. in 2000.[5][6] It is released under the terms of GNU General Public License.[1][7]

It works by creating a baseline database, and then regularly comparing the state of the file system with the database. If it detects changes (e.g. addition or modification of some files), it includes these changes in its report, so that the security administrators could check these changes.[2]

History

[edit]

The Tripwire was created by Dr. Eugene Spafford and Gene Kim in 1992 in response to a series of stealthy intrusions that occurred in early 1991. These attacks circumvented the existing security systems by infecting the shared libraries in a way that their CRC checksums were unchanged. Tripwire was designed to use message digest functions from different hash families (e.g. MD5 and Snefru) in order to stay reliable even after one of the hashing algorithms gets compromised.[4]

The name "Tripwire" comes from the trap or tripwire files which alert administrators upon being accessed by intruders.[8][9]: 4  Spafford recalls:

We heard several stories where tripwire files were established, as per our original intent, which were used to detect insiders snooping into files and directories where they had no reason to explore. At least one such use was related to us as a trigger that uncovered insider-perpetrated fraud.[4]

Tripwire was written in C and its design emphasized the program and database portability. On November 2, 1992, it was released for a beta testing. In December 1993, the formal release was made after identifying and fixing several bugs. Early releases were developed in a cleanroom style, where Gene Kim did the development and Eugene Spafford ran the acceptance testing.[4]

The Tripwire was initially free and open-source, but it went commercial in 1997. Open Source Tripwire was released in October, 2000,[6] under the GNU General Public License.[7]

On May 4, 2015, the source code was moved from SourceForge to GitHub.[10]

Overview

[edit]
Diagram of high level operation model of Tripwire[9]: 10 

During the installation, Open Source Tripwire asks the user to set the site-key and local key passphrases. The site-key passphrase encrypts the policy and configuration files which are shared across multiple systems. The local passphrase is used to protect files on a specific machine. The policy file contains the list of files and directories to scan and the rules (e.g. which attributes of the directory tree to look at).[2]

Open Source Tripwire later asks for the local passphrase when creating an initial database with file signatures. It runs the first scan of the system and saves the result to the database. Afterwards, it runs integrity checks and compares the result with the database. For example, if a new file is created then it will be listed in the subsequent integrity check report.[3] Open Source Tripwire can be configured to regularly run integrity checks and send report e-mails to the system administrator.[11] The database should be initialized before the system is at risk of being compromised.[citation needed]

The user can create the tripwire files which look like they have valuable information (e.g. the file called master-password.txt) and configure Open Source Tripwire to track these files in order to catch snooping intruders. When the intruder reads these files, their access timestamps get updated and the security administrators get notified about this incident.[4]

Unlike Tripwire Enterprise, Open Source Tripwire is not available for Windows and has only basic policies.[12] Windows users can run the Open Source Tripwire using the Cygwin, but it will not scan Windows specific attributes such as Windows Registry.[13]

Details

[edit]

Policy file

[edit]

The policy file is called twpol.txt[11] (or tw.config in the previous versions), and it tells which files and directories need to be monitored. It supports preprocessing which allows administrators to write only one policy file for many different machines. In the policy file, along with each file or directory there is a selection-mask that tells which attributes to ignore and which to report. For example, the selection-mask could be written to report changes in modification timestamp, number of links, size of the file, permission and modes, but ignore changes to the access timestamp. Also, there is an option to specify whether or not Tripwire should be recursing into a directory, i.e. checking the subdirectories, subdirectories of those subdirectories, etc.[14][9]: 11–12 

Example of the policy file:[14]

# system binaries
SYSBIN =  +pngu+sm;

/usr/local/bin/pwgen  -> $(SYSBIN);
/usr/bin -> $(SYSBIN);
/usr/sbin -> $(SYSBIN);

/etc/security   -> +pug  (recurse=-1);

# ignore last log
!/etc/security/lastlog;

# logs
SYSLOGS = +p-lum;

/var/adm/messages -> $(SYSLOGS);
/opt -> $(SYSBIN);
# ignore these do not scan
!/opt/dump;
!/opt/freeware;

The following example of the policy file from "The Design and Implementation of Tripwire: A File System Integrity Checker" by Spafford and Kim makes use of the preprocessing language. Here it is used to ignore the directory with printer logs on a specific host, and this directory will be scanned on all other hosts. Thus, the preprocessing allows to use the same policy file on this specific host and on other hosts, otherwise the user would need to write separate policy files.[9]: 12 

# file/dir selection-mask
/etc R # all files under /etc
@@ifhost solaria.cs.purdue.edu
!/etc/lp # except for SVR4 printer logs
@@endif
/etc/passwd R+12 # you can't be too careful
/etc/mtab L # dynamic files
/etc/motd L
/etc/utmp L
=/var/tmp R # only the directory, not its contents

Configuration file

[edit]

The configuration file is called twcfg.txt, and it contains information about paths to the policy file, database file, report file, etc. It also has entries for mail settings (for instance, which program to use to send an e-mail with the report).[14][15] Example of the configuration file:[14]

ROOT                   =/opt/freeware/sbin
POLFILE                =/etc/tripwire/tw.pol
DBFILE                 =/var/lib/tripwire/$(HOSTNAME).twd
REPORTFILE             =/var/lib/tripwire/report/$(HOSTNAME)-$(DATE).twr
SITEKEYFILE            =/etc/tripwire/site.key
LOCALKEYFILE           =/etc/tripwire/$(HOSTNAME)-local.key
EDITOR                 =/usr/bin/vi
LATEPROMPTING          =false
LOOSEDIRECTORYCHECKING =false
MAILNOVIOLATIONS       =true
EMAILREPORTLEVEL       =3
REPORTLEVEL            =3
MAILMETHOD             =SENDMAIL
SYSLOGREPORTING        =false
MAILPROGRAM            =/usr/sbin/sendmail -oi -t

Database file

[edit]

The database file is unique for each machine, as opposed to the policy and configuration files which could be shared across multiple machines. It stores file permissions, modification dates and signatures of the files. For each file, the database can store up to ten signatures. The database does not store the content itself, because storing the content of the files would use too much disk space. [9]: 13–15  The database file is human-readable, and the user can verify properties of individual files and check the database for potential tampering.[4][9]: 7 

When the integrity check detects a new file, but its path does not have an entry in the policy file, Tripwire chooses the closest ancestor entry and copies its selection-mask, or uses the default selection-mask if the entry could not be found at all. Tripwire has an interactive update mode which simplifies the process of reviewing every updated file. For each created, deleted or modified file it asks whether or not the corresponding database entry should be changed.[9]: 13–15 

Signatures

[edit]

In order to minimize the impact of hash collisions (i.e. the signature would not change even when the file was changed) on the security, Tripwire uses multiple different hashing algorithms to compute multiple signatures for each file.[4] Because different hashing algorithms have different performances, Tripwire allows to configure which signatures to use and how frequently. For example, the system could be configured to compare CRC32 signatures every hour and compare MD5 signatures every day. This way the hourly integrity checks would run faster, and even if some file gets modified without changing its CRC32 checksum, it will get reported during the daily integrity check.[9]: 7,15  Tripwire provides a generic interface to signature routines, so the user can include their own checksum methods.[9]: 15 

See also

[edit]

References

[edit]
  1. ^ a b "LICENSE". Github. Retrieved 5 September 2019.
  2. ^ a b c Michael Kwaku Aboagye (January 18, 2018). "Securing the Linux filesystem with Tripwire". opensource.com. Archived from the original on May 6, 2023. Retrieved January 14, 2024.
  3. ^ a b Li, Hui; McGinty, Michael; Fu, Xinwen (2012). "Monitor and Secure Linux System with Open Source Tripwire" (PDF). University of Massachusetts Lowell. Archived (PDF) from the original on January 14, 2024. Retrieved January 14, 2024.
  4. ^ a b c d e f g Spafford, Eugene H. "Tripwire: Pioneering Integrity Scanning for Cybersecurity" (PDF). Purdue University. Archived (PDF) from the original on February 4, 2023. Retrieved January 14, 2024.
  5. ^ "Open Source Tripwire on SourceForge". 21 October 2018. Retrieved January 14, 2024.
  6. ^ a b Bauer, Mick (July 1, 2001). "Paranoid penguin: intrusion detection for the masses". Linux Journal. 2001 (87). Archived from the original on January 14, 2024. Retrieved January 14, 2024.
  7. ^ a b Mellem, Erik; Olsen, Frode (June 2004). "Real time Integrity Control of Operating systems" (PDF). Agder University College. Retrieved January 17, 2024.
  8. ^ DeMara, Ronald F; Rocke, Adam J (February 2004). "Mitigation of network tampering using dynamic dispatch of mobile agents". Computers & Security. 23 (1): 31–42. doi:10.1016/S0167-4048(04)00068-9.
  9. ^ a b c d e f g h i Kim, Gene H.; Spafford, Eugene H. (November 19, 1993). "The design and implementation of tripwire: A file system integrity checker". Proceedings of the 2nd ACM Conference on Computer and communications security - CCS '94. pp. 18–29. doi:10.1145/191177.191183. ISBN 0-89791-732-4. Archived from the original on March 22, 2016. Retrieved January 14, 2024.
  10. ^ "Initial commit of code from Sourceforge repository". GitHub. Retrieved January 14, 2024.
  11. ^ a b Lynch, William (March 21, 2001). "Getting Started with Tripwire (Open Source Linux Edition)". LinuxSecurity. Retrieved January 17, 2024.
  12. ^ Sen, Kaushik (October 17, 2021). "Tripwire Enterprise vs Free Tripwire Open Source". UpGuard. Archived from the original on January 19, 2022. Retrieved January 14, 2024.
  13. ^ Jauhiainen, Juho (December 2021). "Ensuring system integrity and security on limited environment systems" (PDF). University of Turku. p. 18. Retrieved January 17, 2024.
  14. ^ a b c d Tansley, David (December 13, 2011). "Running with Tripwire: Using Tripwire to monitor file changes". IBM developerWorks. Archived from the original on May 3, 2012.
  15. ^ Natarajan, Ramesh (December 8, 2008). "Tripwire Tutorial: Linux Host Based Intrusion Detection System". The Geek Stuff. Retrieved January 17, 2024.
[edit]