Monday, March 31, 2008

The Open.ControlTier documentation on configuring LDAP authentication and authorization has not yet been updated for the 3.1 release and so only covers configuring Workbench, and not support for Jobcenter.

As an interim solution to this omission, this blog entry records the steps necessary to achieve a "state-of-the-art" configuration based on OpenLDAP, which is both useful in itself and also a crucial step toward integrating with Microsoft's Active Directory services which are broadly deployed in larger enterprise infrastructures.

Modest design goal

While it is feasible to exploit LDAP authentication and authorization "pervasively" across all nodes upon which the various ControlTier components are installed, what is documented here is the more modest design goal of using LDAP to secure access only to the centralized ControlTier server conventionally deployed to provide a single point of administration in the network.

This is a practical compromise when you consider that more often than not, command execution on remote client systems is tied to one or more system level "application" accounts as opposed to individual user's logins. These accounts are used to construct the network of public key based passwordless secure shell access from the ControlTier server.

Comprehensive authentication and authorization for ControlTier is therefore achieved at two levels:

At the system level, login access to the server and client systems must be restricted to the set of individuals authorized to use the ControlTier and "application" accounts that provide unfettered access to executing build and deployment commands in the distributed infrastructure.

At the project level, access to the Workbench model, and Jobcenter command interface must be filtered by the user and role-based authentication and authorization scheme intrinsic to those applications.

It is in the latter case that this posting covers using LDAP to manage levels of access to ControlTier's web based services.Deploying an LDAP instance

You can skip this section if you have an LDAP server available on your network that is accessible from the ControlTier server.

Assuming such a service does not already exist, the first step is to setup an LDAP server instance on a system that is accessible to the ControlTier server. There are many LDAP server implementations available, but here's how to setup the most popular Open Source version: OpenLDAP.

The OpenLDAP Quick Start Guide proposes building the officially released software from source. There are a number of binary distributions available on the Internet, of course, and many Unix variant OSes package OpenLDAP with their releases.

In this case, I used a CentOS 4.5 instance.

These instructions assume you wish to configure and deploy a non-superuser based LDAP server instance to support ControlTier:

Acquire, or build OpenLDAP from source. In this case, the software is built from source and installed under $CTIER_ROOT/pkgs to facilitate executing as the ControlTier server account (e.g. "ctier"):

One thing to note is that the Elements module library contains an OpenLDAP module that can be used to facilitate management of the LDAP instance. Here's sample project object XML to configure a OpenLDAP instance for use with the setup described above:

Note that both administration and architect users should also be assigned the user role since some elements of the UI assume this (e.g. checks for user role membership are embedded in some of the JSPs).

Note also, that only users with assigned both the admin and architect roles can create new projects.

Please ignore the sample LDIF file on Open.ControlTier, and use the following file as a guideline to structuring your directory:

You can see that it is important to use OS access controls to safeguard the contents of this file from unauthorized access.

Note that you can supplement OpenLDAP's command line interface with JXplorer, an Open Source Java LDAP browser/editor client application.

Configuring Workbench to use LDAP

The next piece of the puzzle is to adjust Tomcat's security "Realm" configuration to use the LDAP server. All that's necessary is to replace the default "UserDatabaseRealm" element in "server.xml" with the following "JNDIRealm" setup:

This configuration specifies the connection URL to the LDAP server, matches the role base and user pattern to the repository structure (you may need to adjust these for your own repository), and uses the "bind method" of authentication described in the Tomcat 4 documentation.

Before restarting Tomcat, a final piece of configuration will make Workbench user management available from the Administration page. Edit the "auth.properties" file to switch from "default" to "jndi" authentication and authorization:

$ cat $CATALINA_BASE/webapps/itnav/WEB-INF/classes/auth.properties####################################### auth.properties# This is the configuration properties file for the User Management feature.##### ngps.workbench.auth.type=defaultngps.workbench.auth.type=jndi

####################################### To enable User Management with JDNI authorization, set the value of ngps.workbench.auth.type to jndi# then fill in the JNDI configuration below.####################################### Configuration for JNDI authorization:####

(Note that with an embedded password this is another file to safeguard with OS access control).

Once JNDI user management is enabled, it is possible to use Workbench user administration to restrict access to individual projects on a user by user basis as well as adjust each user's role assignments:

Configuring WebDAV to use LDAP

Since the ControlTier WebDAV repository is deployed to the same Tomcat instance as Workbench it shares the same authentication realm. Not only is it prudent to protect the WebDAV from general browser based access (e.g. by limiting which users can modify the repository), but, just as importantly, the Antdepo client requires access to the repository to upload packages and download packages and modules.

Tomcat 4.1 includes the Apache Slide WebDAV implementation. Slide security is documented in some detail here. Fine grained access control can be configured both to individual resources and methods. However, from ControlTier's perspective, establishing basic authorization for "admin" role members by adding the following entries to "$CATALINA_BASE/webapps/webdav/WEB-INF/web/xml" and restarting Tomcat is sufficient:

Note that as of ControlTier 3.1.4, enabling WebDAV authorization and authentication reveals a bug in the Package module's "upload" command's use of the WebDAV "put" Ant task. The workaround is to fall back to the "scp"-based method of uploading packages to the WebDAV.

Note: that you must have installed at least ControlTier 3.1.4 to follow these Jobcenter configuration instructions!

Modify $JOBCENTER_HOME/bin/start-jobcenter.sh script to specify "jaas-jndi.conf" in place of "jaas.conf" (this specifies the use of the "org.antdepo.webad.jaas.JNDILoginModule" JAAS login module class instead of the standard "org.antdepo.webad.jaas.PropertyFileLoginModule").

Modify "$JOBCENTER_HOME/webapps/jobcenter/WEB-INF/jaas-jndi.properties". This file has similar configuration properties to the auth.properties used inworkbench for JNDI authentication/authorization. The "connectionPassword", and "connectionUrl" should be modified as necessary. Other properties should be left alone unless the structure of the LDAP directory differs from that setup above:

Note that, as of ControlTier 3.1, Jobcenter has no intrinsic mechanism to manage authorization rights for job creation, modification or deletion. This means that anyone who has access to the Jobcenter console can change any job's configuration (even if they don't have the right to execute them). This applies to both scheduled and on-demand jobs. This functional gap will be dealt with in a future enhancement.

Controlling Jobcenter command execution authorization with Antdepo

The right of a user to execute a job from Jobcenter is synonymous with their underlying Antdepo authorization - Jobcenter literally exploits the Antdepo access control mechanism.

Antdepo access control is based on configuring the "$ANTDEPO_BASE/etc/acls.xml" file. The following DTD and default acls.xml show the scope for customizing authorization levels:

Finally, every Antdepo client installation both local and remote from the ControlTier server requires access to both Workbench and the WebDAV. The sample LDIF above specifies a user called "default" with the password "default" which has the "admin" role. This is the client framework account specified in "$ANTDEPO_BASE/etc/framework.properties":

Naturally you are at liberty (and it is probably advisable) to change this account name and password (they are specified at installation time in "defaults.properties). You should the protect the "framework.properties" file using OS authorization mechanisms.

Friday, March 28, 2008

The release includes ControlTier installer, Antdepo client and Commander extension enhancements that allow a clear distinction to be drawn between the meaning and use of node object names and their "hostname" attribute value.

Until this release, it has been the convention for the "client.hostname" property used by the installer to be used to set:

The "framework.node" property value for Antdepo

The Node object name registered by depot-setup

The Node object's "hostname" attribute also set by depot-setup in the project

With this release, the assignments are made as follows:

"client.hostname" is used to set "framework.node" and the Node object's "hostname" attribute.

A new installer property, "client.node.name", is used to set the Node object name.

(Note that both installer properties default to "${server.tomcat.hostname}" - which in turn is set to "localhost" - to maintain backward compatibility).

Drawing this distinction has a number of benefits.

From the project perspective, it is now possible to register Node objects with logically relevant names. i.e. Instead of a Node object being named using the (possibly user name qualified) network host name used to access it (e.g. "prd@w01d02.company.com"), it can use an application centric functional name (e.g. "web-server-01", or "build-box", etc).

A second benefit - and the one that really drove the timing of this change - is that it was difficult to exploit the "user@host" support introduced for "client.hostname" with 3.1 since the ProjectBuilder object XML ("projectxml") needs to translate all object names into XML element names as part of the "load-objects" command, and XML does not support element names that include the "@" character.

Thus, you can see that this enhancement tidies up a loose end in the 3.1 functionality. (Note that theses ideas are going to be further enhanced and extended under 3.2).

Here's a practical example of taking a single node (called "development") and installing the ControlTier server under one account ("anthony"), and establishing two client installations on the same system under separate accounts ("user1" and "user2").

Thursday, March 27, 2008

Damon and I just spent two days manning the ControlTier exhibit at the 2008 SaaSCon at the Santa Clara convention center.

Conferences like this are always a bit a "busman's holiday" for me presenting the chance to sell ControlTier as opposed to my normal job of delivering ControlTier solutions!

The attendees split fairly evenly into SaaS providers and SaaS users, and we quickly realized that our best approach was to sort one from the other and focus on promoting ControlTier as a solution for SaaS providers - something complementary to the other competencies and services they seek to buy in such as hosting, etc.

The first and most obvious fit for ControlTier was merely recognizing that SaaS delivery application development and deployment is just the latest generation of complex, multi-tier web based applications - only more so.

These businesses have an even greater motivation to exploit the reliability, sophistication, scaling and efficiencies that technical process automation with ControlTier brings.

The second observation is that with the advent of SaaS companies, business and technical process automation has converged, eliminating all the manual steps between service sales and delivery.

There is a real opportunity for ControlTier to play a direct (rather than supporting) role in service delivery in the case of a SaaS provider that needs to deploy new application services (e.g. a VM and any of the components above it including a real or virtual web server) in order to deliver their service.

Tuesday, March 25, 2008

Our installation documentation does a good job of describing how to establish a new ControlTier infrastructure, but there are a couple of considerations when upgrading an existing setup. Here's a reformatted version of some notes I originally posted to the ControlTier Google Group:

The process of "upgrading in place" has improved significantly over recent releases and I thought I'd document the steps here for anyone contemplating taking it on for an existing project:

Preparation

Please take the precaution of backing up your $CTIER_ROOT directory, committing any ProjectBuilder source changes you might have, and using the "Create Archive" function of the Workbench administration page to safeguard a copy of your project(s) before starting.

Software upgrade

After shutting down Workbench and Jobcenter, upgrade the ControlTier software on your ControlTier server following the installation process documented on Open.ControlTier. Many of the steps will be redundant, but you can still follow the process to safely overwrite and supplement your existing installation. Make sure you make any site-specific "default.properties" changes that may be necessary. Once the installation process is complete, you'll have an updated ".ctierrc" in place, so make sure to restart Workbench and Jobcenter from a new shell. Follow the client-only software installation process to upgrade any client systems you may have in the same manner.

Base seed upgrade

Each release of the ControlTier software comes with an updated set of base modules. These are automatically utilized when new projects are created, but existing projects need to be explicitly upgraded. The software upgrade process places the base seed archive on the ControlTier server's WebDAV at http://localhost:8080/webdav/seeds (or wherever you're running the server). With your project selected in Workbench, use the administration page's "Import Seed" function to load the "base-seed.jar" file. You'll need to repeat this for each active project in Workbench. (Note that you can also use ProjectBuilder's "load-library" command to upgrade the base seed).

Module upgrade

The final step is to bring the server and client nodes' Antdepo module cache into line with the newly updated project(s). The cleanest way to do this currently is:

Note that this approach leaves your project's deployment working files (under "$ANTDEPO_BASE/depots/myproject/deployments") completely untouched. In fact you can safely apply this upgrade while your application deployments are running.

The ControlTier 3.1 framework includes a pretty elegant set of rules and conventions for managing the options used in command handlers. Whereas prior to 3.1 the delivery of model data values into a particular command context was fairly unstructured, there is now an ordered set of steps to achieve this that offers the predictability of an established order of precedence.

By convention, the goal is to make every configurable property used by a command's implementation available via an option definition.

Each option's property (in this case "property=opts.javahome") contains a value potentially provided from one of a number of sources in the following order of precedence:

The value can be provided via the command line when the command is executed, otherwise ...

The value will be initialized from a default property (i.e. defaultproperty="entity.attribute.hsqldbRdbJavaHome") if it is specified and exists, or ...

The default value specified as an option attribute (default="${env.JAVA_HOME}") will be used.

If none of these sources are satisfied the option property is left unset, or, if the "required" attribute is set to "true", command execution fails.

This said, note how the default property is assigned using an "entity attribute" property value which arises from the Workbench project (i.e. the type/object model) as follows:

The properties intrinsic to each type can be assigned a general attribute name.

By convention, a setting type's "value" is assigned such a name (in this case the "HsqldbRdbJavaHome" setting type defines the "hsqldbRdbJavaHome" attribute naming the setting's value.

Adding the setting as an allowed singleton resource of the deployment type whose command implementation(s) wish to exploit it makes an attribute value available to objects of that type (see the constraints tab of the type page, and the properties tab of the object page for each module for the list of entity attributes).

Finally, note that entity attribute properties constructed in this fashion can receive values in the following ways:

A resource relationship is setup and the entity attribute value is imported from the setting object.

No such relationship is established and a so called "type level default attribute" value defined directly in the type.xml is used instead (the "attribute-default" value of "${env.JAVA_HOME}" in this case).

So, in summary, the value of "opts.javahome" in the example will come from one of the following sources in order of precedence:

What is CTL?CTL is a flexible distributed control dispatching framework that enables you to break management processes into reusable control modules and execute them in distributed fashion over the network.

What does CTL do?CTL helps you leverage your current scripts and tools to easily automate any kind of distributed systems management or application provisioning task. Its good for simplifiying large-scale scripting efforts or as another tool in your toolbox that helps you speed through your daily mix of ad-hoc administration tasks.

What are CTL's features?CTL has many features, but the general highlights are:

* Cross platform administration - CTL is Java-based, works on *nix and Windows.

What is CTL's relationship to other ControlTier projects?AntDepo and CTL share the same code roots. CTL is a re-factoring and enhancement of the original AntDepo code base. While AntDepo is primarily used as a component within the larger ControlTier Application Service Provisioning System, CTL is designed to be fully usable as a standalone tool.

In the future, CTL will replace AntDepo within the ControlTier Application Service Provisioning System.

If you are new to ControlTier's automation tools, CTL is definitely where you want to start.

As always, please jump on the mailing list to tell us what you think, ask questions, or provide feedback. We always love hearing from our users (seriously!).

Wednesday, March 19, 2008

I recently posted the procedure for converting modules to ProjectBuilder. This handles any Deployment and Package sub-types you may have in your Workbench project, but there is still the question of what to do about project specific Setting sub-types (Nodes are handled implicitly by depot-setup, of course).

As it turns out, there's no method of automatically converting Setting sub-types, just a set of rules and conventions we follow to manually add settings definitions to existing type.xml files:

By convention settings type definitions are added to the type.xml of the module that most logically "owns" them (i.e. usually the module that uses them).

Also by convention, we group related sets of settings as sub-types of an abstract "container" type (though this is certainly not required), so the first type to add might be something like:

Note that the only type attributes allowed for settings are "settingType", "settingValueEncrypted", "settingValue", and "referrers". This dictates what you can include in the attributes and constraints section of the type definition.

One thing to bear in mind is that constraint references to types that are defined in separate modules (most often the case with Setting sub-types) are resolved only when all the types are loaded into the project. Using ProjectBuilder's "load-library" command (or loading a seed from the Workbench administration page) is the most obvious way to achieve this without the order in which modules are added to the project being significant.

Friday, March 07, 2008

[Edit: also see the demo section of the ControlTier Wiki for an up to date version of this]

(It was when I posted these notes to our Google group that I realized that there's real value in being able to post HTML. With that in mind. I'm re-posting here complete with links and formatting!)

These notes document using the ControlTier Elements Solution Library to build and deploy Sun's "Duke's Bank" sample application (from their J2EE 1.4 Tutorial) to JBoss 4.0.3SP1 following the "Getting Started with JBoss 4.0" guide. I've tested the project on Windows 2003 Server R2 and CentOS 4.5 (and it can also be easily adapted to run on other Unix/Linux platforms). You'll need around 4GB of disk space and 1GB of memory on a reasonably up-to-date system.

The basic idea was to implement the instructions from chapter 4 as a Workbench project building and deploying the sample application to a development environment on the (single) node (localhost) that's also running Workbench and Jobcenter.

1) Install

Install the latest version of the Java 1.5 SDK available from Sun into "$CTIER_ROOT/pkgs" (for use both by ControlTier - instead of Java 1.4 - and the Dukes Bank application).

Download the Elements Solution Library 1.0 seed from Sourceforge and "Import" it using the Workbench administration page (note that you can also check out the library's source and use ProjectBuilder to build and load the library).

2) Configure

Configure a ProjectBuilder object and download from Sourceforge and load into Workbench either the Linux or Windows version of the objects as required (note that on Unix/Linux it is assumed installation will occur to "~/dukesbank", while on Windows to "C:\dukesbank") by cutting and pasting the appropriate commands:

Download the required third-party packages from the Internet and upload them to Workbench via their "PlatformZip" and "JBossZip" object pages: apache-ant-1.7.0-bin.zip, J2EE 1.4 Tutorial Update 7, jbossj2ee-src.zip (note that you must unpack the required Zip archive from the downloaded Zip), and jboss-4.0.3SP1.zip. (Note: Make sure that you set the DAV directory path to "/pkgs/DukesBank/zip/zips" to match the object XML when uploading the package files).

If you don't want to go through this setup process, I've prepared a CentOS 4.5 VMware virtual machine with the demonstration installed and ready to roll that I plan to post to Sourceforge imminently. I'll also post the DukesBank project archive file if you'd like to avoid the type/object model setup steps and cut right to the chase finishing up configuration and running the demonstration.

New development will proceed on the 2.0 branch aimed at integrating an out of the box end-to-end Java Server build and deployment solution based on:

CVS and Subversion source code control

Cruise Control based continuous integration

Ant and Maven based builds

Tomcat and JBoss application servers

HSQLDB and Derby Java based databases

In addition, we plan to formally integrate and document the Duke's Bank sample application as a demonstration application.

By the way, I'm the only one who likes the name "elements" it seems, but there doesn't seem to be any constructive alternative "short" names out there that aren't acronyms that have already been grabbed by the Java guys (JSSL, JSL, etc)!

The "full" name of the library is "Java Server Module Library". Any ideas for a catchy moniker that could supplant "elements" in the source base, etc? Or, like me, are you satisfied with the "elemental" appropriateness of the existing name? Or, more likely, do give a toss at all?

Thursday, March 06, 2008

ProjectBuilder is one of the key new features of ControlTier 3.1. This base type allows architects and administrators to manage their projects as a set of (XML) source using development tools of choice as opposed to solely using Workbench.

The thing is, many people already have sets of modules created under Workbench and therefore need to convert them for use with ProjectBuilder. Since this process is not currently well documented on Open.ControlTier, here's a quick cheat sheet:

Setup a minimal ProjectBuilder object for your project. By convention, the ProjectBuilder is given a library name ("mymodules" in this case) that reflects the combined intent of the set of modules it manages.

By the way, the base directory is usually put under source code control to provide version management for the module source. A good example of this is the structure of the Elements Module Library source on ModuleForge.

Create the minimal base directory structure:

$ mkdir -p $CTIER_ROOT/src/mymodules/modules

Copy in the latest version of your module(s) from Workbench's WebDAV working directory (Note that these commands assume you are setting up a ProjectBuilder development environment on the same system where Workbench is deployed. This need not always be the case):