{"id":13,"date":"2007-05-29T13:04:52","date_gmt":"2007-05-29T18:04:52","guid":{"rendered":"http:\/\/yourlinuxguy.com\/ww\/?p=13"},"modified":"2008-02-26T12:39:55","modified_gmt":"2008-02-26T17:39:55","slug":"how-do-i-quickly-set-up-tripwire-on-linux","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=13","title":{"rendered":"How do I quickly set up TripWire on Linux?"},"content":{"rendered":"<p>Here is my version of a Tripwire Cheat Sheet. I originally wrote this about a year ago, but it is still pretty much the same. It will help you to get Tripwire up-and-going quickly, if only to learn how it all comes together. There are some additional caveats to run it in production, but hey &#8211; I can&#8217;t give it *all* away for free, can I?  \ud83d\ude09<\/p>\n<p>Of course, many things in this document are taken for granted; like that the Tripwire binaries are in your path, and required config files are where they normally are, etc&#8230;  If not, just use your brain and substitute where necessary.<\/p>\n<p>Just for reference, this was all done on a Opensuse 10 machine, which was before they called it &#8220;Opensuse&#8221; (but I can&#8217;t remember what they called it), and before they removed Tripwire from the standard distribution. Now isn&#8217;t that a kick in the pants. Now they include &#8220;AIDE&#8221;, which I will offer a Cheat Sheet for later&#8230; in the meantime, enjoy&#8230;<\/p>\n<p><em>INITIAL SETUP<\/em><\/p>\n<p>Genetate new host key (optional):<\/p>\n<pre><font size=\"1\">twadmin -m G -S \/etc\/tripwire\/site.key\r\ntwadmin -m G -L \/etc\/tripwire\/&lt;hostname&gt;-local.key<\/font><\/pre>\n<p>To build the configuration file, find a sample of the plain-text configuration file and edit to taste. Then encode and sign the plain-text file and install it as the new configuration file:<\/p>\n<pre><font size=\"1\">twadmin <code>--<\/code>create-cfgfile <code>--<\/code>site-keyfile \/etc\/tripwire\/site.key twcfg.txt<\/font><\/pre>\n<p>To encode and install a policy file for your system, find a sample of the plain-text policy file and edit to taste, then create the policy with your changes:<\/p>\n<pre><font size=\"1\">twadmin <code>--<\/code>create-polfile twpol.txt<\/font><\/pre>\n<p>Consider using a tool like this to create a policy file:<\/p>\n<p><a href=\"http:\/\/www.securityfocus.com\/tools\/2269\" title=\"Tripwire Policy File Generator\"><span class=\"headline\">Tripwire Policy File Generator<\/span><\/a>  [update: It looks like the link to the Generator tool is lost and I cannot find it on the &#8216;net anymore. So, I&#8217;m up-loading my versions &#8212; that I downloaded in 2006 &#8212; to this blog for your convenience. Note also, that these files appear to have been created in 2001. Just use the filename\/links below. Use at your own risk!]<\/p>\n<p>(download the files, run the policy generator, then update policy as below)<\/p>\n<pre><font size=\"1\"><a href=\"http:\/\/yourlinuxguy.com\/wp-content\/uploads\/mktrippol.pl\" title=\"mktrippol.pl\" target=\"_blank\">mktrippol.pl<\/a>  <a href=\"http:\/\/yourlinuxguy.com\/wp-content\/uploads\/rockadm.pl\" title=\"rockadm.pl\" target=\"_blank\">rockadm.pl<\/a>  <a href=\"http:\/\/yourlinuxguy.com\/wp-content\/uploads\/rockbasepolicy.txt\" title=\"rockbasepolicy.txt\" target=\"_blank\">rockbasepolicy.txt<\/a> <a href=\"http:\/\/yourlinuxguy.com\/wp-content\/uploads\/twinit.sh\" title=\"twinit.sh\" target=\"_blank\">twinit.sh<\/a>  <a href=\"http:\/\/yourlinuxguy.com\/wp-content\/uploads\/twsite.pl\" title=\"twsite.pl\" target=\"_blank\">twsite.pl<\/a><\/font><\/pre>\n<p>To initialize the database file:<\/p>\n<pre><code><font size=\"1\">tripwire <code>--<\/code>init<\/font><\/code><\/pre>\n<p>&#8230;examine results, tweak policy file to taste&#8230;<\/p>\n<p>To tweak the policy file, open the plain-text policy file and edit to taste. Then update your existing policy file and database file with your changes:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>update-policy <code>--<\/code>secure-mode low twpol.txt<\/font><\/pre>\n<p>Run an initial integrity check:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>check <code>--<\/code>interactive<\/font><\/pre>\n<p>To configure email settings, add:<\/p>\n<pre><font size=\"1\">emailto  = \"root\",<\/font><\/pre>\n<p>&#8230;to each section after the &#8220;rulename&#8221; line&#8230;<\/p>\n<p>Testing E-mail Settings:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>test <code>--<\/code>email user@example.com<\/font><\/pre>\n<p>Update the Tripwire policy file with the edited text file:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>update-policy <code>--<\/code>secure-mode low twpol.txt<\/font><\/pre>\n<p>Run another integrity check:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>check <code>--<\/code>interactive<\/font><\/pre>\n<p>Update the Tripwire policy file with the edited text file:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>update-policy <code>--<\/code>secure-mode low twpol.txt<\/font><\/pre>\n<p>Create cron job (for example):<\/p>\n<pre><font size=\"1\">0 *\/1 * * * &lt;TFS_root&gt;\/bin\/tripwire <code>--<\/code>check -M<\/font><\/pre>\n<p>&#8230;or&#8230;<\/p>\n<pre><font size=\"1\">0 *\/1 * * * &lt;TFS_root&gt;\/tripwire <code>--<\/code>check <code>--<\/code>email-report <code>--<\/code>email-report-level 1<\/font><\/pre>\n<p>To update the database file immediately after an integrity check:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>check <code>--<\/code>interactive<\/font><\/pre>\n<p>&#8230;it is considered good security form to delete all leftover TXT files (leave the key, pol, and cfg files in place!) at this point. You may have to do another interactive check if you delete the TXT files and are tracking that directory. Congratulations, you should be finished!<\/p>\n<p><em>ONGOING MAINTENANCE<\/em><\/p>\n<p>To edit the configuration file, create a plain-text copy of the configuration file:<\/p>\n<pre><font size=\"1\">twadmin <code>--<\/code>print-cfgfile &gt; twcfgupdate.txt<\/font><\/pre>\n<p>&#8230;edit and save&#8230;<br \/>\nEncode and sign the plain-text file and install it as the new configuration file:<\/p>\n<pre><font size=\"1\">twadmin <code>--<\/code>create-cfgfile <code>--<\/code>site-keyfile \/etc\/tripwire\/site.key twcfgupdate.txt<\/font><\/pre>\n<p>To edit the policy file, create a plain-text copy of the policy file:<\/p>\n<pre><font size=\"1\">twadmin <code>--<\/code>print-polfile &gt; policy.txt<\/font><\/pre>\n<p>&#8230;edit and save&#8230;<br \/>\nUpdate your existing policy file and database file with your changes:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>update-policy <code>--<\/code>secure-mode low policy.txt<\/font><\/pre>\n<p>Since the above changes are likely to be detected, you will need to update the database file:<\/p>\n<pre><font size=\"1\">tripwire <code>--<\/code>check <code>--<\/code>interactive<\/font><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is my version of a Tripwire Cheat Sheet. I originally wrote this about a year ago, but it is still pretty much the same. It will help you to get Tripwire up-and-going quickly, if only to learn how it&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=13\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12,29],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-advanced","category-tripwire"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-d","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":1,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}