<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=CCMWithKerberos</id>
	<title>CCMWithKerberos - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=CCMWithKerberos"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=CCMWithKerberos&amp;action=history"/>
	<updated>2026-05-16T10:06:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=CCMWithKerberos&amp;diff=44&amp;oldid=prev</id>
		<title>Maintenance script: Created page with &quot; === Goal === The main idea here is to find a solution to secure machine profiles with Kerberos using Apache + mod_kerb on the AII server.  For the moment, ccm-fetch is don...&quot;</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=CCMWithKerberos&amp;diff=44&amp;oldid=prev"/>
		<updated>2015-08-26T12:28:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; === Goal === The main idea here is to find a solution to secure machine profiles with Kerberos using Apache + mod_kerb on the AII server.  For the moment, ccm-fetch is don...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
=== Goal ===&lt;br /&gt;
The main idea here is to find a solution to secure machine profiles with Kerberos using Apache + mod_kerb on the AII server.&lt;br /&gt;
&lt;br /&gt;
For the moment, ccm-fetch is done through SSL on the server side, with authentication of machines by their SSL certificate on the client side.&lt;br /&gt;
&lt;br /&gt;
We could simplify a bit the profile fetching process by allowing machines to authenticate thanks to their own Kerberos keytab. This would eliminate the need for machines to have an SSL certificate.&lt;br /&gt;
&lt;br /&gt;
=== Configuring the Apache server ===&lt;br /&gt;
We were inspired by these pages :&lt;br /&gt;
&lt;br /&gt;
http://www.microhowto.info/howto/configure_apache_to_use_kerberos_authentication.html&lt;br /&gt;
&lt;br /&gt;
http://www.microhowto.info/howto/add_a_host_or_service_principal_to_a_keytab_using_mit_kerberos.html&lt;br /&gt;
&lt;br /&gt;
==== Defining an HTTP directory protected by Kerberos ====&lt;br /&gt;
Create a file /etc/httpd/conf.d/auth_kerb.conf with the following content :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LoadModule auth_kerb_module modules/mod_auth_kerb.so&lt;br /&gt;
&amp;lt;Location /private&amp;gt;&lt;br /&gt;
  AuthType Kerberos&lt;br /&gt;
  AuthName &amp;quot;Kerberos Login&amp;quot;&lt;br /&gt;
  KrbMethodNegotiate On&lt;br /&gt;
  KrbMethodK5Passwd Off&lt;br /&gt;
  KrbAuthRealms WN.IIHE.AC.BE&lt;br /&gt;
  Krb5KeyTab /etc/httpd/conf/aiisrv.keytab&lt;br /&gt;
  require valid-user&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the Apache location, create a simple text file (file.txt) that will be used during tests.&lt;br /&gt;
==== Creation of a service principal for HTTP on the AII server ====&lt;br /&gt;
To do this, use the FreeIPA web interface (tab &amp;quot;Indentity&amp;quot; &amp;gt; &amp;quot;Services&amp;quot;). The HTTP service principal should be :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/aiisrv.wn.iihe.ac.be@WN.IIHE.AC.BE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Creation of a keytab for the Apache service ====&lt;br /&gt;
Use the freeipa command &amp;quot;ipa-getkeytab&amp;quot; :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ipa-getkeytab -s freeipa.wn.iihe.ac.be  -k /etc/httpd/conf/aiisrv.keytab -p HTTP/aiisrv.wn.iihe.ac.be@WN.IIHE.AC.BE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
Of course, these tests must done from a machine that is already in the Kerberos realm.&lt;br /&gt;
&lt;br /&gt;
==== Using curl ====&lt;br /&gt;
First, you need to create a valid Kerberos ticket. As root, you can always do this with the command :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
kinit -k -t /etc/krb5.keytab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, try this :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl --negotiate http://aiisrv.wn.iihe.ac.be/private/test.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using ccm-fetch ====&lt;br /&gt;
For ccm to be able to download profiles with &amp;quot;negotiate&amp;quot;, you need first to install the following Perl module and copy it in the right place :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://search.cpan.org/~agrolms/LWP-Authen-Negotiate-0.06/lib/LWP/Authen/Negotiate.pm&lt;br /&gt;
cp -a Negotiate.pm /usr/share/perl5/LWP/Authen/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
On the AII server, copy the machine profile to the /private HTTP location, and on the machine where you will do your test, modify the /etc/ccm.conf file so that it contains the following line :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
profile http://qclig.wn.iihe.ac.be/private/profile_node19-1.wn.iihe.ac.be.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then, run ccm-fetch.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
In the solution we have described on this page, we have removed SSL from the server side for the sake of simplicity, but doing this, the communication between the client and the server is not encrypted anymore !&lt;br /&gt;
&lt;br /&gt;
There is a [https://github.com/quattor/CCM/issues/54 discussion] in the Quattor GitHub, about Kerberos and CCM. One interesting solution (that is used by MS) would be to encrypt the profile in such a way that a machine can only decrypt its own profile, and not others...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TracNotice|{{PAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>