Integrating Sun Secure Global Desktop with Radius Authentication

Last week I have been looking at the integration of SGD (4.41.907) with Radius One-Time-Password (OTP) Authentication. Inspired by some projects that are being done by some of our partners at customer sites and a wiki page on the same subject I decided to setup a similar environment in our lab. The wiki page material is based on an earlier version of Sun Secure Global Desktop and therefore based on an earlier version of Apache web server (version 2.x vs. 1.3.36).

I decided to install ActivIdentity (AI) AAA Radius Server 6.6 next to an already existing installation of VDI3 and Active Directory DC. The Active Directory is integrated with both AAA and VDI. The AAA server will use Active Directory to lookup users and also store serial number information for the token cards that are used by these users. The integration with VDI is for the Kerberos Authentication of Sun Ray users and also for looking up user profiles by SGD after a successful third-party authentication has taken place (all user profiles are provisioned to AD by means of Sun Identity Manager but this is less relevant at this point).

AI Pocket TokenThe authentication within SGD / AAA is based on OTP's generated by ActivIdentity Pocket Tokens. After setting the PIN these can be used in various ways. We will use them in synchronous way which means that after typing in our PIN and clicking OK, the token will generate and present an OTP. Other ways these tokens can be used is through a challenge-response OTP generation.

The integration of SGD (Apache) and Radius authentication can be done in various ways as well. One of them is based on a piece of code (mod_auth_radius) from the open source freeradius.org project. This is what is described on the wiki mentioned above and is also described in this blog. Another way is through a similar piece of code (mod_auth_xradius) from another website called outoforder.cc. The last option and probably the most sophisticated is through a solution like Sun OpenSSO Enterprise.

Where possible I have followed the wiki mentioned above. However, there are some steps that need some adjustments and some other things need to be changed. I will focus mainly on the differences and other things that I encountered...


Step 1. Obtain and install, (if necessary) CVS

I also downloaded and installed CVS to get to the latest version of mod_auth_radius. However, through a conversation I had with the author of this module, the most recent source code can now be found at git://git.freeradius.org/mod_auth_radius.git so to get to the latest version from now on this would require the installation and use of e.g. git-1.6.2.1-sol10-x86-local.gz


Step 2. Retrieve and Build mod_auth_radius

First of all, since we are using Apache 2.x underneath SGD 4.41, we need to get the right mod_auth_radius. As can be easily found on freeradius.org this version is called mod_auth_radius-2.0.c. From the CVS we checkout module mod_auth_radius which contains mod_auth_radius-2.0.c (v 1.5.7). Therefore the 3 last bullets should read:

# cp mod_auth_radius-2.0.c /opt/tarantella/webserver/apache/{version}
# cd /opt/tarantella/webserver/apache/{version}
# bin/apxs -i -a -c mod_auth_radius-2.0.c

However, the last command will generate the following error on a default Solaris x86 installation platform:

/opt/tarantella/webserver/apache/2.2.8_openssl-0.9.8g_jk1.2.25/build/libtool:
  line 1279: gcc4: command not found
apxs:Error: Command failed with rc=65536 

This can of course be fixed by installing gcc4 (e.g. from blastwave.org) or also by just creating a link gcc4 that points to gcc (which is gcc3 on my Solaris 10 x86 platform) like this (there are of course more ways to get this right):

# cd /usr/sfw/bin
# ln -s gcc gcc4
# PATH=/usr/sfw/bin:/usr/ccs/bin:$PATH
# bin/apxs -i -a -c mod_auth_radius-2.0.c

This should have added a line in the Apache /opt/tarantella/webserver/apache/{version}/httpd.conf file:

LoadModule radius_auth_module modules/mod_auth_radius-2.0.so

Step 3.  Configure Apache for RADIUS Authentication

We add the following lines to the end of httpd.conf:

#
# radius_auth_module add
# 
Alias /sgd "/opt/tarantella/webserver/tomcat/5.0.28_axis1.2/webapps/sgd"
<IfModule radius_auth_module>
AddRadiusAuth RadiusServer:1812 ActivPack 5:3
AddRadiusCookieValid 0
</IfModule>

SetEnvIf Request_URI "\\.(cab|jar|gif|der|class)$" sgd_noauth_ok
<LocationMatch "/sgd">
    Order Allow,Deny
    Allow from env=sgd_noauth_ok
    AuthType Basic
    AuthName "Radius Authentication"
    AuthBasicAuthoritative off
    AuthRadiusAuthoritative on
    AuthRadiusCookieValid 0
    AuthRadiusActive On
    Require valid-user
    Satisfy any
</LocationMatch>

Step 4.  Test RADIUS Authentication (optional)

Least thing to do here is to restart the webserver:

/opt/tarantella/bin/tarantella restart webserver

Step 5.  Configure Tomcat to Trust Webserver Authentication
Step 6.  Configure SGD to Allow Webserver Authentication
Step 7.  Allow Administrators to Login via Webserver Authentications (optional)

See wiki for steps 5, 6, and 7.


An additional note is that after all these steps, things worked fine for Internet Explorer but not for Firefox. Investigating the HTTP traffic in more detail revealed that not always the RADIUS cookie (that is set after successful authentication) is send back to the server properly. Also it appeared the cookie had a very strange path and also the expiration date was off. E.g., the cookie path contained "/ expires=...". Looking more closely at the source code I ended up with these lines of code:

static void
add_cookie(request_rec \*r, apr_table_t \*header, char \*cookie, time_t expires)
{
  ...
    apr_snprintf(new_cookie, 1024, "%s=%s; path=/ expires=%s;",
                cookie_name, cookie, buffer);
  } else {
    apr_snprintf(new_cookie, 1024,
                "%s=%s; path=/; expires=Wed, 01-Oct-97 01:01:01 GMT;",
                cookie_name, cookie);
  }
  ...
}

It looks like there is a ';' missing in the line in red. I added a ';' in this line right after 'path=/' and recompiled. After this things also worked for Firefox. Checking the HTTP traffic, I could see the cookie being sent correctly.


Another thing to note is that I have set the lifetime of the cookie to indefinite (AddRadiusCookieValid 0). This is of course an arbitrary choice but I wanted to prevent having to regenerate an OTP every 5 minutes to keep working in SGD. This way the session is tied to the SGD session and will end when we logoff (see the end of this blog of how we can do this).

After these steps the end result should look similar to what you see in the following demonstration...


Basic demonstration of SGD and Radius OTP Authentication

To get a single logoff experience, logging out from SGD should also clear the authentication "session" so trying to log back in will confront us again with a Radius Authentication prompt. For this we have changed the logged-out.jsp file that can be found at the default path: /opt/tarantella/webserver/tomcat/5.0.28_axis1.2/webapps/sgd/webtops/standard/webtop/logged-out.jsp. The line that I put in is the following:

document.execCommand("ClearAuthenticationCache");

This will clear the HTTP authentication cache for the browser. Unfortunately, this is browser dependent and only works for Internet Explorer. There is no straightforward way to get the same behavior with Firefox. Googling around I have found that this is a long standing RFE that apparently has not been implemented. Also some workarounds / hacks are described at various websites (e.g.http://trac-hacks.org) that supposedly will give a similar behavior with Firefox. However, I have not really tried to get this working.

Finally, I have also used mod_auth_xradius to get a similar result. It took more work to get this module built. Apparently this code is less straghtforward to compile on Solaris 10 with gcc. It took some tweaking (not detailed here) to get this compiled. As, said the end result is similar. It is different in the sense that mod_auth_xradius does not use cookies for its sessions. As far as I can tell it is also not possible to set the lifetime of a session to indefinite.

All in all, it seems possible to get this working with the mod_auth_radius module. A much nicer solution would possible be the integration with Sun OpenSSO. This will get away from using Basic Authentication and give us some better session management (in my opinion) and also the possibility of SSO to other back end applications. I have not tried this but it should be fairly straightforward since OpenSSO supports Radius authentication. Might be something interesting to work on for a next "proof-of-concept" :-)

Comments:

Very, very nice blog post and you found the little bug as well :)

To kill the cookie at the end of the session you might want to use the following lines in the logged-out.jsp:

// ADDITION to kill RADIUS cookie

Cookie radiuscookie = new Cookie("RADIUS","RADIUS");
radiuscookie.setMaxAge(0);
radiuscookie.setPath("/");
response.addCookie(radiuscookie);

// END OF ADDITION

Posted by Remold Krol on May 26, 2009 at 02:55 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog covers exciting things I encounter about Oracle's software and related; that is Identity & Access Management, SOA, Security, Desktop, etc. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today