<?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>Richard K Miller &#187; Security</title>
	<atom:link href="http://richardkmiller.com/category/security/feed" rel="self" type="application/rss+xml" />
	<link>http://richardkmiller.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 15:26:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Password Protect Redmine with Apache, mod_perl, and Redmine.pm</title>
		<link>http://richardkmiller.com/932/how-to-password-protect-redmine-with-apache-mod_perl-redmine-pm</link>
		<comments>http://richardkmiller.com/932/how-to-password-protect-redmine-with-apache-mod_perl-redmine-pm#comments</comments>
		<pubDate>Sun, 13 Nov 2011 01:16:01 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://richardkmiller.com/?p=932</guid>
		<description><![CDATA[Today I needed to password-protect a Redmine installation. I&#8217;ve typically used mod_auth_mysql for similar projects, but Redmine uses a salted password format that&#8217;s incompatible with mod_auth_mysql. So, I turned to Apache/Perl authentication, a first for me (I rarely touch Perl) &#8230; <a href="http://richardkmiller.com/932/how-to-password-protect-redmine-with-apache-mod_perl-redmine-pm">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-36009b2faccc89c3eb8fe905eb5d37cd1cffcf97'><p>Today I needed to password-protect a <a href="http://www.redmine.org/">Redmine</a> installation. I&#8217;ve typically used mod_auth_mysql for similar projects, but Redmine uses a salted password format that&#8217;s incompatible with mod_auth_mysql. So, I turned to Apache/Perl authentication, a first for me (I rarely touch Perl) and was able to make it work.</p>
<ol>
<li>Install mod_perl, and the DBI, MySQL, and Digest (SHA1) Perl modules.
<pre class="brush: bash; title: ;">
$ apt-get install libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl libdigest-sha1-perl
</pre>
</li>
<li>Copy Redmine.pm to the appropriate Perl location.
<pre class="brush: bash; title: ;">
$ cd /path/to/redmine
$ mkdir -p /usr/lib/perl5/Apache/Authn
$ cp extra/svn/Redmine.pm /usr/lib/perl5/Apache/Authn/
</pre>
</li>
<li>Perhaps I&#8217;m not using Redmine&#8217;s projects/members/permissions correctly, but I had to patch Redmine.pm to get it to work for me. I greatly simplified the SQL statement used to authenticate a user. There&#8217;s no sense of permissions; it&#8217;s simply a yes/no for authenticated users.
<pre class="brush: diff; title: ;">
--- Redmine.pm	2011-11-12 17:33:10.000000000 -0700
+++ Redmine.richardkmiller.pm	2011-11-12 17:37:26.000000000 -0700
@@ -148,16 +148,11 @@
   my ($self, $parms, $arg) = @_;
   $self-&gt;{RedmineDSN} = $arg;
   my $query = &quot;SELECT
-                 hashed_password, salt, auth_source_id, permissions
-              FROM members, projects, users, roles, member_roles
+                 hashed_password, salt
+              FROM users
               WHERE
-                projects.id=members.project_id
-                AND member_roles.member_id=members.id
-                AND users.id=members.user_id
-                AND roles.id=member_roles.role_id
-                AND users.status=1
-                AND login=?
-                AND identifier=? &quot;;
+                    users.status=1
+                AND login=?&quot;;
   $self-&gt;{RedmineQuery} = trim($query);
 }

@@ -336,11 +331,12 @@
   }
   my $query = $cfg-&gt;{RedmineQuery};
   my $sth = $dbh-&gt;prepare($query);
-  $sth-&gt;execute($redmine_user, $project_id);
+  $sth-&gt;execute($redmine_user);

   my $ret;
-  while (my ($hashed_password, $salt, $auth_source_id, $permissions) = $sth-&gt;fetchrow_array) {
-
+  while (my ($hashed_password, $salt) = $sth-&gt;fetchrow_array) {
+      my $permissions = &quot;:commit_access&quot;;
+      my $auth_source_id = 0;
       unless ($auth_source_id) {
 	  			my $method = $r-&gt;method;
           my $salted_password = Digest::SHA1::sha1_hex($salt.$pass_digest);
</pre>
</li>
<li>Configure and restart Apache.
<pre class="brush: perl; title: ;">
&lt;virtualhost *:80&gt;
    ServerName example.com
    DocumentRoot &quot;/var/www/sites/example.com/public&quot;
    RailsEnv production

    PerlLoadModule Apache::Authn::Redmine

    &lt;directory &quot;/var/www/sites/example.com/public&quot;&gt;
        AuthType basic
        AuthName &quot;Private Area&quot;
        Require valid-user
        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
        RedmineDSN &quot;DBI:mysql:database=my_database;host=localhost&quot;
        RedmineDbUser my_db_user
        RedmineDbPass my_db_password
    &lt;/directory&gt;
&lt;/virtualhost&gt;
</pre>
</li>
</ol>
<p>By the way, I&#8217;m running Ubuntu 11.10 (oneiric), Apache 2.2, MySQL 5.1, and Redmine 1.2.2.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/932/how-to-password-protect-redmine-with-apache-mod_perl-redmine-pm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to browse securely with SSH and a SOCKS proxy</title>
		<link>http://richardkmiller.com/337/how-to-browse-securely-with-ssh-and-a-socks-proxy</link>
		<comments>http://richardkmiller.com/337/how-to-browse-securely-with-ssh-and-a-socks-proxy#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:54:52 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Main]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/?p=337</guid>
		<description><![CDATA[I was in Moab this weekend with my family and our motel had free wireless Internet. I used SSH and a SOCKS proxy to create a secure tunnel to my iMac at work. This allowed me to browse Gmail and &#8230; <a href="http://richardkmiller.com/337/how-to-browse-securely-with-ssh-and-a-socks-proxy">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-f166988fec97ae901087390e86c67a8a931c5c62'><p>I was in Moab this weekend with my family and our motel had free wireless Internet. I used SSH and a SOCKS proxy to create a secure tunnel to my iMac at work. This allowed me to browse Gmail and Facebook securely.</p>
<p>Here&#8217;s a screencast on how to create an SSH tunnel and browse securely in Safari and Firefox:<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/0gmNGMlEMxw&#038;hl=en&#038;fs=1&#038;fmt=18"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/0gmNGMlEMxw&#038;hl=en&#038;fs=1&#038;fmt=18" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Here&#8217;s a full-size video:<br />
<a href="http://www.richardkmiller.com/screencasts/secure_connection_ssh_and_socks/">How to browse securely with SSH and a SOCKS proxy</a> (full size video)</p>
<p>These are the basic steps on a Mac:<br />
1. Open Terminal. (In your Applications/Utilities folder.)<br />
2. Type &#8220;ssh -D 9999 username@example.com&#8221;, replacing &#8220;username&#8221; and &#8220;example.com&#8221; with the actual username and address of your remote machine. The remote machine will need the SSH service, or Remote Login service, turned on.<br />
3. Open System Preferences -> Network -> Advanced tab -> Proxies.<br />
4. Turn on the &#8220;SOCKS Proxy&#8221; and enter &#8220;127.0.0.1&#8243; and &#8220;9999&#8243; in the fields. Click OK and Apply.</p>
<p>Now your Internet connection will be tunneled through a secure connection to your remote machine &#8212; a poor man&#8217;s VPN.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/337/how-to-browse-securely-with-ssh-and-a-socks-proxy/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What goes around, comes around</title>
		<link>http://richardkmiller.com/314/what-goes-around-comes-around</link>
		<comments>http://richardkmiller.com/314/what-goes-around-comes-around#comments</comments>
		<pubDate>Thu, 21 Feb 2008 05:57:05 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[mediawiki mod_auth_mysql jonudell]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2008/02/what-goes-around-comes-around</guid>
		<description><![CDATA[I&#8217;m not a big believer in karma, but this week I experienced some karma-like effects. Two years ago for work, I developed code to protect wiki websites. Then I published it on my blog. This weekend a software upgrade caused &#8230; <a href="http://richardkmiller.com/314/what-goes-around-comes-around">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-f1113d8105150d123c3a417f48973f5e57662a94'><p>I&#8217;m not a big believer in karma, but this week I experienced some karma-like effects. Two years ago for work, I developed code to <a href="http://www.richardkmiller.com/blog/archives/2006/05/password-protecting-mediawiki-with-mod_auth_mysql">protect wiki websites</a>. Then I published it on my blog.</p>
<p>This weekend a software upgrade caused this protection code to stop working on our websites. I couldn&#8217;t find an answer. Then yesterday, some chap named Nathan left a comment describing the <a href="http://www.richardkmiller.com/blog/archives/2006/05/password-protecting-mediawiki-with-mod_auth_mysql#comment-144444">solution</a>. I hadn&#8217;t asked for help. He was simply documenting his own experience. But it was just what I needed.</p>
<p>This is fundamental to open source software &#8212; the creation of a software commons. It&#8217;s also what happens on Wikipedia, the creation of a knowledge commons.</p>
<p>In <em>Love Is the Killer App</em>, Tim Sanders suggests freely sharing your knowledge and your network, not hoarding them.</p>
<p>Jon Udell talks of &#8220;narrating&#8221; one&#8217;s work from day to day. This allows everyone to share in your vast brain knowledge, and it becomes your living résumé. I&#8217;d like to do more of that.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/314/what-goes-around-comes-around/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Choose a good password</title>
		<link>http://richardkmiller.com/249/choose-a-good-password</link>
		<comments>http://richardkmiller.com/249/choose-a-good-password#comments</comments>
		<pubDate>Fri, 11 May 2007 14:09:58 +0000</pubDate>
		<dc:creator>Richard K Miller</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.richardkmiller.com/blog/archives/2007/05/choose-a-good-password</guid>
		<description><![CDATA[You&#8217;ve heard over and over the importance of choosing a good password, but we all seem to keep the same bad habits. Roger Grimes analyzed 34,000 real passwords and discovered some interesting trends: As expected, English vowels are by far &#8230; <a href="http://richardkmiller.com/249/choose-a-good-password">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class='microid-8ed23d35e7134fb51a9e62918c002b3e3cc99f8c'><p>You&#8217;ve heard over and over the importance of choosing a good password, but we all seem to keep the same bad habits. <a href="http://www.infoworld.com/article/06/11/17/47OPsecadvise_1.html">Roger Grimes analyzed 34,000 real passwords</a> and discovered some interesting trends:</p>
<blockquote>
<ul>
<li>As expected, English vowels are by far the most frequent occurring password symbols.</li>
<li>[In passwords with numbers,] the number 1 appeared 45 percent of the time, followed by the number 2 (22 percent.)</li>
<li>The exclamation point was the most commonly used non-alphanumeric character.</li>
<li>Words, colors, years, names, sports, hobbies, and music groups were very popular.</li>
<li>Other popular words include: angel, baby, boy, girl, big, monkey, me, and the.</li>
<li>Names of sports &#8212; golf, football, soccer, and so on &#8212; were as popular as professional sports teams and college team nicknames</li>
</ul>
</blockquote>
<p>Drawing on this study and other wisdom, here are some <strong>tips for choosing a good, secure password</strong>. Read #8 if you don&#8217;t read them all:</p>
<ol>
<li>Don&#8217;t write your password on a sticky note attached to your monitor (or &#8220;hidden&#8221; under your keyboard.)</li>
<li>Don&#8217;t choose anything obvious like your birthday, spouse name, etc.</li>
<li>Don&#8217;t choose any single word you can find in a dictionary.</li>
<li>Don&#8217;t use the same password on a secure site (like your bank) as on an insecure site (like a mailing list.) If someone discovers your password because it was emailed to you from an insecure site, you don&#8217;t want your bank account to be vulnerable. Ideally you&#8217;d keep a different password for each site.</li>
<li>If a digit is required in your password, don&#8217;t simply append a &#8220;1&#8243; or a &#8220;2&#8243;. If a symbol is required, don&#8217;t simply append an exclamation point.</li>
<li>Learn which channels are secure and which are not. Generally HTTP, FTP, and VNC are not secure, while HTTPS, and SSH are secure. Don&#8217;t use secure passwords on insecure channels. (Look for the padlock in your browser.)</li>
<li>Pick a password you can remember, so you won&#8217;t have to write it down.</li>
<li>Pick a LONGER password. Think of a phrase or sentence or haiku, not a word. <a href="http://www.infoworld.com/article/06/07/21/30OPsecadvise_1.html">Password length is more important than symbols or numbers.</a> For a security expert like Mr. Grimes, a 6-9 character password with &#8220;complexity&#8221; (symbols, numbers) is fairly easy to break, while a password with 15+ characters is almost impossible to break.</li>
</ol>
<p>Eventually, we may be using our fingerprints or some other biometric procedure, but until then, choose a good password.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://richardkmiller.com/249/choose-a-good-password/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

