Anil Saldhana is the Lead Identity Management Architect at JBoss. He blogs at http://anil-identity.blogspot.com Anil has posted 16 posts at DZone. You can read more from them at their website. View Full User Profile

Security Features of JBoss AS 5.1 - Part 1 - Simplified Security Domain Configuration

06.05.2009
| 29923 views |
  • submit to reddit

JBoss Application Server is a LGPL licensed open source Java EE compliant application server. The v5.1.0 was released recently and can be downloaded from the link in the resources section below.

Historically, the default security domain configuration in JBoss Application Server has been the login-config.xml in the conf directory of your favorite server configuration (default, all etc). The next evolution for an hot deployable configuration was the DynamicLoginConfig mbean service that allowed users to deploy their security domain configuration as part of their application deployment (security domains get deployed when the app deploys and undeploy when the app undeploys).

What are security domains?

The key driver for security for Java EE components such as Web or EJB Components in JBoss Application Server is the concept of a 'security domain'. The security domain is an abstract concept that defines the authentication, authorization, audit, mapping etc. modules in JBoss Application Server 5.

Since JBoss AS 5.x is based on the JBoss Microcontainer, we had an opportunity to provide an additional simplified approach to security domain configuration. This feature exists as of JBoss Application Server v5.0.

There are actually three steps involved in this.

Step 1: Define a file of the format xxx-jboss-beans.xml (Note: xxx can be anything you want, such as, customer-app-jboss-beans.xml etc)

Step 2: Add the following pattern to this file.

<?xml version="1.0" encoding="UTF-8"?>

<deployment xmlns="urn:jboss:bean-deployer:2.0">

<application-policy xmlns="urn:jboss:security-beans:1.0" name="web-test">
<authentication>
<login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required">
<module-option name = "unauthenticatedIdentity">anonymous</module-option>
<module-option name="usersProperties">u.properties</module-option>
<module-option name="rolesProperties">r.properties</module-option>
</login-module>
</authentication>
</application-policy>

<application-policy xmlns="urn:jboss:security-beans:1.0" name="ejb-test">
<authentication>
<login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required">
<module-option name = "unauthenticatedIdentity">anonymous</module-option>
<module-option name="usersProperties">u.properties</module-option>
<module-option name="rolesProperties">r.properties</module-option>
</login-module>
</authentication>
</application-policy>

</deployment>

Step 3: Either deploy this file directly into the deploy folder or package it as part of your ejb jar (in META-INF) or your web application (war).

You can use any of the login modules that ship with JBoss AS 5.x. More information is available at JBossSX Wiki. Of course you can use your own login modules.

In this example, we have defined two security domains, namely "web-test" and "ejb-test"

Acknowledgement
Thanks to JBoss Security team member, Stefan Guilhen for getting this feature done.

Resources
1) http://server.dzone.com/articles/security-auditing-jboss
2) http://www.jboss.org/community/wiki/DynamicLoginConfig
3) http://www.jboss.org/jbossas/downloads/

4) http://anil-identity.blogspot.com/2009/05/as5-specifying-security-domain.html

 

About the Author

Anil Saldhana is the lead security architect at JBoss. He blogs at http://anil-identity.blogspot.com

Published at DZone with permission of its author, Anil Saldhana.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

sub online replied on Fri, 2009/06/26 - 3:15am

That company wasted too much time fighting its own.links of londonDon't blow it.I'm so hurry that I could eat a horse.You're so retarded.Tiffany JewelleryYou be the judge.Bring it on.What now!Don't repeat everything I say.Who did I piss off?links of londonWell what do you want!Ingrate.Why are you yelling?

john andy replied on Thu, 2009/09/17 - 12:34am

web security is compulsory for our web pages. we can secure our web pages using by some hard wear device an also using some tiered party software. Its depend on us how can we want secure our web page.

john

pci compliant

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.