<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>&amp;AElig;difice.org Blog</title> <description>Ramblings on security, systems, etc.</description> <link>https://blog.aedifice.org/</link> <atom:link href="https://blog.aedifice.org/feed.xml" rel="self" type="application/rss+xml"/> <pubDate>Sun, 06 May 2018 11:37:45 -0700</pubDate> <lastBuildDate>Sun, 06 May 2018 11:37:45 -0700</lastBuildDate> <generator>Jekyll v2.5.3</generator> <item> <title>Use Mac OS X&#39;s Keychain for Password Retrieval in OfflineIMAP</title> <description>&lt;p&gt;In my &lt;a href=&quot;/2009/10/18/use-mac-os-xs-keychain-for-password-retrieval-in-mutt/&quot;&gt;earlier post&lt;/a&gt;, I explained how to retrieve a password stored in a Mac OS X keychain from within Mutt. Mutt can be compiled with IMAP support, allowing for up-to-date access to your email account, but sometimes you want local copies of your IMAP folders for offline browsing or for backups. &lt;a href=&quot;http://software.complete.org/software/projects/show/offlineimap&quot;&gt;OfflineIMAP&lt;/a&gt; provides exactly this functionality: it synchronizes local maildir format email folders with a remote IMAP host. As with mutt, you normally can put your passwords in the configuration file, &lt;code&gt;~/.offlineimaprc&lt;/code&gt;, but that leaves your password in clear text in the file. Thankfully, OfflineIMAP allows you to run python code in some of its fields, and it lets you specify a file containing python code for it to source methods from.&lt;/p&gt; &lt;!--more--&gt; &lt;h2 id=&quot;the-python-source-file&quot;&gt;The python source file&lt;/h2&gt; &lt;p&gt;First, we need to make a python function that will call the &lt;code&gt;security&lt;/code&gt; command and grab only the relevant part of its output:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;commands&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;get_keychain_pass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;account&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;security&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;/usr/bin/security&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;command&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;find-internet-password&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;account&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;account&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;server&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%(security)s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%(command)s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; -g -a &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%(account)s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; -s &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;%(server)s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;outtext&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getoutput&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;r&amp;#39;password: &amp;quot;(.*)&amp;quot;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;outtext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;I put this into &lt;code&gt;~/.mutt/offlineimap.py&lt;/code&gt;, although something like &lt;code&gt;~/.offlineimap.py&lt;/code&gt; makes sense as well. The params dict/hash makes it more legible and easy to change the command, and the command string gets run through &lt;code&gt;commands.getoutput()&lt;/code&gt; to produce the command output. The &lt;code&gt;re.match()&lt;/code&gt; line does the same thing as the perl regular expression matching that showed up in the muttrc file.&lt;/p&gt; &lt;h2 id=&quot;offlineimaprc&quot;&gt;offlineimaprc&lt;/h2&gt; &lt;p&gt;Next, OfflineIMAP’s RC file needs to know about this function. This can be done by adding a &lt;code&gt;pythonfile&lt;/code&gt; directive to the &lt;code&gt;[general]&lt;/code&gt; section:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cfg&quot; data-lang=&quot;cfg&quot;&gt;&lt;span class=&quot;k&quot;&gt;[general]&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;pythonfile&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;~/.mutt/offlineimap.py&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;Finally, the &lt;code&gt;get_keychain_pass()&lt;/code&gt; function itself needs to get called from the correct field:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cfg&quot; data-lang=&quot;cfg&quot;&gt;&lt;span class=&quot;k&quot;&gt;[Repository gmailRemote]&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Gmail&lt;/span&gt; &lt;span class=&quot;s&quot;&gt; remoteuser = someuser@gmail.com&lt;/span&gt; &lt;span class=&quot;s&quot;&gt; remotepasseval = get_keychain_pass(account=&amp;quot;someuser@gmail.com&amp;quot;, server=&amp;quot;imap.gmail.com&amp;quot;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;Upon startup, OfflineIMAP will now run &lt;code&gt;security&lt;/code&gt; and try to acquire the specified password from the keychain.&lt;/p&gt; &lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt; &lt;p&gt;The above should work fine with OfflineIMAP and Mutt running at the same time. However, when I was still running Mac OS X 10.4, I ran into an annoying race condition involving &lt;code&gt;security&lt;/code&gt;. When both programs executed &lt;code&gt;security&lt;/code&gt; while my keychain was locked, both instances of security would open dialogs asking for my keychain password (I do not know if this problem still occurs in Mac OS X 10.5 or 10.6). My solution to this was to write a wrapper script that called &lt;code&gt;security&lt;/code&gt; itself. It used a lockfile to let only one instance of &lt;code&gt;security&lt;/code&gt; run at a time, and it also did the regular expression filtering for the password. If you are interested in using my script, &lt;code&gt;getpassword&lt;/code&gt; can be downloaded &lt;a href=&quot;/files/getpassword.rb&quot;&gt;here&lt;/a&gt; (It is written in Ruby, and it requires the ‘lockfile’ Ruby gem, so it may not be suitable for you as it currently exists).&lt;/p&gt; </description> <pubDate>Mon, 01 Feb 2010 22:40:35 -0000</pubDate> <link>https://blog.aedifice.org/2010/02/01/use-mac-os-xs-keychain-for-password-retrieval-in-offlineimap/</link> <guid isPermaLink="true">https://blog.aedifice.org/2010/02/01/use-mac-os-xs-keychain-for-password-retrieval-in-offlineimap/</guid> <category>macosx</category> <category>email</category> <category>keychain</category> <category>offlineimap</category> </item> <item> <title>RKHunter &amp;mdash; Making False Positives Go Away on Gentoo Linux</title> <description>&lt;p&gt;&lt;strong&gt;Update 2018/05/06:&lt;/strong&gt; Updated the RKHunter links to RKHunter’s homepage and the Gentoo package.&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://rkhunter.sourceforge.net/&quot;&gt;RKHunter&lt;/a&gt; is a tool for detecting rootkits on Unix-like systems. I run it daily on my Gentoo server, and it emails me a report about whether it updated its database of tests as well as any warnings it comes across while running its tests. Recently, Gentoo &lt;a href=&quot;https://packages.gentoo.org/packages/app-forensics/rkhunter&quot;&gt;marked rkhunter-1.3.4 as stable&lt;/a&gt;. After I updated it, it began reporting more false positives than the older 1.2.9 (it used to only report the existence of promiscuous network interfaces, which is caused by my network confguration).&lt;/p&gt; &lt;p&gt;Some were due to programs in /usr/bin being shell scripts instead of binaries, while others were complaining about the fact that I did not have the latest version of GnuPG or OpenSSH (I stick to Gentoo’s stable releases, which are currently a minor version behind). Another problem was over Linux kernel modules. I built my kernel with all module support disabled, compiling in everything I want my kernel to have.&lt;/p&gt; &lt;p&gt;Read on to find out how I resolved the various warnings in /var/log/rkhunter.log by editing /etc/rkhunter.conf.&lt;/p&gt; &lt;!--more--&gt; &lt;h2 id=&quot;fixing-changed-binaries&quot;&gt;Fixing changed binaries&lt;/h2&gt; &lt;p&gt;By default, RKHunter checks the properties of files in /bin, /usr/bin, etc. Whenever a package updates, its binary executables usually change as well. For example (from rkhunter.log):&lt;/p&gt; &lt;pre&gt;&lt;code&gt;[04:50:29] /bin/netstat [ Warning ] [04:50:29] Warning: The file properties have changed: [04:50:30] File: /bin/netstat [04:50:30] Current hash: 58ad996b4c822f25760fbe4bfb9904d623aeb51b [04:50:30] Stored hash : 715d86e1b178c19807a315fe339e87b3e5a12c75[04:50:31] Current inode: 16178 Stored inode: 16175 [04:50:31] Current size: 125996 Stored size: 116940 [04:50:31] Current file modification time: 1263850324 [04:50:32] Stored file modification time : 1258110183 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The solution for this sort of warning is straightforward. RKHunter’s properties database needs to be updated:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;# rkhunter --propupd &lt;/code&gt;&lt;/pre&gt; &lt;h2 id=&quot;whitelisting-valid-scripts&quot;&gt;Whitelisting Valid Scripts&lt;/h2&gt; &lt;p&gt;It also reports that some files have been replaced by scripts. For example (again, from rkhunter.log):&lt;/p&gt; &lt;pre&gt;&lt;code&gt;[04:51:43] /usr/bin/whatis [ Warning ] [04:51:43] Warning: The command &#39;/usr/bin/whatis&#39; has been replaced by a script [04:51:43] Warning: The command &#39;/usr/bin/whatis&#39; has been replaced by a script: /usr/bin/whatis: POSIX shell script text executable ... [04:51:48] /usr/bin/lwp-request [ Warning ] [04:51:48] Warning: The command &#39;/usr/bin/lwp-request&#39; has been replaced by a sc ript: /usr/bin/lwp-request: a /usr/bin/perl -w script text executable &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;First, I examined the programs directly to make sure that they looked okay – that is, that they are false positives and not actual positives. In order for rkhunter to not complain, I needed to either disable this test, or let the test know which files should be scripts and not binaries. To do the latter, search /etc/rkhunter.conf for ‘SCRIPTWHITELIST’ and add a line with the path for each command that you expect to be a script:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Allow the specified commands to be scripts.&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# One command per line (use multiple SCRIPTWHITELIST lines).&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#SCRIPTWHITELIST=/sbin/ifup&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#SCRIPTWHITELIST=/sbin/ifdown&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#SCRIPTWHITELIST=/usr/bin/groups&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;SCRIPTWHITELIST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/ldd &lt;span class=&quot;nv&quot;&gt;SCRIPTWHITELIST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/whatis &lt;span class=&quot;nv&quot;&gt;SCRIPTWHITELIST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/lwp-request&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;Next time rkhunter runs, it will no longer complain about ldd, whatis, or lwp-request being scripts.&lt;/p&gt; &lt;h2 id=&quot;an-expected-promiscuous-interface&quot;&gt;An Expected Promiscuous Interface&lt;/h2&gt; &lt;pre&gt;&lt;code&gt;[04:57:51] Performing checks on the network interfaces [04:57:51] Info: Starting test name &#39;promisc&#39; [04:57:52] Checking for promiscuous interfaces [ Warning ] [04:57:52] Warning: Possible promiscuous interfaces: [04:57:52] &#39;ifconfig&#39; command output: UP BROADCAST RUNNING PR OMISC MULTICAST MTU:1500 Metric:1 UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1 [04:57:53] &#39;ip&#39; command output: eth0 [04:57:53] &#39;ip&#39; command output: tap0[04:57:53] &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;My server runs openvpn on it, and I configured it to create a bridge between the openvpn “network” and the physical network. In the process, the network interfaces are in run promiscuous mode. The only way to get rid of this warning is to disable the ‘promisc’ test. Search for &lt;code&gt;DISABLE_TESTS&lt;/code&gt;, and append promisc to the end of the list:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;DISABLE_TESTS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;suspscan hidden_procs deleted_files packet_cap_apps promisc&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;h2 id=&quot;complaints-of-hidden-directories&quot;&gt;Complaints of Hidden Directories&lt;/h2&gt; &lt;pre&gt;&lt;code&gt;[04:58:16] Checking for hidden files and directories [ Warning ] [04:58:17] Warning: Hidden directory found: /dev/.udev &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;This hidden directory (prefixed with a dot hidden, not hidden from opendir/readdir function calls) is part of how udev operates. To tell rkhunter to ignore it, search for ALLOWHIDDENDIR and uncomment or add the following line:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;ALLOWHIDDENDIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/.udev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;h2 id=&quot;disregarding-warnings-about-outdated-applications&quot;&gt;Disregarding Warnings About Outdated Applications&lt;/h2&gt; &lt;pre&gt;&lt;code&gt;[04:58:17] Checking application versions... [04:58:17] Info: Starting test name &#39;apps&#39; ... [04:58:21] Checking version of GnuPG [ Warning ] [04:58:21] Warning: Application &#39;gpg&#39;, version &#39;2.0.11&#39;, is out of date, and pos sibly a security risk. ... [04:58:25] Checking version of OpenSSH [ Warning ] [04:58:25] Warning: Application &#39;sshd&#39;, version &#39;5.2p1&#39;, is out of date, and possibly a security risk. &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;I mostly stick to Gentoo’s stable branch. This means that sometimes applications are not at the latest version. I regularly check my system for updates, and I do not need rkhunter complaining on a daily basis that these programs are outdated. To make these warnings go away, I changed the APP_WHITELIST option:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Allow the following applications, or a specific version of an application,&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# to be whitelisted. This option is a space-separated list consisting of the&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# application names. If a specific version is to be whitelisted, then the&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# name must be followed by a colon and then the version number.&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# For example: APP_WHITELIST=&amp;quot;openssl:0.9.7d gpg&amp;quot;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;APP_WHITELIST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;gpg sshd&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;My choice makes it never complain about outdated versions of gpg or sshd, although I could specify any versions I believe to be “safe.”&lt;/p&gt; &lt;h2 id=&quot;disregarding-the-kernel-module-checks&quot;&gt;Disregarding the Kernel Module Checks&lt;/h2&gt; &lt;pre&gt;&lt;code&gt;[04:57:31] Performing Linux specific checks[04:57:32] Info: Starting test name &#39;os_specific&#39; [04:57:32] Checking loaded kernel modules [ Warning ] [04:57:32] Warning: The modules file &#39;/proc/modules&#39; is missing. [04:57:32] Info: Using modules pathname of &#39;/lib/modules&#39; [04:57:33] Checking kernel module names [ Warning ] [04:57:33] Warning: The kernel modules directory &#39;/lib/modules&#39; is missing or em pty. &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;As I mentioned above, my kernel compiles in all kernel modules it uses, and I deactivated the kernel module loading interface, so it makes sense that these are giving warnings (about there being no modules). It is possible to specify an alternative location for the kernel modules directory with the MODULES_DIR configuration directive, but I have no modules. I turned these checks off the same way I turned off the promiscuous interface check – by appending them to the list of disabled tests:&lt;/p&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;DISABLE_TESTS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;suspscan hidden_procs deleted_files packet_cap_apps promisc avail_modules loaded_modules&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt; &lt;p&gt;After making the above changes in the configuration file, I ran&lt;/p&gt; &lt;pre&gt;&lt;code&gt;# rkhunter --check &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;and it no longer found any warnings.&lt;/p&gt; </description> <pubDate>Tue, 19 Jan 2010 19:27:09 -0000</pubDate> <link>https://blog.aedifice.org/2010/01/19/rkhunter-making-false-positives-go-away-on-gentoo-linux/</link> <guid isPermaLink="true">https://blog.aedifice.org/2010/01/19/rkhunter-making-false-positives-go-away-on-gentoo-linux/</guid> <category>gentoo</category> <category>linux</category> <category>rkhunter</category> <category>security</category> </item> <item> <title>Use Mac OS X&#39;s Keychain for Password Retrieval in Mutt</title> <description>&lt;p&gt;I am a fan of &lt;a href=&quot;http://www.mutt.org&quot;&gt;Mutt&lt;/a&gt;, a command line email client. It is really powerful, and it is highly customizable. Configuring it can be difficult due to having so many settings, but there are quite a few decent tutorials online for learning to configure it and any related commands.&lt;/p&gt; &lt;p&gt;Mutt used to have to rely on other programs in order to send and receive mail on a remote server. But it has been possible for a while now to use its own built-in support for POP and IMAP for receiving mail, and SMTP for sending mail. Normally, if you did not want to have to type in your password every time you connected, or if you use several different accounts, you would have to store your password(s) in your mutt configuration files in clear text. It would be nice if security storing services like Mac OS X’s Keychain, Gnome’s Keyring, or KDE’s kWallet could be used natively within Mutt, but that is not yet the case. Under Mac OS X, however, passwords can be stored in the Keychain and accessed from the command line with the &lt;code&gt;security&lt;/code&gt; command, and Mutt configuration files can call snippets of shell code that will get replaced with the output of the shell commands.&lt;/p&gt; &lt;p&gt;This article explains a basic approach on how to use the security command, and a basic way of using it in a Mutt configuration file. I may present the Ruby wrapper script that I actually use in a future article.&lt;/p&gt; &lt;!--more--&gt; &lt;h2 id=&quot;setting-up-keychain&quot;&gt;Setting up Keychain&lt;/h2&gt; &lt;p&gt;First, the password needs to be added to &lt;code&gt;login.keychain&lt;/code&gt; or another keychain file for the current user. Run &lt;code&gt;/Applications/Utilities/Keychain Access.app&lt;/code&gt;, and select &lt;strong&gt;New Password Item…&lt;/strong&gt; from the &lt;strong&gt;File&lt;/strong&gt; menu. This will bring up a dialog where the account info and password can be filled in.&lt;/p&gt; &lt;figure class=&quot;centered-image&quot;&gt; &lt;img src=&quot;/files/1-new-keychain-item.png&quot; alt=&quot;The &#39;New Password Item&#39; dialog&quot; title=&quot;The &#39;New Password Item&#39; dialog&quot; /&gt; &lt;figcaption&gt;The &#39;New Password Item&#39; dialog&lt;/figcaption&gt; &lt;/figure&gt; &lt;p&gt;The protocol and server name should be filled in using URL syntax, such as &lt;code&gt;imap://imap.someserver.com&lt;/code&gt;. Don’t worry about whether the server uses the SSL/TLS variation of the email network protocols or not because we will configure that in Mutt based on the protocols used. The protocol and server name are needed to look up the password in the keychain database.&lt;/p&gt; &lt;p&gt;Next, verify that the Keychain item is correctly filled out:&lt;/p&gt; &lt;figure class=&quot;centered-image&quot;&gt; &lt;img src=&quot;/files/2-examine-the-created-item.png&quot; alt=&quot;The new Keychain item&quot; title=&quot;The new Keychain item&quot; /&gt; &lt;figcaption&gt;The new Keychain item&lt;/figcaption&gt; &lt;/figure&gt; &lt;h2 id=&quot;security-command-basics&quot;&gt;&lt;code&gt;security&lt;/code&gt; Command Basics&lt;/h2&gt; &lt;p&gt;According to its man page, &lt;a href=&quot;http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/security.1.html&quot;&gt;&lt;code&gt;security&lt;/code&gt;&lt;/a&gt; is a “command line interface to keychains and Security.framework.” It provides a crude way to look up Keychain entries. Like most of Apple’s command line tools, it provides several actions that can be performed, but the one useful here is &lt;code&gt;find-internet-password&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;A query will look something like:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;$ security find-internet-password -g -a someuser@example.com -s imap.example.com &lt;/code&gt;&lt;/pre&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;-g&lt;/strong&gt; makes it output the password to stderr, in addition to the normal info to stdout&lt;/li&gt; &lt;li&gt;&lt;strong&gt;-a&lt;/strong&gt; is the account name to look up&lt;/li&gt; &lt;li&gt;&lt;strong&gt;-s&lt;/strong&gt; is the server name to lookup&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;There are other options that can be used to look up a Keychain entry, but the above two are sufficient for most needs (see the man page for more options).&lt;/p&gt; &lt;p&gt;The first time security is run, the Mac OS will ask whether to allow &lt;code&gt;security&lt;/code&gt; access the queried password or not. If it is allowed to do so once (in which case every time it access a given entry it will have to be granted permission once) or always, it will print something like the following:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;keychain: &quot;/Users/someuser/Library/Keychains/login.keychain&quot; class: &quot;teni&quot; attributes: 0x00000007 &amp;lt;blob&amp;gt;=&quot;imap.example.com&quot; 0x00000008 &amp;lt;blob&amp;gt;=&amp;lt;NULL&amp;gt; &quot;acct&quot;&amp;lt;blob&amp;gt;=&quot;someuser@example.com&quot; &quot;atyp&quot;&amp;lt;blob&amp;gt;=&quot;dflt&quot; &quot;cdat&quot;&amp;lt;timedate&amp;gt;=0x32303039313031393030303330305A00 &quot;20091019000300Z\000&quot; &quot;crtr&quot;&amp;lt;uint32&amp;gt;=&amp;lt;NULL&amp;gt; &quot;cusi&quot;&amp;lt;sint32&amp;gt;=&amp;lt;NULL&amp;gt; &quot;desc&quot;&amp;lt;blob&amp;gt;=&amp;lt;NULL&amp;gt; &quot;icmt&quot;&amp;lt;blob&amp;gt;=&amp;lt;NULL&amp;gt; &quot;invi&quot;&amp;lt;sint32&amp;gt;=&amp;lt;NULL&amp;gt; &quot;mdat&quot;&amp;lt;timedate&amp;gt;=0x32303039313031393030303330305A00 &quot;20091019000300Z\000&quot; &quot;nega&quot;&amp;lt;sint32&amp;gt;=&amp;lt;NULL&amp;gt; &quot;path&quot;&amp;lt;blob&amp;gt;=&amp;lt;NULL&amp;gt; &quot;port&quot;&amp;lt;uint32&amp;gt;=0x00000000 &quot;prot&quot;&amp;lt;blob&amp;gt;=&amp;lt;NULL&amp;gt; &quot;ptcl&quot;&amp;lt;uint32&amp;gt;=&quot;imap&quot; &quot;scrp&quot;&amp;lt;sint32&amp;gt;=&amp;lt;NULL&amp;gt; &quot;sdmn&quot;&amp;lt;blob&amp;gt;=&amp;lt;NULL&amp;gt; &quot;srvr&quot;&amp;lt;blob&amp;gt;=&quot;imap.example.com&quot; &quot;type&quot;&amp;lt;uint32&amp;gt;=&amp;lt;NULL&amp;gt; password: &quot;somepassword&quot; &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Make sure it is finding the correct password. If there is more than one entry for the same domain/account pair, the service type may need to be specified, or one of the found entries should be renamed or removed from the Keychain.&lt;/p&gt; &lt;h2 id=&quot;getting-just-the-password&quot;&gt;Getting Just the Password&lt;/h2&gt; &lt;p&gt;The only part of the output that is desired is the password itself. Sed, awk, or grep could be used, but perl will be used here to make it so that the only text on stdout is the password itself.&lt;/p&gt; &lt;pre&gt;&lt;code&gt;security find-internet-password -g -a someuser@example.com -s imap.example.com 2&amp;gt;&amp;amp;1\ | perl -e &#39;if (&amp;lt;STDIN&amp;gt; =~ m/password: &quot;(.*)&quot;$/ ) { print $1; }&#39; &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;This could be put directly into a Mutt configuration file, or it could be put in a script.&lt;/p&gt; &lt;h2 id=&quot;incorporating-it-into-mutt&quot;&gt;Incorporating it into Mutt&lt;/h2&gt; &lt;p&gt;For a simple single account muttrc file, one could do the following:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;set smtp_user=&quot;someuser@example.com&quot; set smtp_pass=`security find-internet-password -g -a someuser@example.com -s imap.example.com 2&amp;gt;&amp;amp;1 | perl -e &#39;if (&amp;lt;STDIN&amp;gt; =~ m/password: &quot;(.*)&quot;$/ ) { print $1; }&#39;` set imap_user=&quot;someuser@example.com&quot; set imap_pass=`security find-internet-password -g -a someuser@example.com -s imap.example.com 2&amp;gt;&amp;amp;1 | perl -e &#39;if (&amp;lt;STDIN&amp;gt; =~ m/password: &quot;(.*)&quot;$/ ) { print $1; }&#39;` &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Or to reduce the number of times security gets called:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;set my_pass=`security find-internet-password -g -a someuser@example.com -s imap.example.com 2&amp;gt;&amp;amp;1 | perl -e &#39;if (&amp;lt;STDIN&amp;gt; =~ m/password: &quot;(.*)&quot;$/ ) { print $1; }&#39;` set smtp_user=&quot;someuser@example.com&quot; set smtp_pass=$my_pass set imap_user=&quot;someuser@example.com&quot; set imap_pass=$my_pass &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;And that’s it. I actually use a Ruby wrapper around security, which uses a lockfile to prevent multiple instances of &lt;code&gt;security&lt;/code&gt; from asking to unlock the keychain at the same time (I also use offlineimap, which calls the same script for the passwords). I may publish that script at some point.&lt;/p&gt; </description> <pubDate>Sun, 18 Oct 2009 21:31:04 -0000</pubDate> <link>https://blog.aedifice.org/2009/10/18/use-mac-os-xs-keychain-for-password-retrieval-in-mutt/</link> <guid isPermaLink="true">https://blog.aedifice.org/2009/10/18/use-mac-os-xs-keychain-for-password-retrieval-in-mutt/</guid> <category>macosx</category> <category>mutt</category> <category>email</category> <category>keychain</category> </item> <item> <title>Converting Rails Applications from MySQL to PostgreSQL</title> <description>&lt;p&gt;&lt;strong&gt;Update (2009/09/14):&lt;/strong&gt; There is a much better article on doing this conversion &lt;a href=&quot;http://www.nopugs.com/2009/01/04/how-to-migrate-typo-from-mysql-to-postgresql&quot;&gt;here&lt;/a&gt; that is specific to migrating Typo from MySQL to PostgreSQL. I will admit that I have not tried using that article’s boolean conversion method.&lt;/p&gt; &lt;p&gt;I recently decided to give &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; a try after learning about some of the oddities of MySQL, plus it gave me an opportunity to see what was necessary to convert between two RDBMs. I installed PostgreSQL 8.3.7, which is the most recent version currently in the main Gentoo Portage tree, using the &lt;a href=&quot;http://en.gentoo-wiki.com/wiki/PostgreSQL&quot;&gt;Gentoo Wiki guide&lt;/a&gt;. Rather than explain the details of setting up and using PostgreSQL, I’ll explain what I did to convert my Redmine and Typo instances. (The following assumes some familiarity with how to use Rails, MySQL, and PostgreSQL command line commands. See their man pages as well for other options that you may want/need to use)&lt;/p&gt; &lt;!--more--&gt; &lt;h2 id=&quot;dumping-the-database&quot;&gt;Dumping the Database&lt;/h2&gt; &lt;p&gt;At first I tried to use a &lt;a href=&quot;http://myutil.com/2008/8/31/rake-task-transfer-rails-database-mysql-to-postgres&quot;&gt;rake task&lt;/a&gt;to convert my redmine database, but it would fail because ActiveRecord can’t really treat join tables as ActiveRecord types. The PostgreSQL connector code wanted to generate a SQL statement that would return the value id, which ActiveRecord decided was the nonexistent primary key for the table. I was able to modify ActiveRecord to get around this, but the rake task was not loading the repository sub-types either.&lt;/p&gt; &lt;p&gt;Instead, I decided to try and convert it the “old fashioned” way: dumping sql code, editing it, and importing it. Note that I was using MySQL 5.0.70, and the options may not be available in older versions of MySQL. After shutting down all processes that might access the database, run&lt;/p&gt; &lt;pre&gt;&lt;code&gt;mysql -uroot --no-create-info --compatible=postgresql \ --complete-insert redmine &amp;gt; redminedump.sql &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;--no-create-info&lt;/code&gt; tells mysqldump to not print schema information. We will use Rails’ own migration functionality instead to recreate the schema in a manner that takes more advantage of PostgreSQL. &lt;code&gt;--compatible=postgresql&lt;/code&gt; makes mysqldump produce SQL code with quotes that are more ANSI compliant, and it produces dates and times in a format that PostgreSQL seems to like. Finally, &lt;code&gt;--complete-insert&lt;/code&gt; makes the INSERT statements in the dump include column names for the insertions.&lt;/p&gt; &lt;h2 id=&quot;preparing-the-dump-for-import&quot;&gt;Preparing the Dump for Import&lt;/h2&gt; &lt;p&gt;If you tried to just import the dump into psql now, psql would report a multitude of errors. What follows are the ones I ran into, and how I got around them.&lt;/p&gt; &lt;h3 id=&quot;lock-and-unlock-lines&quot;&gt;LOCK and UNLOCK Lines&lt;/h3&gt; &lt;p&gt;First off, psql does not like the &lt;code&gt;LOCK&lt;/code&gt; and &lt;code&gt;UNLOCK&lt;/code&gt; statements in the dump. You can safely remove these lines. I zeroed out their lines in vim with&lt;/p&gt; &lt;pre&gt;&lt;code&gt;:%s/^\(UN\)\?LOCK.*$//g &lt;/code&gt;&lt;/pre&gt; &lt;h3 id=&quot;boolean-field-types&quot;&gt;boolean Field Types&lt;/h3&gt; &lt;p&gt;The second type of error I received was about boolean fields:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;ERROR: column &quot;is_default&quot; is of type boolean but expression is of type integer LINE 1: ... &quot;enumerations&quot; (&quot;id&quot;, &quot;opt&quot;, &quot;name&quot;, &quot;position&quot;, &quot;is_defaul... ^ HINT: You will need to rewrite or cast the expression. &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The equivalent fields in MySQL appear to be stored as integer types (&lt;code&gt;1&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt;), but PostgreSQL prefers &lt;code&gt;TRUE&lt;/code&gt; and &lt;code&gt;FALSE&lt;/code&gt; for its boolean values – although it accepts &lt;code&gt;&#39;1&#39;&lt;/code&gt; and &lt;code&gt;&#39;0&#39;&lt;/code&gt;. Run&lt;/p&gt; &lt;pre&gt;&lt;code&gt;pg_dump -U postgres -s redmine &amp;gt; redmine_schema.sql &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;and look for the name of all boolean-type fields that would need to be changed. Then, back in the dump, carefully go through and quoted the correct 1’s and 0’s for each inserted row.&lt;/p&gt; &lt;h3 id=&quot;possible-pitfalls&quot;&gt;Possible Pitfalls&lt;/h3&gt; &lt;p&gt;I ran into a confusing snag after I edited and imported my dump. Some serialized fields could not be converted into arrays. After tracking down this problem for a while, I discovered that extra newlines were being introduced to some of the serialized objects’ text fields. It turns out, I accidentally let vim hard wrap lines in the middle of quoted strings in the dump file.&lt;/p&gt; &lt;h2 id=&quot;importing-the-dump&quot;&gt;Importing the Dump&lt;/h2&gt; &lt;p&gt;Once your rails application is set up to access a PostgreSQL database, set up the new database’s schema:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;rake db:schema:load RAILS_ENV=&quot;production&quot; &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;After the schema and migrations have completed (I recommend verifying that the all the tables’ definitions are in place using something like pgAdmin3), it is finally time to import the dump:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;psql -U postgres redmine &amp;lt; redminedump.sql &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;If the changes I mentioned above were made, there will still be one ERROR amongst dozens of warnings:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;ERROR: duplicate key value violates unique constraint &quot;unique_schema_migrations&quot; &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The &lt;code&gt;schema_migrations&lt;/code&gt; table stores the number of each migration run on the database, and this error can be ignored. If you want to avoid this error, you could delete the INSERT lines that cause it from the dump.&lt;/p&gt; &lt;h3 id=&quot;fixing-the-id-sequences&quot;&gt;Fixing the &lt;code&gt;id&lt;/code&gt; Sequences&lt;/h3&gt; &lt;p&gt;We are almost, but not yet done. The primary key in most ActiveRecord–managed tables is the “id” column, and each row in a table is supposed to have a unique entry. PosgreSQL uses sequences to increment this value for each new table entry, and the sequences need to be set to at least the highest numbered value they are associated with (a table with no entries can have its sequence be set to the default of 1). I used pgAdmin3 to inspect the contents of each table, and to then set the corresponding sequence’s current value, but this could also be done with some clever SQL code.&lt;/p&gt; &lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt; &lt;p&gt;There were dozens of WARNINGs about “nonstandard use of escape in a string literal”, but they did not affect psql’s ability to correctly fill in its own tables.&lt;/p&gt; &lt;p&gt;At this point, you should take one last look over the data with some queries or pgAdmin3, looking for anything that might of gone wrong. After that, launch your rails application, and verify that it can still run.&lt;/p&gt; </description> <pubDate>Tue, 08 Sep 2009 02:25:00 -0000</pubDate> <link>https://blog.aedifice.org/2009/09/08/converting-rails-applications-from-mysql-to-postgresql/</link> <guid isPermaLink="true">https://blog.aedifice.org/2009/09/08/converting-rails-applications-from-mysql-to-postgresql/</guid> <category>rails</category> <category>mysql</category> <category>postgresql</category> </item> <item> <title>Apache Worker MPM and RLIMIT_NPROC Resource Limit</title> <description>&lt;p&gt;I decided to give Apache 2.2’s &lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/worker.html&quot;&gt;worker mpm&lt;/a&gt; a try (a couple processes that each have many threads rather than the default &lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/prefork.html&quot;&gt;prefork&lt;/a&gt;’s several processes that each handle a single thread), but I was having the Apache root process exit because its children were disappearing. Sometimes this would happen immediately after launching Apache, other times it would happen after I tried to access a web page. I tracked the problem down to being an issue with apache hitting the process limit for a given user. However, modifying limits.conf for the apache user did not solve the problem because the apache server inherits root’s limits on start up rather than referring to limits.conf.&lt;/p&gt; &lt;!--more--&gt; &lt;h2 id=&quot;the-initial-problem&quot;&gt;The Initial Problem&lt;/h2&gt; &lt;p&gt;After relaunching Apache, its processes would sometimes disappear immediately. Its error log contained (apache2/error_log):&lt;/p&gt; &lt;pre&gt;&lt;code&gt;[Sat Jul 11 00:32:42 2009] [notice] Apache/2.2.11 (Unix) configured -- resuming normal operations [Sat Jul 11 00:32:42 2009] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread [Sat Jul 11 00:32:44 2009] [alert] No active workers found... Apache is exiting! &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;I run gentoo’s hardened kernel with grsecurity’s logging active, so I also checked my grsecurity kernel log:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;Jul 11 00:32:42 ouroboros grsec: From 71.202.174.186: denied resource overstep by requesting 32 for RLIMIT_NPROC against limit 32 for /usr/sbin/apache2[apache2:14547] uid/euid:81/81 gid/egid:81/81, parent /usr/sbin/apache2[apache2:14543] uid/euid:0/0 gid/egid:0/0 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;It appears that the number of processes resource limit for a given user applies to threads in Linux, and not just processes. By default, the worker mpm creates two worker processes with up to 25 worker threads each. Each process also has a thread for communicating with the parent process to handle incoming requests. This means there are can be 52 threads created for the &lt;code&gt;apache&lt;/code&gt; user. The default limit of 32 processes per user was apparently getting exceeded when the threads were created, leading to the worker processes exiting and disappearing.&lt;/p&gt; &lt;h2 id=&quot;attempting-to-use-limitsconf&quot;&gt;Attempting to Use limits.conf&lt;/h2&gt; &lt;p&gt;First, I tried to increase the &lt;code&gt;apache&lt;/code&gt; user’s limits in limits.conf:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;* hard nproc 32 apache hard nproc 100 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;However, limits.conf is only referenced by the &lt;a href=&quot;http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_limits.html&quot;&gt;pam_limits.so&lt;/a&gt; module of &lt;a href=&quot;http://www.kernel.org/pub/linux/libs/pam/&quot;&gt;PAM&lt;/a&gt;, meaning that PAM would have to run at some point before or during the start up of the apache server to set its resource limits. Many services on Gentoo Linux use the start-stop-daemon, which supposedly &lt;a href=&quot;http://bugs.gentoo.org/show_bug.cgi?id=64700&quot;&gt;received PAM support in baselayout 1.13&lt;/a&gt;, but 1.13 is not in portage. The final version of baselayout 1 is 1.12 on Gentoo, with 2.0 being the next unstable version. Also, the apache2 startup script only calls apache2ctl and never uses start-stop-daemon, meaning that even if this feature were in the stable baselayout, limits.conf is not a normal option&lt;/p&gt; &lt;h2 id=&quot;the-final-solution&quot;&gt;The Final Solution&lt;/h2&gt; &lt;p&gt;My final solution was to specify the limit in the configuration file for the startup script. At the bottom of /etc/conf.d/apache2, which is just a shell script file that gets sourced for /etc/init.d/apache2, I added&lt;/p&gt; &lt;pre&gt;&lt;code&gt;ulimit -u 100 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;This line calls bash’s ulimit command and sets the maximum number of processes to 100, which allowed apache to have its threads without crashing.&lt;/p&gt; </description> <pubDate>Tue, 14 Jul 2009 01:04:49 -0000</pubDate> <link>https://blog.aedifice.org/2009/07/14/apache-worker-mpm-and-rlimit_nproc-resource-limit/</link> <guid isPermaLink="true">https://blog.aedifice.org/2009/07/14/apache-worker-mpm-and-rlimit_nproc-resource-limit/</guid> <category>apache</category> </item> </channel> </rss>