<?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>Solutions Log &#187; Security</title> <atom:link href="http://solutions.unixsherpa.com/category/security/feed/" rel="self" type="application/rss+xml" /><link>http://solutions.unixsherpa.com</link> <description>by Dan Reiland</description> <lastBuildDate>Tue, 05 Apr 2011 16:42:14 +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>xinetd per_source limit issues</title><link>http://solutions.unixsherpa.com/2010/02/09/xinetd-per_source-limit-issues/</link> <comments>http://solutions.unixsherpa.com/2010/02/09/xinetd-per_source-limit-issues/#comments</comments> <pubDate>Tue, 09 Feb 2010 09:32:34 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[xinetd]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=241</guid> <description><![CDATA[Issue: Users note availability issues when accessing services backed by xinetd (subversion, rsync, etc.) Identification: Syslog on the affected server will present multiple lines containing daemon per_source_limit for 0.0.0.0. Cause: You have exceeded per_source_limit defaults imposed by your xinetd configuration. Many distributions include per_source limits that may not be suitable for your use case. Evaluate [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> Users note availability issues when accessing services backed by xinetd (subversion, rsync, etc.)</p><p><strong>Identification:</strong><br
/> Syslog on the affected server will present multiple lines containing <code
class="codecolorer text twitlight"><span
class="text">daemon per_source_limit for 0.0.0.0</span></code>.</p><p><strong>Cause:</strong><br
/> You have exceeded per_source_limit defaults imposed by your xinetd configuration. Many distributions include per_source limits that may not be suitable for your use case. Evaluate your needs carefully.</p><p><strong>Resolution:</strong><br
/> Modify the default setting for per_source in <code
class="codecolorer text twitlight"><span
class="text">/etc/xinetd.conf</span></code> or modify the service specific configuration (recommended) under <code
class="codecolorer text twitlight"><span
class="text">/etc/xinet.d</span></code>. per_source limits may be set as follows:</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">per_source = 10</div></div><p>per_source may be set to an integer or UNLIMITED (the number represents the number of connections allowed per host). A sensible fixed value is <strong>always</strong> better than UNLIMITED.</p><p><em>Reference:</em> xinetd.conf(5)</p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2010/02/09/xinetd-per_source-limit-issues/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Cannot SSH into PIX/ASA firewall</title><link>http://solutions.unixsherpa.com/2009/07/09/cannot-ssh-into-pixasa-firewall/</link> <comments>http://solutions.unixsherpa.com/2009/07/09/cannot-ssh-into-pixasa-firewall/#comments</comments> <pubDate>Fri, 10 Jul 2009 03:33:19 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Hardware]]></category> <category><![CDATA[Networking]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[sysadmin]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=143</guid> <description><![CDATA[Issue: When attempting to SSH into a PIX/ASA firewall you receive the following error on the client ssh_exchange_identification: Connection closed by remote host Investigating the log on the PIX/ASA will yield a corresponding error: Fail to establish SSH session because RSA host key retrieval failed. Cause: The issue is the result of a corrupt or [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> When attempting to SSH into a PIX/ASA firewall you receive the following error on the client</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh_exchange_identification: Connection closed by remote host</div></div><p>Investigating the log on the PIX/ASA will yield a corresponding error:</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Fail to establish SSH session because RSA host key retrieval failed.</div></div><p> <strong>Cause:</strong><br
/> The issue is the result of a corrupt or missing RSA key on the firewall.<br
/> <br
/> <strong>Resolution:</strong><br
/> You need to generate a new RSA key on the firewall.<br
/> <br
/> Magic juju (from either SDM or a prompt):</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">conf t<br
/> ca generate rsa key 1024<br
/> wr mem<br
/> copy run start</div></div> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/07/09/cannot-ssh-into-pixasa-firewall/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Amanda amlabel CURL error: SSL certificate problem when using S3 buckets under Gentoo for backup</title><link>http://solutions.unixsherpa.com/2009/07/07/amanda-amlabel-curl-error-ssl-certificate-problem-when-using-s3-buckets-under-gentoo-for-backup/</link> <comments>http://solutions.unixsherpa.com/2009/07/07/amanda-amlabel-curl-error-ssl-certificate-problem-when-using-s3-buckets-under-gentoo-for-backup/#comments</comments> <pubDate>Tue, 07 Jul 2009 20:17:45 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Amazon S3]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[certificates]]></category> <category><![CDATA[curl]]></category> <category><![CDATA[gentoo]]></category> <category><![CDATA[s3]]></category> <category><![CDATA[ssl]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=121</guid> <description><![CDATA[This one was fun. Issue: The error presented when attempting to label S3 buckets for use by Amanda in a virtual tape changer configuration. The OS is Linux and the distribution, Gentoo. The exact error encountered was labeling tape in slot 1 (s3:myBucket/backupSet/0001/): Reading label... While trying to read tapestart header: CURL error: SSL certificate [...]]]></description> <content:encoded><![CDATA[<p>This one was fun.</p><p><strong>Issue:</strong><br
/> The error presented when attempting to label S3 buckets for use by Amanda in a virtual tape changer configuration. The OS is Linux and the distribution, Gentoo.</p><p>The exact error encountered was</p><pre>
labeling tape in slot 1 (s3:myBucket/backupSet/0001/):
Reading label...
While trying to read tapestart header: CURL error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (CURLcode 60)
Reading the tape label failed:
  Error was Device error.
</pre><p><strong>Cause:</strong><br
/> The error is related to curl's desire to perform peer SSL certificate verification as a default. This is a "good thing" and requires minimal intervention to work around once an admin is aware of the issue.<br
/> Reference:<br
/> <a
href="http://curl.haxx.se/docs/sslcerts.html">http://curl.haxx.se/docs/sslcerts.html</a></p><p><strong>Resolution:</strong><br
/> Gentoo centralizes a collection of CA certificate PEM files with the app-misc/ca-certificates package in portage. This should be installed as part of a normal Gentoo system, however, it is possible that a particular CA PEM may be absent. In this case, download the missing PEM file and place it in /etc/ssl/certs. Once this is done be sure to run the following command to update the local system certificate store:</p><pre>
update-ca-certificates
</pre><p>Tools for extracting Common CA PEM files from Mozilla projects and a standard PEM bundle can be found at: <a
href="http://curl.haxx.se/docs/caextract.html">http://curl.haxx.se/docs/caextract.html</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/07/07/amanda-amlabel-curl-error-ssl-certificate-problem-when-using-s3-buckets-under-gentoo-for-backup/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Setting up hosts.allow</title><link>http://solutions.unixsherpa.com/2009/07/02/setting-up-hosts-allow/</link> <comments>http://solutions.unixsherpa.com/2009/07/02/setting-up-hosts-allow/#comments</comments> <pubDate>Thu, 02 Jul 2009 19:26:49 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Apple OSX]]></category> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networking]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Solaris]]></category> <category><![CDATA[sysadmin]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=116</guid> <description><![CDATA[Setting Up "hosts.allow" File Syntax The syntax of /etc/hosts.allow is actually quite simple and easy to understand, unlike, say, sendmail.cf or the scattered nature of qmail. Most of the rules and settings are used in the following form: service : host/network : option [: option] ... where: service The name of the dæmon or service [...]]]></description> <content:encoded><![CDATA[<p>Setting Up "hosts.allow"<br
/> File Syntax</p><p>The syntax of /etc/hosts.allow is actually quite simple and easy to understand, unlike, say, sendmail.cf or the scattered nature of qmail. Most of the rules and settings are used in the following form:</p><p> service : host/network : option [: option] ...</p><p>where:</p><p>service<br
/> The name of the dæmon or service program that rule will be written for. Examples include popa3d, imapd, and sshd. You can also use the ALL wild card to cover all services and dæmons.<br
/> host/network<br
/> The host or network that the rule will apply to. You can use the any of the following notations to best suit your needs.</p><p> * IP Address: 10.4.2.5 or 172.16.7.4<br
/> * IP Class A/B/C Subnet: 10.4. or 172.16.7.<br
/> * IP Network with Subnet Mask: 10.4.0.0/255.255.0.0 or 172.16.7.0/255.255.255.0<br
/> * IPv6 Addresses: [2f3f::]/10 or [4c20:fe37:1:1::]/64<br
/> * Fully Qualified Domain Name: foo.insecure.net or bad.hairday.insecure.net<br
/> * Domain Name: insecure.net or hairday.insecure.net<br
/> * Relative Hostname: foo or bad<br
/> * Wild Cards: Wild card optionss that can be used are:<br
/> o ALL: All clients regardless of IP address or domain name.<br
/> o PARANOID: Clients that have hostnames that don't match its ident/domain lookup names. This does not apply to machines that do not have any reverse domain lookup names.<br
/> o LOCAL: A client that comes from the same machine or domain as the host.<br
/> o UNKNOWN: A client that cannot be resolved to anything known.<br
/> o KNOWN: A client who's name and addresses can be resolved.</p><p>option<br
/> A command or an option telling it how to treat the connection request. In majority of the cases, you will see or use allow or deny for the command. spawn or twist commands can also be used to send a customized error to the requester or send an alert to the administrator. Some of the most commonly used options will be covered a bit later in this article.</p><p>Options</p><p>The option field for each of the rules provides the basic allow and deny directives, plus several other options that allow you to customize how it logs the connection attempt (via syslog or e-mail), run a system command and other options that control the connection. Below are the most common options that you may use in /etc/hosts.allow and how they affect the connection.</p><p>allow<br
/> As the name implies, it simply lets the connection through; this option must be at the end of a rule.<br
/> deny<br
/> Denies the connection without providing the requester any chance to try again. All denied connections are logged to syslog with the service and host that the deny rule matched.<br
/> spawn (command(s))<br
/> Generates a new process that will run the command(s) given, but the spawn commands themselves will not allow or deny the connection, so you must have either " : allow" or " : deny" at the end of the rule in order to make the rule truly effective.<br
/> twist command(s)<br
/> Like spawn, it will create a new process to allow you to run the necessary commands, with the common standard input, output and error objects are linked to the twist option. This option can be used to print out a customized message when someone tries to connect to a service like ftpd. Instead of allowing or denying the connection immediately, the twist commands determine if the requester should be let through or not. A twist option followed by only an echo command will send the echo'd text to the client and closes the connection.<br
/> rfc931 [timeout]<br
/> This option does a username lookup of the requester via ident, and checks to see if the username and the information povided by the requester match up. The timeout option is used to limit the amount of time that the machine will wait to receive a ident response.<br
/> nice [priority]<br
/> Like the nice in BSD, this option allows you to change a process' priority; thus provides means to limit how much processor a guest or a not-quite-so-trusting client can use.<br
/> banner /dir/path<br
/> This option searches for a file named after the specified service in /dir/path, reads in the contents, resolves expansions (a list of expansions can be found in hosts_access(5) manual page. This option is valid only for TCP services and dæmons, not for UDP services.</p><p>Comments in the /etc/hosts.allow are very similar to shell scripts where each comment line starts with a hash mark (#) and extends to the end of the line. There is one significant difference in how comments are handled in hosts.allow and shell scripts is that comments are not allowed after a rule. The following example shows valid uses of comments in the file.</p><p> # this is a valid comment<br
/> portmap : 1.2.3.4 : deny<br
/> # so is this</p><p> sshd : 9.8.7.6 : deny	# but not this one</p><p>Tightening Down Your Services</p><p>Once you understand the syntax of setting up access controls and options, you are now ready to write your own hosts.allow file. Without the use of deny rules all running TCP-wrapped services or enabled in inetd will be wide open until you explicitly. The example below allows shows some of the possible ways to configure the hosts.allow file.</p><p> portmap : localhost : allow<br
/> portmap : 10. : allow<br
/> portmap : .insecure.net : allow<br
/> portmap : ALL : deny</p><p> sshd : ALL : allow<br
/> sshd : bad.host : deny<br
/> sshd : 88.4.2. : deny (1)</p><p> ALL : ALL : deny</p><p>Taking a look at the portmap section of the configuration, we are allowing localhost, any machines with an IP address starting with 10. and any machines that have .insecure.net for a domain name or ident name. All other machines and hosts are disallowed. If you do not include localhost in a rulset, you will lock the host out which may or may not be a good thing.</p><p>The sshd section states that all machines are allowed at first, but then blocks any machine with the relative hostname of bad.host or any machines with an IP address starting with 88.4.2 (1). The last rule in the configuration pretty does what it says, which is to deny all machines access to the other "tcp wrapped" services and dæmons that do not have any explicit rules stating otherwise. If you want to allow all hosts to the other services without intervention, replace the last line with:</p><p> ALL : ALL : allow</p><p>If you do include a rule that denies all hosts access to a particular service and forget to include the localhost or management hosts, you may end up inadvertantly lock yourself (and others) out. If you setup a rule that allows all hosts to use a service and deny specific hosts, you may still leave yourself open to other untrusted hosts. To limit such exposures, check /etc/inetd.conf for any services that are enabled but really do not need to be enabled, and disable them. One perfect example on restricting access to services that are known to be inherently insecure is to only allow clients from the internal network access to the telnet dæmon (telnetd).<br
/> Words Of Caution</p><p>No matter how tempting it is to setup a rule that says</p><p> ALL : ALL : deny</p><p>at the very top if the hosts.allow file, DO NOT DO IT!. The access control facility takes each rule literally, meaning that it will see that rule and deny the connection before going through the rest of the rules. The same applies to denying access to all hosts to a particular service first, then allowing the trusted hosts; the deny rule will be enacted upon and the connection is rejected. For example, a bad way of writing a ruleset would be:</p><p> sshd : ALL : deny<br
/> sshd : localhost : allow<br
/> sshd : 10.0.3. : allow</p><p>Instead, re-write the ruleset to be:</p><p> ssh : 10.0.3. : allow<br
/> ssh : localhost : allow<br
/> ssh : ALL : deny</p><p>That way, the hosts that should be allowed will be allowed through, the rest will fail the first two rules and then finally gets denied when it reaches the deny rule.</p><p>If you write any rules that use domain or hostnames for the second field, you could be denying access to hosts that do have a valid reverse domain lookup name (this includes IP addresses that do not have any PTR records setup on the domain name server that is responsible for that subnet) or do not have any ident dæmons running, if you do not include any allow rules for them before a ": ALL : deny" rule. Instead, you may want to allow specific subnets or IP address ranges to allow access to those services.<br
/> Other Notes</p><p>Any changes that are made to /etc/hosts.allow take effect immediately (there is no need to restart inetd or restart the network services). There are some options that will only work with TCP services or cause problems when used with UDP services. Some of the caveats and warnings are documented in both hosts_access(5) and hosts_options(5) manual pages. By using rules to allow or deny connections, each connection made to the host requires some additional overhead to check the validity of the client information and to compare that information with each of the applicable rules. Depending on the average load on the host, number of connection attempted in a given time, and the available resources, using hosts.allow may not be a viable option.</p><p>Some services or dæmons provide more detailed facilities to allow or deny connections based on IP address, domain name and other criteria that could be easier to configure than what is possible with hosts.allow. In addition, hosts.allow cannot act as a filter for malicious code or application level denial-of-service attacks (like the file-globbing exploit in earlier versions of ProFTPD or a man-in-the-middle attack with ssh).<br
/> Conclusion</p><p>hosts.allow is quite an interesting and useful facility that can help increase the security of the host, but typos and poorly written rules can make the host as or more susceptable to exploits than without those rules. Typos could also end up locking yourself out of the box when you least expect it. As stated above, using the access control facility for "tcp wrapped" services and dæmons can and probably will take a hit on the host's performance and possibly limit the response rate for the client.</p><p>The facility is not a complete security solution nor should it be treated as such, rather it's a compliment to packet filtering and firewall solutions available (be it gratis, free-speech or commercial). There are some features that are available only by using the hosts.allow facility such as redirecting specific clients to other services, or returning specific error messages, and banners specific to the service and/or client. Nonetheless, this is a great facility that some people overlook as a method to provide a simple means to deny access to specific servies to specific hosts.</p><p>Reference: <a
href="http://closedsrc.org/_static/dn-articles/hosts_allow.html">http://closedsrc.org/_static/dn-articles/hosts_allow.html</a></p><p><strong>Note:</strong><br
/> If the last line of a hosts access file is not a newline character (created by pressing the Enter key), the last rule in the file fails and an error is logged to either /var/log/messages or /var/log/secure. This is also the case for a rule that spans multiple lines without using the backslash. The following example illustrates the relevant portion of a log message for a rule failure due to either of these circumstances:</p><pre>
 warning: /etc/hosts.allow, line 20: missing newline or line too long
</pre><p>Reference: <a
href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/Reference_Guide/s1-tcpwrappers-access.html">http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/Reference_Guide/s1-tcpwrappers-access.html</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/07/02/setting-up-hosts-allow/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Amazon EC2 Subnets</title><link>http://solutions.unixsherpa.com/2009/05/09/amazon-ec2-subnets/</link> <comments>http://solutions.unixsherpa.com/2009/05/09/amazon-ec2-subnets/#comments</comments> <pubDate>Sat, 09 May 2009 14:31:30 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Amazon EC2]]></category> <category><![CDATA[Networking]]></category> <category><![CDATA[Security]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=84</guid> <description><![CDATA[216.182.224.0/20 (216.182.224.0 - 216.182.239.255) [US] 72.44.32.0/19 (72.44.32.0 - 72.44.63.255) [US] 67.202.0.0/18 (67.202.0.0 - 67.202.63.255) [US] 75.101.128.0/17 (75.101.128.0 - 75.101.255.255) [US] 174.129.0.0/16 (174.129.0.0 - 174.129.255.255) [US] 79.125.0.0/18 (79.125.0.0 - 79.125.63.255) [EU] References: http://developer.amazonwebservices.com/connect/thread.jspa?messageID=51028&#51028 http://developer.amazonwebservices.com/connect/message.jspa?messageID=107770]]></description> <content:encoded><![CDATA[<p>216.182.224.0/20 (216.182.224.0 - 216.182.239.255) [US]<br
/> 72.44.32.0/19 (72.44.32.0 - 72.44.63.255) [US]<br
/> 67.202.0.0/18 (67.202.0.0 - 67.202.63.255) [US]<br
/> 75.101.128.0/17 (75.101.128.0 - 75.101.255.255) [US]<br
/> 174.129.0.0/16 (174.129.0.0 - 174.129.255.255) [US]<br
/> 79.125.0.0/18 (79.125.0.0 - 79.125.63.255) [EU]</p><p>References:<br
/> <a
href="http://developer.amazonwebservices.com/connect/thread.jspa?messageID=51028&#51028">http://developer.amazonwebservices.com/connect/thread.jspa?messageID=51028&#51028</a><br
/> <a
href="http://developer.amazonwebservices.com/connect/message.jspa?messageID=107770">http://developer.amazonwebservices.com/connect/message.jspa?messageID=107770</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/05/09/amazon-ec2-subnets/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 1/19 queries in 0.003 seconds using memcached
Object Caching 845/866 objects using memcached
Content Delivery Network via Amazon Web Services: S3: unixsherpa-solutions.s3.amazonaws.com

Served from: solutions.unixsherpa.com @ 2012-02-06 15:26:40 -->
