<requestFlow>
<handler type="URLMapper"/>
<handler type="HandleResolverHandler"/>
<handler type="java:org.globus.ogsa.impl.security.authentication.AuthenticationServiceHandler"/>
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.wssec.WSSecurityHandler"/>
</handler>
<handler type="java:org.globus.ogsa.impl.security.authentication.SecurityPolicyHandler"/>
<handler type="java:org.globus.ogsa.impl.security.authorization.AuthorizationHandler"/>
<!-- optional: only needed for credential refresh functionality -->
<handler type="java:org.globus.ogsa.impl.security.authentication.CredentialRefreshHandler"/>
<!-- additional handlers -->
</requestFlow>
<responseFlow>The gsi/AuthenticationService service must also be deployed.
<!-- additional handlers -->
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.X509SignHandler"/>
</handler>
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.GSSHandler"/>
</handler>
</responseFlow>
<requestFlow>
<!-- additional handlers -->
<handler type="java:org.globus.ogsa.handlers.OnceInvocationHandler"/>
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.X509SignHandler"/>
</handler>
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.SecContextHandler"/>
<parameter name="authService"
value="auto"/>
</handler>
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.GSSHandler"/>
</handler>
</requestFlow>
<responseFlow>Note: All these client-side, server-side handlers and the gsi/AuthenticationService service are installed by default.
<handler type="java:org.globus.ogsa.utils.JAXRPCHandler">
<parameter name="className"
value="org.globus.ogsa.impl.security.authentication.wssec.WSSecurityClientHandler"/>
</handler>
<!-- additional handlers -->
</responseFlow>
To enable GSI Secure Conversation security set the Constants.GSI_SEC_CONV
property to either Constants.SIGNATURE or Constants.ENCRYPTION
to indicate the desired message level protection.
The GSI properties such as GSIConstants.GSI_MODE,
GSIConstants.GSI_CREDENTIALS, and Constants.AUTHORIZATION can
be used to configure the GSI Secure Conversation message level security.
The actor of the GSI signed/encrypted message can be set using the "gssActor" property.
To enable GSI XML Signature security set the Constants.GSI_XML_SIGNATURE to Boolean.TRUE.
The GSI properties such as GSIConstants.GSI_CREDENTIALS, and Constants.AUTHORIZATION
can also be used to configure the GSI XML Signature message level security.
The actor of the signed message can be set using the "x509Actor" property.
The above properties are set in the exact same way as the other GSI
properties. Please see section 5.1 for details.
import org.globus.ogsa.impl.security.SecurityManager;
...
public void serviceMethod() {
SecurityManager.getManager().setServiceOwnerFromContext(this);
}
...
import org.globus.ogsa.impl.security.SecurityManager;
...
public void serviceMethod() {
String identity = SecurityManager.getManager().getCaller();
}
...
import javax.security.auth.Subject;The invocation Subject depends on the run-as policy specified in the security descriptor. If no security descriptor is set for the service, the invocation Subject will be null. The Subject object contains authentication and authorization artifacts such as principals, public and private credentials.
import org.globus.gsi.jaas.JaasSubject;
...
public void serviceMethod() {
Subject subject = JaasSubject.getCurrentSubject();
}
...
Each service can also be configured with a separate set of credentials. This is done by adding either <parameter name="serviceProxy" value="<proxy file>"/> element or <parameter name="serviceCert" value="<certificate file>"/> and <parameter name="serviceKey" value="<unencrypted key file>"/> elements to the <service> block of the service in the server-config.wsdd file. Global credentials (container credentials) can also be specified in the <globalConfiguration> block in similar way by adding "containerProxy" parameter or "containerCert" and "containerKey" parameters. A service will first check for the credential parameters in the <service> section. If no credential parameters are defined in the <service> section, the service will check the <globalConfiguration> block next. If no credentials are defined in either places, the service will rely on the underlying security library to acquire credentials (the security library will try to load a proxy certificate of the user that is running the container). If the credential files change during the runtime they will be automatically reloaded.
A separate set of trusted CA certificates can also be configured for each
service. This is done by adding <parameter name="trustedCertificates"
value="<CA certificate locations>"/> element to the
<service> block of the service in the server-config.wsdd file.. Global CA certificates can also be
specified in the <globalConfiguration> block in the same way. The
<CA certificate locations> can be a comma separated list of individual
certificate files or directories contains certificates (files ending with
.<digit> extension) A service will first check for the trustedCertificates
parameter in the <service> section. If no such parameter is defined
in the <service> section, the service will check the <globalConfiguration>
block next. If no trusted certificates are defined in either places, the
service will rely on the underlying security library to find the certificates.
The "trustedCertificates" parameter is currently ignored.
Each service can be configured with a separate authorization mechanism.
Currently, there are three supported authorization mechanisms: none, self, and gridmap. The authorization mechanism of a service is configured by setting an "authorization" parameter in the service deployment descriptor, for example: <parameter name="authorization" value="self"/>
Authorization checks are only performed for authenticated clients. All authorized clients have the same access to all methods of a service.
If the "authorization" parameter is set to "none" no authorization is performed. If the "authorization" parameter is set to "self" only
the clients with the same identity as the service are allowed to access the
service (if the service does not have its own identity, the system identity
is used instead for authorization). If the "authorization" parameter is set to "gridmap", gridmap file authorization is performed. A "gridmap" property
pointing to the girdmap file location must be either specified in the <service>
section or in the <globalConfiguration> section of the deployment descriptor.
If the "authorization" parameter is not defined in the service deployment descriptor, and the "gridmap" property
is not defined in the <service> or <globalConfiguration> section
of the deployment descriptor, self authorization is performed. If the "authorization" parameter is not defined in the service deployment descriptor, but the "gridmap" property
is defined in the <service> or <globalConfiguration> section
of the deployment descriptor, gridmap authorization is performed.
For services configured to perform gridmap file authorization, the gridmap file can be updated dynamically using the SecurityManager API. Also, if the gridmap file changes during the runtime it will be automatically reloaded.
<parameter name="securityConfig" value="org/globus/ogsa/impl/security/descriptor/gsi-security-config.xml"/>The security deployment descriptor is loaded in the same way as any other resource data (from the classpath). This allows the security descriptor to be included in the same .jar file as rest of the service code.
<securityConfig xmlns="http://www.globus.org">In the above example, the findServiceData() operation does not require any authentication while the destroy() operation requires either public key or GSI secure conversation with integrity protection authentication. Any other operation must be authenticated with GSI secure conversation with either privacy or integrity protection.
<method name="ogsi:findServiceData" xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI">
<auth-method>
<none/>
</auth-method>
</method>
<method name="ogsi:destroy" xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI">
<auth-method>
<pkey/>
<gsi>
<protection-level>
<integrity/>
</protection-level>
</auth-method>
</method>
<!-- default auth-method for any other method -->
<auth-method>
<gsi/>
</auth-method>
</securityConfig>
<securityConfig xmlns="http://www.globus.org">In the above example, the findServiceData() operation will be executed with caller's identity while the destroy() call will be run with system identity. Any other operation will be run with the service identity (if the service has one set).
<method name="ogsi:findServiceData" xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI">
<run-as>
<caller-identity/>
</run-as>
</method>
<method name="ogsi:destroy" xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI">
<run-as>
<system-identity/>
</run-as>
</method>
<!-- default run-as for any other method -->
<run-as>
<service-identity/>
</run-as>
</securityConfig>
A credential of the service can be refreshed if:
Use the "Secure" type of the notification sink manager to receive notifications:
NotificationSinkManager manager = NotificationSinkManager.getInstance("Secure");
The security properties can be set on the callback itself:
NotificationSinkCallback callback = ...;A security deployment descriptor can also be configured by setting the "securityConfig" property, e.g.:
callback.setProperty(GSIConstants.GSI_CREDENTIALS, cred);
...
callback.setProperty("securityConfig", "myservice/my-security-config.xml");
Please see section 4.4 for details. By default, the gsi-security-config.xml is used.The security properties must be passed in a separate Map object to the appropriate notify() function.
For GSI Secure Conversation, the same ServiceLocator instance cannot be called from multiple threads at the same time or shared between two different services. A security context is currently associated with a ServiceLocator instance. If the same ServiceLocator instance is used from multiple threads or shared between two different services a wrong security context might be used to sign/encrypt a request. A simple workaround for this problem is to use separate ServiceLocator instances.
The activation of persistent services is not executed under any run-as identity. Wrong credentials might be used if the service is making an outbound connection during the activation. JAAS API might be used to set the right identity for the outbound connection.
Since the security context for GSI Secure Conversation is associated with a ServiceLocator instance and reused between calls on the same service it is possible that the service itself might get deactivated in-between the calls. In that case a Invalid GSI Secure Conversation context error might be raised. A simple workaround for this problem is to use separate ServiceLocator instances.
The service' method is calling SecurityManager.setOwnerFromContext() but the run-as identity of the method is not set. The service is probably missing a security deployment descriptor.
The service' method is calling SecurityManager.setOwnerFromContext() but the run-as identity of the method does not contain private credentials. If the method is run under the "callers-identity" make sure the client calling the service uses GSI Secure Conversation and enables delegation for the call.