ServiceMix Security Features
Essentially, security in ServiceMix is provided on two levels:
- Authentication and authorization via JAAS or custom procedures.
- Securing the transport of messages, e.g. via SSL or WS-Security.
Authentication
JAAS authentication has to be done at the Endpoint where the message
in question entered the ESB. It is the responsibility of the Endpoint
where the message entered to set the Subject, as this will later be utilized for authorization.
In the servicemix-http component, this can be done via the
configured
AuthenticationService.
There is also a way for utilizing basic authentication via the Jakarta Commons HttpClient API.
Authorization
In order to allow for authorization, the SecuredBroker has to be configured as the Container's broker:
<sm:container id="jbi" rootDir="./target/data/smx">
<!-- Use a secured broker which will check the authenticated
user for the needed ACLs before granting access to a given
endpoint -->
<sm:broker>
<sm:securedBroker>
<!-- Can be referenced from security.xml, too -->
<sm:authorizationMap>
...
</sm:authorizationMap>
</sm:securedBroker>
</sm:broker>
<sm:activationSpecs>
...
</sm:activationSpecs>
</sm:container>
Before routing Message Exchanges, the
SecuredBroker
checks them against access control lists generated from the AuthorizationMaps. A precondition is that the Message Exchange objects have previously been authenticated.
Securing transport
This mostly relates to securing SOAP over HTTP transports on the servicemix-http binding component. It provides both for SSL and WS-Security. At the time of writing, not all of the WS-Security features are yet supported.
Security Configuration
Below the ServiceMix root directory, one can find a directory containing configuration files:
This directory contains the following security-relevant files:
- users-passwords.properties: A file specifying passwords for users.
#syntax: username=password
#users
manager=system
userh1.=userh1.pw
user2=user2pw
- groups.properties: A file relating users to groups.
#syntax: groupname=membername
admin=manager
secure=userh1.
- login.properties: A JAAS configuration file.
- keystore.jks: A keystore.
Example
The ServiceMix source distribution (3.1) comes with the WS-Sec example, which illustrates both basic authentication and WS-Security. It can be found in:
$SERVICEMIX_HOME/samples/ws-sec