<?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>Andrea Veri&#039;s Blog &#187; Planets</title>
	<atom:link href="http://www.dragonsreach.it/category/planets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dragonsreach.it</link>
	<description></description>
	<lastBuildDate>Fri, 14 Jun 2013 12:38:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Setting up your SSL certificates on OpenLDAP by using a Mozilla NSS database</title>
		<link>http://www.dragonsreach.it/2013/03/27/setting-ssl-certificates-openldap-mozilla-nss-database/</link>
		<comments>http://www.dragonsreach.it/2013/03/27/setting-ssl-certificates-openldap-mozilla-nss-database/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 12:04:02 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planets]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Mozilla NSS]]></category>
		<category><![CDATA[OpenLDAP]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[SSSD]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://www.dragonsreach.it/?p=781</guid>
		<description><![CDATA[I&#8217;ve recently spent some time setting up TLS/SSL encryption (SSSD won&#8217;t send a password in clear text when an user will try to authenticate against your LDAP server) on an OpenLDAP istance and as you may know the only way for doing that on a RHEL / CentOS environment is dealing with a Mozilla NSS&#8230;]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve recently spent some time setting up <strong>TLS/SSL</strong> encryption (<strong>SSSD</strong> won&#8217;t send a password in clear text when an user will try to authenticate against your LDAP server) on an <strong>OpenLDAP</strong> istance and as you may know the only way for doing that on a <strong>RHEL / CentOS</strong> environment is dealing with a <strong>Mozilla NSS</strong> database (which is, in fact, a <strong>SQLite</strong> database). I&#8217;ve been reading all the man pages of the relevant tools available to manipulate Mozilla NSS databases and I thought I would have shared the whole procedure and commands I used to achieve my goal. Even if you aren&#8217;t running an RPM based system you can opt to use a Mozilla NSS database to store your certificates as your preferred setup.</p>
<h3>On the LDAP (SLAPD) server</h3>
<p><strong>Re-create *.db files</strong></p>
<blockquote><p>mkdir /etc/openldap/certs<br />
modutil -create -dbdir /etc/openldap/certs</p></blockquote>
<p><strong>Setup a CA Certificate</strong></p>
<blockquote><p>certutil -d /etc/openldap/certs -A -n &#8220;My CA Certificate&#8221; -t TCu,Cu,Tuw -a -i /etc/openldap/cacerts/ca.pem<br />
where <strong>ca.pem</strong> should be your CA&#8217;s certificate file.</p></blockquote>
<p><strong>Remove the password from the Database</strong></p>
<blockquote><p>modutil -dbdir /etc/openldap/certs -changepw &#8216;NSS Certificate DB&#8217;</p></blockquote>
<p><strong>Creates the .p12 file and imports it on the Database</strong></p>
<blockquote><p>openssl pkcs12 -inkey domain.org.key -in domain.org.crt -export -out domain.org.p12 -nodes -name &#8216;LDAP-Certificate&#8217;<br />
pk12util -i domain.org.p12 -d /etc/openldap/certs</p></blockquote>
<p>where <b>domain.org.key </b>and <strong>domain.org.crt </strong>are the names of the certificates you previously created at your CA&#8217;s website.</p>
<p><strong>List all the certificates on the database and make sure all the informations are correct</strong></p>
<blockquote><p>certutil -d /etc/openldap/certs -L</p></blockquote>
<p><strong>Configure /etc/openldap/slapd.conf and make sure the TLSCACertificatePath points to your Mozilla NSS database</strong></p>
<blockquote><p>TLSCACertificateFile /etc/openldap/cacerts/ca.pem<br />
TLSCACertificatePath /etc/openldap/certs/<br />
TLSCertificateFile LDAP-Certificate</p></blockquote>
<h3>Additional commands</h3>
<p><strong>Modify the trust flags if necessary</strong></p>
<blockquote><p>certutil -d /etc/openldap/certs -M -n &#8220;My CA Certificate&#8221; -t &#8220;TCu,Cu,Tuw&#8221;</p></blockquote>
<p><strong>Delete a certificate from the database</strong></p>
<blockquote><p>certutil -d /etc/openldap/certs -D -n &#8220;My LDAP Certificate&#8221;</p></blockquote>
<h3>On the clients (nslcd uses ldap.conf while sssd uses /etc/sssd/sssd.conf)</h3>
<p><strong>On /etc/openldap/ldap.conf</strong></p>
<blockquote><p>BASE dc=domain,dc=org<br />
URI ldaps://ldap.domain.org</p>
<p>TLS_REQCERT demand<br />
TLS_CACERT /etc/openldap/cacerts/ca.pem</p></blockquote>
<p><strong>On /etc/sssd/sssd.conf</strong></p>
<blockquote><p>ldap_tls_cacert = /etc/openldap/cacerts/ca.pem<br />
ldap_tls_reqcert = demand<br />
ldap_uri = ldaps://ldap.domain.org</p></blockquote>
<h3 id="How_to_test_the_whole_setup">How to test the whole setup</h3>
<blockquote>
<pre>ldapsearch -x -b 'dc=domain,dc=org' -D "cn=Manager,dc=domain,dc=org" '(objectclass=*)' -H ldaps://ldap.domain.org -W -v</pre>
</blockquote>
<p><strong>Troubleshooting</strong></p>
<p>If anything goes wrong you can run SLAPD with the following args for its debug mode:</p>
<blockquote><p>/usr/sbin/slapd -d 256 -f /etc/openldap/slapd.conf -h &#8220;ldaps:/// ldap:///&#8221;</p></blockquote>
<p><strong>Possible errors: </strong></p>
<p>If you happen to see an error similar to this one: &#8220;<strong>TLS error -8049:Unrecognized Object Identifier.</strong>&#8220;, try running ldapsearch with its debug mode this way:</p>
<blockquote><p>ldapsearch -d 1 -x -ZZ -H ldap://ldap.domain.org</p></blockquote>
<p>Make also sure that the <strong>FQDN</strong> you are trying to connect to is listed on the trusted FQDN&#8217;s list of your<strong> domain.org.crt</strong>.</p>
<p><strong>Update</strong>: as SSSD&#8217;s developer <strong>Stephen Gallagher</strong> correctly pointed out on the comments using ldap_tls_reqcert = allow isn&#8217;t a best practice since it may take in <a href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack" target="_blank">Man in the Midle Attacks</a>, adjusting the how to to match his suggestions.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dragonsreach.it/2013/03/27/setting-ssl-certificates-openldap-mozilla-nss-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The future is Cloudy</title>
		<link>http://www.dragonsreach.it/2012/12/13/the-future-is-cloudy/</link>
		<comments>http://www.dragonsreach.it/2012/12/13/the-future-is-cloudy/#comments</comments>
		<pubDate>Thu, 13 Dec 2012 14:22:25 +0000</pubDate>
		<dc:creator>Andrea Veri</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Planets]]></category>
		<category><![CDATA[Cloud]]></category>

		<guid isPermaLink="false">http://www.dragonsreach.it/?p=697</guid>
		<description><![CDATA[Have you ever heard someone talking extensively about Cloud Computing or generally Clouds? and have you ever noticed the fact many people (even the ones who present themselves as experts) don&#8217;t really understand what a Cloud is at all? That happened to me multiple times and one of the most common misunderstandings is many see the&#8230;]]></description>
				<content:encoded><![CDATA[<p>Have you ever heard someone talking extensively about <strong>Cloud Computing</strong> or generally <strong>Clouds</strong>? and have you ever noticed the fact many people (even the ones who present themselves as experts) don&#8217;t really understand what a Cloud is at all? That happened to me multiple times and one of the most common misunderstandings is many see the Cloud as something being on the <strong>internet</strong>. Many companies add a little <strong>logo</strong> representing a cloud on their frontpage and without a single change on their infrastructure (but surely with a <strong>price increment</strong>) they start calling their products as being on the Cloud. Given the lack of knowledge about this specific topic people tend to buy the product presented as being on the Cloud without understanding what they really bought.</p>
<p><img class="aligncenter size-full wp-image-706" title="cloud-computing" src="http://www.dragonsreach.it/wp-content/uploads/2012/12/cloud-computing.png" alt="" width="400" height="362" /><em><strong></strong></em></p>
<p>But what Cloud Computing really means? it took several years and more than fifteen drafts to the <strong>National Institute of Standards and Technology</strong>&#8216;s (<strong>NIST</strong>) to find a definition. The final accepted proposal:</p>
<blockquote>
<p style="text-align: left;"><em><strong>Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.</strong></em></p>
</blockquote>
<p>The above definition requires a few more clarifications specifically when it comes to understand where should we focus on while checking for a Cloud Computing solution. A few key points:</p>
<ol>
<li><strong>On-demand self-service</strong>: every consumer will be able to unilaterally provision multiple computing capabilities like server time, storage, bandwidth, dedicated RAM or CPU without requiring any sort of human interaction from their respective Cloud providers.</li>
<li><strong>Rapid elasticity and scalability</strong>: all the computing capabilities outlined above can be elastically provisioned and released depending on how much demand my company will have in a specific period of time. Suppose the X company is launching a new product today and it expects a very large number of customers. The X company will add more resources to their  Cloud for the very first days (where they suppose the load to be very high) and then it&#8217;ll scale the resources back as they were before. Elasticity and scalability permit the X company to improve and enhance their infrastructure when they need it with an huge saving in monetary terms.</li>
<li><strong>Broad network access</strong>: capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations).</li>
<li><strong>Measured service</strong>: Cloud systems allow maximum transparency between the provider and the consumer, the usage of all the resources is monitored, controlled, and reported. The consumer knows how much will spend, when and in how long.</li>
<li><strong>Resource pooling</strong>: each provider&#8217;s computing resources are pooled to serve multiple consumers at the same time. The consumer has no control or knownledge over the exact location of the provided resources but may be able to specify location at a higher level of abstraction (e.g., country, state, or datacenter).</li>
<li><strong>Resources price</strong>: when buying a Cloud service make sure the cost for two units of RAM, storage, CPU, bandwidth, server time is exactly the double of the price of one unit of the same capability. An example, if a provider offers you one hour of bandwitdh for 1 Euro, the price of  two hours will have to be 2 Euros.</li>
</ol>
<div>Another common error I usually hear is people feeling Cloud Computing just as a place to put their files online as a backup or for sharing them with co-workers and friends. That is just one of the available Cloud &#8220;<strong>features</strong>&#8220;, specifically the &#8220;<strong>Cloud Storage</strong>&#8220;, where typical examples are companies like <strong>Dropbox</strong>, <strong>Spideroak</strong>, <strong>Google Drive</strong>,<strong> iCloud</strong> and so on. But let&#8217;s make a little note about the other three &#8220;features&#8221;:</div>
<div>
<ol>
<li><strong>Infrastructure as a Service</strong> (<strong>IaaS</strong>): the capability provided to the consumer is to provision processing, storage, networks, and other fundamental computing resources where the consumer is able to deploy and run arbitrary software, which can include operating systems and applications. In this specific case the consumer has still no control or management over the underlying Cloud infrastructure but has control over operating systems, storage, and deployed applications. A customer will be able to add and destroy virtual machines (VMs), install an operating system on them based on custom kickstart files and eventually manage selected networking components like firewalls, hosted domains, accounts.</li>
<li><strong>Platform as a Service</strong> (<strong>PaaS</strong>). the capability provided to the consumer is to deploy onto the cloud infrastructure consumer-created or acquired applications created using programming languages, libraries, services, and tools  (like Mysql + PHP + PhpMyAdmin or Ruby on Rails) supported by the provider. In this specific case the consumer has still no control or management over the Cloud infrastructure itself (servers, OSs, storage, bandiwitdh etc.) but has control over the deployed applications and configuration settings for the application-hosting environment.</li>
<li><strong>Software as a Service</strong> (<strong>SaaS</strong>): the capability provided to the consumer is to use the provider’s applications running on a Cloud infrastructure. The applications are accessible through various client devices, such as a browser, a mobile phone or a program interface. The consumer doesn&#8217;t not manage nor control the Cloud infrastructure (servers, OSs, storage, bandwidth, etc.) that allows the applications to run. Even the provided applications aren&#8217;t customizable by the consumer, which should rely on limited configuration settings.</li>
</ol>
</div>
<p><a href="http://www.dragonsreach.it/wp-content/uploads/2012/12/cloud-service-models.jpg"><img class="size-full wp-image-704 aligncenter" title="cloud-service-models" src="http://www.dragonsreach.it/wp-content/uploads/2012/12/cloud-service-models.jpg" alt="" width="550" height="322" /></a></p>
<p>The Cloud Computing technology is reasonably the future but can we trust Cloud providers? Are we sure that no one will ever have access to our files except us? and what about governments interested in acquiring a specific customer data hosted on the Cloud?</p>
<p>I always suggest to read deeply both the <strong>Privacy Policy</strong> and <strong>Terms of Use</strong> of a certain service before signing in especially when it comes to choose a Cloud storage provider. Many providers have the same aspect, they seem to provide the same resources, the same amount of storage for the same price but legally they may present different problems, and that is the case of <strong>Spideroak</strong> vs <strong>Dropbox</strong>. Quoting from the Dropbox&#8217;s <strong>Privacy Policy</strong>:</p>
<blockquote>
<div><strong><em>Compliance with Laws and Law Enforcement Requests; Protection of DropBox’s Rights. We may disclose to parties outside Dropbox files stored in your Dropbox and information about you that we collect when we have a good faith belief that disclosure is reasonably necessary to (a) comply with a law, regulation or compulsory legal request; (b) protect the safety of any person from death or serious bodily injury; (c) prevent fraud or abuse of DropBox or its users; or (d) to protect Dropbox’s property rights. If we provide your Dropbox files to a law enforcement agency as set forth above, we will remove Dropbox’s encryption from the files before providing them to law enforcement. However, Dropbox will not be able to decrypt any files that you encrypted prior to storing them on Dropbox.</em></strong></div>
</blockquote>
<p>It&#8217;s evident that Dropbox employees can access your data or be forced by legal process to turn over your data <strong>unencrypted</strong>. On the other side, Spideroak on its latest update to its <a href="https://spideroak.com/blog/20120502022627-spideroak-privacy-policy-update">Privacy Policy</a> states that data stored on their  Cloud  is <strong>encrypted</strong> and <strong>inaccessible</strong> without user&#8217;s key, which is stored locally on user&#8217;s computers.</p>
<p>And what about the latest research paper, titled &#8221;<strong><a href="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2181534" target="_blank">Cloud Computing in Higher Education and Research Institutions and the USA Patriot Act</a></strong>&#8220; written by the legal experts of the <strong>University of Amsterdam&#8217;s Institute for Information Law </strong>stating the anti-terror <strong>Patriot Act</strong> could be theoretically used by U.S. law enforcement to bypass strict European privacy laws to acquire citizen data within the European Union without their consensus?</p>
<p>The only requirement for the data acquisition is the provider being an U.S company or an European company conducting systematic business in the U.S. For example an Italian company storing their documents (protected by the European privacy laws and under the general Italian jurisdiction) on a provider based in Europe but conducting systematic business in the United States, could be forced by U.S. law enforcement to transfer data to the U.S. territory for inspection by law enforcement agencies.</p>
<p>Does someone really <strong>care</strong> about the <strong>privacy</strong> of companies, consumers and users at all? or better does <strong>privacy</strong> exists at all for the millions of the people that connect to the internet every day?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dragonsreach.it/2012/12/13/the-future-is-cloudy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
