This content is no longer maintained. Please visit our new website.
| Academic Computing and Communications Center | ||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||
Running Your Own Bluestem Server |
||||||||||||||||||
|
||||||||||||||||||
| Why Run Your Own Bluestem Server? | ||||||||||||||||||
|
Tigger and icarus already provide bluestem for protecting files, and for personal CGI scripts. However, you may have data that requires extra-special protection (e.g. financial or medical), or you may want to run a web application (e.g. database) or write in a language for which tigger is not adequate. In such a case, if you are capable of running your own web server (i.e. physically secure room, maintain security patches, manage user accounts, run backups, install and troubleshoot software, keep and inspect logs), you can make your web server into a bluestem application server. This will allow your web scripts to authenticate users, using their normal bluestem netid and password, in a very secure manner. |
||||||||||||||||||
| Requirements | ||||||||||||||||||
|
||||||||||||||||||
| Must My Scripts be Perl? | ||||||||||||||||||
|
What?? You don't like perl? I do, but if you can't stand it, don't worry. You have to run perl, but you don't have to write it. You can make bluestem calls from ASP, using the little bluestem protocol. And if needed, you can probably adapt this to other languages as well. |
||||||||||||||||||
| Security Consideration | ||||||||||||||||||
|
One of the main features of Bluestem is that the user's password is never sent to the application server, not even encrypted or used as an encryption key. So it's not possible for a rogue application server to compromise a user's password. However, all bluestem applications on a given server need write access to the internal bluestem cache. Suppose you have two developers writing web scripts (with or without bluestem) for your server. Each of them has access to the bluestem cache, because their scripts run with the identity of the web server. This means that Developer A can poison the bluestem cache, and therefore can impersonate Person X to any bluestem application on your server. He can't affect bluestem applications on other servers like tigger, but he can certain affect all applications on your server. Moral of Story: don't let just anyone write CGI scripts on your server. You may wonder how we allow normal users on tigger or icarus to use bluestem with their own CGI safely. The answer is that we insist on using a modified version of Cgiwrap. Cgiwrap launches as root, runs the bluestem code, puts the authenticated netid into the environment, then changes uid to the user and exec's the user's script. The point is, by the time the user's code runs, it no longer has read or write access to the bluestem cache, so all is well. |
||||||||||||||||||
| Registering your Application Server | ||||||||||||||||||
|
Application servers are registered at the following URL: https://ness.uic.edu/bluestem/admin?opt=aservers If your NetID isn't yet configured as an application server administrator then you'll get a permission denied message. To request your NetID be registered as an application server administrator, please contact bluestem@uic.edu. If your NetID is already configured as an application server administrator then you will be presented with a screen you can use to define your Bluestem application server and generate your application server key. When you add your application server you will need to set:
|
||||||||||||||||||
| Installation | ||||||||||||||||||
|
UIC's bluestem client software is available from the application server administration page mentioned above or from the following URL: The UIUC Bluestem client is also supported. For information on the UIUC bluestem client see: https://www-s1.illinois.edu/bluestem-notes/index.html The steps to setup a Bluestem application server are given in brief below. For more detailed instructions please see the README file included in the Bluestem client download.
|
||||||||||||||||||
| Securing a Site with Apache httpd authentication | ||||||||||||||||||
|
In bluestem.httpd.conf there are two examples of configuring Apache httpd to force Bluestem authentication. Both require your webserver have mod_perl installed. To use these authentication methods, uncomment the line: PerlRequire /usr/local/bluestem-client/startup.pl This causes mod_perl to preload the Apache::Bluestem libraries used to perfrom Bluestem authentication. Now you can implement either an access handler or an authentication handler. Both of these can be specified for a <Directory> or <Location> directive. The access handler implements the allowed.netids access control as described on Config File Format page. The access handler can be enabled as follows: PerlAccessHandler Apache::Bluestem::access_handler The authentication handler forces all users accessing the specified resource to authenticate with Bluestem then checks their NetID against and "require user [netid] ..." statements, or just "require valid-user" to permit anyone with a valid netid. For example: <Location "/restricted-path">
AuthName Bluestem
AuthType Bluestem
PerlAuthenHandler Apache::Bluestem::authen_handler
require valid-user
</Location>
|
||||||||||||||||||
| Using Little Bluestem | ||||||||||||||||||
|
The Little Bluestem protocol defines a simple method for checking if a user is authenticated and looking up their netid. This consists of:
There are several implementations of the Little Bluestem protocol already written. An implementation of Little Bluestem an classic ASP is included with the Bluestem Client for windows. For an example of using the Little Bluestem with ASP see bluetest.asp, included with the windows Bluestem Client distribution. For other implementations of Little Bluestem including Java, ASP.NET, PHP and ColdFusion see: https://www-s1.illinois.edu/bluestem-notes/othersoftware.html |
||||||||||||||||||
| Using Bluestem in your own Perl Scripts | ||||||||||||||||||
|
It is sometimes helpful to write your own Perl scripts that can use the Bluestem libraries. Examples of how to do this can be found in the test.cgi and test1.cgi scripts provided with the Bluestem client. Using the object oriented interface shown in test.cgi: #!/usr/bin/perl
use strict;
use warnings;
# Customize to your installation directory.
use lib "/usr/local/bluestem-client/lib";
use Bluestem::CGIClient ();
my $cgi = CGI->new();
my $bsc = Bluestem::CGIClient->new(
cgi => $cgi,
);
my $session = $bsc->get_session();
unless( $session ) {
$bsc->handle_login();
exit 0;
}
my $ID = $session->{netid};
# ID is known. Carry on.
...
If using the old interface as shown in test1.cgi be sure to note that bluestem.pl is no longer supported. If your programs begin with "require 'bluestem.pl';" then you will need to change it to "use Bluestem;" as shown below. #!/usr/bin/perl use strict; use warnings; # Customize to your installation directory. use lib "/usr/local/bluestem-client/lib"; use Bluestem (); # check for bluestem ID my($ID, $IdleTime, $SessionTime) = bluestem_id(); # If no ID, force login bluestem_login unless $ID; # ID is known. Carry on. ...Note: Bluestem provides an authenticated netid. Period. It does not tell you if the person is staff or student, it does not tell you what department they are in, it does not tell you what privileges they have. Just the netid. It is up to your script to decide what privileges to allow the person, based on the netid. |
||||||||||||||||||
| What, exactly, is a Bluestem ID? | ||||||||||||||||||
|
A Bluestem ID has three parts, and can look like this:
The Bluestem Id usually has the defaults removed, so the above would simply be: adabyron. Note that the following could all represent different people:
|
||||||||||||||||||
| Troubleshooting | ||||||||||||||||||
|
||||||||||||||||||
| More Info | ||||||||||||||||||
|
If you need more details, the bluestem protocol and details about installation of the UIUC client are described at UIUC. Do note that UIC client implementation is completely different though the Bluestem and Little Bluestem protocols are the same. Also, don't contact UIUC about bluestem servers registered at UIC. Questions at UIC should go to bluestem@uic.edu |
||||||||||||||||||
| Web Security | Previous: 2 Config File Format | Next: A1 Related Links |
| 2011-3-3 wwwtech@uic.edu |
|