<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: Tag security</title>
    <link>http://blog.kineticweb.com/articles/tag/security</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>securing your database.yml</title>
      <description>&lt;p&gt;During the Intro to Rails portion of tonight&amp;#8217;s Philly on Rails, a question was raised asking if there was a better way to give Rails your database password, rather then storing it in the database.yml file.&lt;/p&gt;


	&lt;p&gt;I tried the method below, which seems to work:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;development&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt;
  &lt;span class="ident"&gt;adapter&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; &lt;span class="ident"&gt;mysql&lt;/span&gt;
  &lt;span class="ident"&gt;database&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; &lt;span class="ident"&gt;whatever_development&lt;/span&gt;
  &lt;span class="ident"&gt;username&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; &lt;span class="ident"&gt;whatever&lt;/span&gt;
  &lt;span class="ident"&gt;password&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; &lt;span class="punct"&gt;&amp;lt;%=&lt;/span&gt;&lt;span class="string"&gt; gets %&amp;gt;
  socket: /tmp/mysql.sock&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;The first time the database is accessed by Rails, you can simply enter the password at the script/server prompt and you&amp;#8217;re in business.&lt;/p&gt;


	&lt;p&gt;However, I&amp;#8217;m not sure how this would work with the -d option on script/server. I imagine it would not work.&lt;/p&gt;


	&lt;p&gt;Update: &lt;a href="http://pragdave.pragprog.com/pragdave/2007/04/prompting_for_r.html"&gt;PragDave has some thoughts on this, too.&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 06 Aug 2007 18:43:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d75b24a9-b775-416d-a8d2-3f121dbe9501</guid>
      <author>Colin A. Bartlett</author>
      <link>http://blog.kineticweb.com/articles/2007/08/06/securing-your-database-yml</link>
      <category>Rails</category>
      <category>security</category>
      <category>MySQL</category>
      <trackback:ping>http://blog.kineticweb.com/articles/trackback/52</trackback:ping>
    </item>
  </channel>
</rss>
