<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Erics Tech Blog &#187; Security</title>
	<atom:link href="http://eric.lubow.org/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://eric.lubow.org</link>
	<description>Thoughts, musings, and other idealistic (sometimes useful) systems and development hoopla.</description>
	<lastBuildDate>Fri, 18 Nov 2011 14:56:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Modsecurity 2.5 Review Coming</title>
		<link>http://eric.lubow.org/2009/book-reviews/modsecurity-2-5-review-coming/</link>
		<comments>http://eric.lubow.org/2009/book-reviews/modsecurity-2-5-review-coming/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 11:00:12 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Book Reviews]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/?p=420</guid>
		<description><![CDATA[The folks over at Packt Publishing are kind enough to send me out an advance copy of the upcoming Modsecurity book by Magnus Mischel. I have written about mod security before, but really haven&#8217;t had a chance to look into it recently. I am anxious to see where its advanced to in version 2.5. If [...]]]></description>
			<content:encoded><![CDATA[<p>The folks over at <a href="http://www.packtpub.com/">Packt Publishing</a> are kind enough to send me out an advance copy of the upcoming <a href="http://www.packtpub.com/modsecurity-2-5/book">Modsecurity book</a> by <a href="http://www.packtpub.com/author_view_profile/id/373">Magnus Mischel</a>.  I have written about mod security <a href="http://eric.lubow.org/2007/engarde/configuring-mod_security-for-engarde-secure-linux/">before</a>, but really haven&#8217;t had a chance to look into it recently.  I am anxious to see where its advanced to in version 2.5.</p>
<p>If you don&#8217;t know anything about <a href="http://www.modsecurity.org/">mod_security</a>, I encourage you to read up on it in the interim.</p>
<p>Stay tuned for the review.</p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2010/book-reviews/mod-security-2-5-by-magnus-mischel/' rel='bookmark' title='Mod-Security 2.5 by Magnus Mischel'>Mod-Security 2.5 by Magnus Mischel</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2009/book-reviews/modsecurity-2-5-review-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redacted On A Feedback Loop</title>
		<link>http://eric.lubow.org/2009/mail/redacted-on-a-feedback-loop/</link>
		<comments>http://eric.lubow.org/2009/mail/redacted-on-a-feedback-loop/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 00:00:43 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/?p=266</guid>
		<description><![CDATA[This post is a little more of a rant than I usually make, but I think its warranted. If you don&#8217;t know what a feedback loop is, read here. I&#8217;m not sure who thinks its a good idea to replace all instances of an email addresses in a feedback loop with [redacted]@feedbackloopcompany.com, but it is [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a little more of a rant than I usually make, but I think its warranted.  If you don&#8217;t know what a feedback loop is, read <a href="http://en.wikipedia.org/wiki/Feedback_Loop_%28email%29">here</a>.</p>
<p>I&#8217;m not sure who thinks its a good idea to replace all instances of an email addresses in a feedback loop with [redacted]@feedbackloopcompany.com, but it is of no help to anyone. An argument can be made for protecting the identity of the recipient, but that argument holds little weight because there is little the sender can do about it.</p>
<p>If a sender needs to go through the authorization process of a larger recipient domain (like AOL, Yahoo!, or Excite for example) where their IP reputation is checked and their history is checked, etc. then why should there still be restrictions placed on the information going between the two domains (you as the sender and them as the recipient domains).  I am aware that the draft specification allow the operating domain for the feedback loop to keep the identity private of the user clicking the &#8220;Report SPAM&#8221; button, but that forces the sending domains to use tactics to circumvent this to keep their reputation up.</p>
<p>Therefore I believe that if a sending company has verified their feedback loop address, they should be able to see which recipient reported their email as &#8220;Junk&#8221;.  Get rid of the <strong>redacted</strong> and leave the email address intact.</p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2010/mail/list-of-feedback-loops/' rel='bookmark' title='List of Feedback Loops'>List of Feedback Loops</a></li>
<li><a href='http://eric.lubow.org/2007/perl/mailsender/' rel='bookmark' title='Mail::Sender'>Mail::Sender</a></li>
<li><a href='http://eric.lubow.org/2010/news/yahoo-and-goodmail-cut-the-cord-temporarily/' rel='bookmark' title='Yahoo and Goodmail Cut the Cord (Temporarily)'>Yahoo and Goodmail Cut the Cord (Temporarily)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2009/mail/redacted-on-a-feedback-loop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Checking Roles in Views Using RoleRequirement</title>
		<link>http://eric.lubow.org/2009/ruby/rails/checking-roles-in-views-using-rolerequirement/</link>
		<comments>http://eric.lubow.org/2009/ruby/rails/checking-roles-in-views-using-rolerequirement/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 15:00:42 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/?p=244</guid>
		<description><![CDATA[One of the rails projects I am working on is using the RoleRequirement plugin. This is a great plugin for seamless integration of roles into the controller level, but there wasn&#8217;t really much documentation on integrating this into the views themselves. So I figured I would put this little gem out there which has done [...]]]></description>
			<content:encoded><![CDATA[<p>One of the rails projects I am working on is using the <a href="http://code.google.com/p/rolerequirement/">RoleRequirement</a> plugin.  This is a great plugin for seamless integration of roles into the controller level, but there wasn&#8217;t really much documentation on integrating this into the views themselves.  So I figured I would put this little gem out there which has done wonders for the DRYness and cleanliness of my code.</p>
<p>For instance, the code below checks whether or not the current user has the admin role.  If they do, it prints the admin menu (in my case I use a partial for this).</p>
<div class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span> <span style="color:#9966CC; font-weight:bold;">if</span> current_user.<span style="color:#9900CC;">has_role</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'admin'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
<span style="color:#006600; font-weight:bold;">&lt;</span>!<span style="color:#006600; font-weight:bold;">--</span> <span style="color:#9966CC; font-weight:bold;">Begin</span> Admin Panel <span style="color:#006600; font-weight:bold;">--&gt;</span><br />
<span style="color:#006600; font-weight:bold;">&lt;</span>h2<span style="color:#006600; font-weight:bold;">&gt;</span>admin<span style="color:#006600; font-weight:bold;">&lt;/</span>h2<span style="color:#006600; font-weight:bold;">&gt;</span><br />
<span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span>= render <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'/layouts/admin'</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
<span style="color:#006600; font-weight:bold;">&lt;</span>!<span style="color:#006600; font-weight:bold;">--</span> <span style="color:#9966CC; font-weight:bold;">End</span> Admin Panel <span style="color:#006600; font-weight:bold;">--&gt;</span><br />
<span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></div></div>
<p>The great thing is that (although it might be a little unclean), you can chain some conditionals here to show the appropriate menu items based on a users role(s).  This is powerful because a user< ->role relationship is a HABTM (Has And Belongs To Many) relationship.</p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2009/ruby/rails/country-state-select-using-carmen-and-jquery/' rel='bookmark' title='Country-State Select Using Carmen and jQuery'>Country-State Select Using Carmen and jQuery</a></li>
<li><a href='http://eric.lubow.org/2009/ruby/rails/testing-sessions-with-digestsha256-passwords-in-rails/' rel='bookmark' title='Testing Sessions with Digest::SHA256 Passwords In Rails'>Testing Sessions with Digest::SHA256 Passwords In Rails</a></li>
<li><a href='http://eric.lubow.org/2008/linux-security/checking-for-a-dos/' rel='bookmark' title='Checking For A DoS'>Checking For A DoS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2009/ruby/rails/checking-roles-in-views-using-rolerequirement/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Checking For A DoS</title>
		<link>http://eric.lubow.org/2008/linux-security/checking-for-a-dos/</link>
		<comments>http://eric.lubow.org/2008/linux-security/checking-for-a-dos/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 14:00:58 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://eric.lubow.org/blog/?p=50</guid>
		<description><![CDATA[Working on groups of web servers, especially ones that are highly susceptible to attack, it is a good idea to have a string of commands that will allow you to check what is going on. Check for DDos: netstat -n &#124; grep EST &#124; awk '{ print $5 }' &#124; cut -d: -f1 &#124; sort [...]]]></description>
			<content:encoded><![CDATA[<p>Working on groups of web servers, especially ones that are highly susceptible to attack, it is a good idea to have a string of commands that will allow you to check what is going on.</p>
<p>Check for DDos:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netstat -n | grep EST | awk '{ print $5 }' | cut -d: -f1 | sort | uniq -c | sort -nr | perl -an -e 'use Socket; ($hostname, @trash) = gethostbyaddr(inet_aton($F[1]), AF_INET); print &quot;$F[0]\t$F[1]\t$hostname\n&quot;;'</div></div>
<p>Using this command will produce a list of hostnames that have a connect to the machine in an ESTABLISHED state.  This is handy for creating a firewall rule either on the host (iptables, ipfw) or a little further away from the machine (at the edge router).</p>
<p>Check for web attacks:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cat eric.lubow.org-access_log.20081015 | awk '{print $1 }' | sort | uniq -c | sort -nr | head | perl -an -e 'use Socket; ($hostname, @trash) = gethostbyaddr(inet_aton($F[1]), AF_INET); print &quot;$F[0]\t$F[1]\t$hostname\n&quot;;'</div></div>
<p>By using this command, you will get a hostname lookup on the IP sorted by total hit count descending.  As when checking for DDos attacks, you can use this information to write firewall rules.</p>
<p>More web attack checks:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">for i in `ls *.20081015 | grep -v error`; do echo &quot;##### $i ######&quot;; tail -n 10000 $i| awk '{print $1};' | sort -n | uniq -c | sort -nr | head -2; done</div></div>
<p>The difference between this check and the previous check is that this time, you may have a lot more logfiles to go through.  I am also assuming that they are stored by <sitename>.<date>.  They will print out which file its scanning and the top 2 issues from that file.</p>
<p>Referrer Check:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">for file in `ls -lrS *access*20080525* | tail -n20`; do echo &quot;==========&quot; $file; gawk --re-interval -F'&quot;' '{ split($4, myrt, &quot;/&quot;); &nbsp;split($0, myct); split(myct[3], myc, &quot; &quot;); if (length(myrt[3])==0) { myrt[3]=&quot;none&quot;}; if (myrt[3] ~ /([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}/) { referrers[myrt[3]&quot;/&quot;myc[1]]++; } else { t=split(myrt[3], myrt2, &quot;.&quot;); myref=&quot;*.&quot;myrt2[t-1]&quot;.&quot;myrt2[t]; referrers[myref&quot;/&quot;myc[1]]++; } } END { for (referrer in referrers) { print referrers[referrer], referrer } }' $file | grep -v none | sort -n; done</div></div>
<p>This last check will get the referrer for a page from the logs and count up the number of times that exact referrer drives traffic to your page.  Although this may initially appear to be only tangentially useful, if you are getting DDos, it may be hard to track down.  Let&#8217;s say that you have some static content like a funny image and want to know why everyone is going to that image.  Maybe your getting <a href="http://digg.com/">Dugg</a> or <a href="http://slashdot.org">./</a> and this will help you tell (and find out what your page is so you can Digg yourself if you&#8217;re into that sort of thing).</date></sitename></p>


<p>Related posts:<ol><li><a href='http://eric.lubow.org/2007/perl/syshostname/' rel='bookmark' title='Sys::Hostname'>Sys::Hostname</a></li>
<li><a href='http://eric.lubow.org/2009/perl/cleaning-up-long-conditionals-with-grep/' rel='bookmark' title='Cleaning Up Long Conditionals With Grep'>Cleaning Up Long Conditionals With Grep</a></li>
<li><a href='http://eric.lubow.org/2009/ruby/rails/checking-roles-in-views-using-rolerequirement/' rel='bookmark' title='Checking Roles in Views Using RoleRequirement'>Checking Roles in Views Using RoleRequirement</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://eric.lubow.org/2008/linux-security/checking-for-a-dos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

