{"id":974,"date":"2014-01-21T14:51:24","date_gmt":"2014-01-21T14:51:24","guid":{"rendered":"http:\/\/blogs.silicontechnix.com\/?p=974"},"modified":"2014-01-21T15:09:23","modified_gmt":"2014-01-21T15:09:23","slug":"monitor-web-site-files-with-auditd","status":"publish","type":"post","link":"https:\/\/blogs.silicontechnix.com\/?p=974","title":{"rendered":"Monitor Web Site Files With Auditd"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>The Linux Auditing System and auditd are a great way to monitor who and when changes are made to the files in your website. To install and configure follow these steps:<\/p>\n<p>1. Install auditd and related utilities:<\/p>\n<pre class=\"brush:bash\">yum install audit<\/pre>\n<p>2. Make sure auditd is running:<\/p>\n<pre class=\"brush:bash\">\/sbin\/chkconfig --list auditd \r\nauditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off<\/pre>\n<p>3. Edit \/etc\/audit\/auditd.conf and change:<\/p>\n<pre class=\"brush:bash\">action_mail_acct = [your email address]<\/pre>\n<p>This sets any action emails to go to your preferred address.<br \/>\n4. Edit \/etc\/audit\/audit.rules and add a line like this to the bottom:<\/p>\n<pre class=\"brush:bash\">-w [path_to_website] -p wa -k [key]<\/pre>\n<p>So if you website is located at:<br \/>\n\/var\/www\/vhosts\/mysite.com\/httpdocs<br \/>\nThen a command like:<\/p>\n<pre class=\"brush:bash\">-w \/var\/www\/vhosts\/mysite.com\/httpdocs -p wa -k mysite<\/pre>\n<p>would setup auditing of write and attribute change requests. Events matching this rule would be tagged with the \u201cmysite\u201d key.<\/p>\n<pre class=\"brush:bash\">\/sbin\/service auditd restart<\/pre>\n<p>Audit logs go to:<\/p>\n<pre class=\"brush:bash\">\/var\/log\/audit\/audit.log<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; The Linux Auditing System and auditd are a great way to monitor who and when changes are made to the files in your website. To install and configure follow these steps: 1. Install auditd and related utilities: yum install audit 2. Make sure auditd is running: \/sbin\/chkconfig &#8211;list auditd auditd 0:off 1:off 2:on 3:on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"no","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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[17,95],"tags":[445,19,480,75],"class_list":["post-974","post","type-post","status-publish","format-standard","hentry","category-security","category-system-administration","tag-auditd","tag-linux","tag-security","tag-website"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p12j6H-fI","_links":{"self":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=974"}],"version-history":[{"count":4,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/974\/revisions"}],"predecessor-version":[{"id":978,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/974\/revisions\/978"}],"wp:attachment":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}