Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, Version 2.0 - Sun Microsystems.pdf
Скачиваний:
14
Добавлен:
24.05.2014
Размер:
2.71 Mб
Скачать

Sun Microsystems Inc.

Security management

Enterprise JavaBeans 2.0, Public Draft

EJB Client Responsibilities

20.5 EJB Client Responsibilities

This section defines the rules that the EJB client program must follow to ensure that the security context passed on the client calls, and possibly imported by the enterprise bean, do not conflict with the EJB Server’s capabilities for association between a security context and transactions.

These rules are:

A transactional client cannot change its principal association within a transaction. This rule ensures that all calls from the client within a transaction are performed with the same security context.

A Session Bean’s client must not change its principal association for the duration of the communication with the session object. This rule ensures that the server can associate a security identity with the session instance at instance creation time, and never have to change the security association during the session instance lifetime.

If transactional requests within a single transaction arrive from multiple clients (this could happen if there are intermediary objects or programs in the transaction call-chain), all requests within the same transaction must be associated with the same security context.

20.6EJB Container Provider’s responsibilities

This section describes the responsibilities of the EJB Container and Server Provider.

20.6.1 Deployment tools

The EJB Container Provider is responsible for providing the deployment tools that the Deployer can use to perform the tasks defined in Section 20.4.

The deployment tools read the information from the deployment descriptor and present the information to the Deployer. The tools guide the Deployer through the deployment process, and present him or her with choices for mapping the security information in the deployment descriptor to the security management mechanisms and policies used in the target operational environment.

The deployment tools’ output is stored in an EJB Container specific manner, and is available at runtime to the EJB Container.

20.6.2 Security domain(s)

The EJB Container provides a security domain and one or more principal realms to the enterprise beans. The EJB architecture does not specify how an EJB Server should implement a security domain, and does not define the scope of a security domain.

A security domain can be implemented, managed, and administered by the EJB Server. For example, the EJB Server may store X509 certificates or it might use an external security provider such as Kerberos.

5/31/00

420

Sun Microsystems Inc

EJB Container Provider’s responsibilities

Enterprise JavaBeans 2.0, Public Draft

Security management

The EJB specification does not define the scope of the security domain. For example, the scope may be defined by the boundaries of the application, EJB Server, operating system, network, or enterprise.

The EJB Server can, but is not required to, provide support for multiple security domains, and/or multiple principal realms.

The case of multiple domains on the same EJB Server can happen when a large server is used for application hosting. Each hosted application can have its own security domain to ensure security and management isolation between applications owned by multiple organizations.

20.6.3 Security mechanisms

The EJB Container Provider must provide the security mechanisms necessary to enforce the security policies set by the Deployer. The EJB specification does not specify the exact mechanisms that must be implemented and supported by the EJB Server.

The typical security functions provided by the EJB Server include:

Authentication of principals.

Access authorization for EJB calls and resource manager access.

Secure communication with remote clients (privacy, integrity, etc.).

20.6.4 Passing principals on EJB calls

The EJB Container Provider is responsible for providing the deployment tools that allow the Deployer to configure the principal delegation for calls from one enterprise bean to another. The EJB Container is responsible for performing the principal delegation as specified by the Deployer.

The EJB Container must be capable of allowing the Deployer to specify that the caller principal is propagated on calls from one enterprise bean to another (i.e. the multiple beans in the call chain will see the same return value from getCallerPrincipal()).

This requirement is necessary for applications that need a consistent return value of getCallerPrincipal() across a chain of calls between enterprise beans.

The EJB Container must be capable of allowing the Deployer to specify that a runAs principal be used for the execution of the home and remote methods of a session or entity bean or for the onMessage method of a method-driven bean.

20.6.5 Security methods in javax.ejbEJBContext

The EJB Container must provide access to the caller’s security context information from the enterprise beans’ instances via the getCallerPrincipal() and isCallerInRole(String roleName) methods. The EJB Container must provide this context information during the execution of a business method invoked via the enterprise bean’s remote or home interface, as defined in Table 2 on page 68, Table 3 on page 78, Table 4 on page 151, and Table 7 on page 229.

421

5/31/00

Sun Microsystems Inc.

Security management

Enterprise JavaBeans 2.0, Public Draft

EJB Container Provider’s responsibilities

The Container must ensure that all enterprise bean method invocations received through the home and remote interface are associated with some principal. The Container must never return a null from the getCallerPrincipal() method.

20.6.6 Secure access to resource managers

The EJB Container Provider is responsible for providing secure access to resource managers as described in Subsection 19.4.3.

20.6.7 Principal mapping

If the application requires that its clients are deployed in a different security domain, or if multiple applications deployed across multiple security domains need to interoperate, the EJB Container Provider is responsible for the mechanism and tools that allow mapping of principals. The tools are used by the System Administrator to configure the security for the application’s environment.

20.6.8 System principal

The EJB specification does not define the “system” principal under which the JVM running an enterprise bean’s method executes.

Leaving the principal undefined makes it easier for the EJB Container vendors to provide the runtime support for EJB on top of their existing server infrastructures. For example, while one EJB Container implementation can execute all instances of all enterprise beans in a single JVM, another implementation can use a separate JVM per ejb-jar per client. Some EJB Containers may make the system principal the same as the application-level principal; Others may use different principals, potentially from different principal realms and even security domains.

20.6.9 Runtime security enforcement

The EJB Container is responsible for enforcing the security policies defined by the Deployer. The implementation of the enforcement mechanism is EJB Container implementation specific. The EJB Container may, but does not have to, use the Java programming language security as the enforcement mechanism.

For example, to isolate multiple executing enterprise bean instances, the EJB Container can load the multiple instances into the same JVM and isolate them via using multiple class-loaders, or it can load each instance into its own JVM and rely on the address space protection provided by the operation system.

The general security enforcement requirements for the EJB Container follow:

The EJB Container must provide enforcement of the client access control per the policy defined by the Deployer. A caller is allowed to invoke a method if, and only if, the caller principal is assigned at least one of the security roles that includes the method in its method permissions definition. (That is, it is not meant that the caller must be assigned all the roles associated with the method.) If the Container denies a client access to a business method, the Container must throw the java.rmi.RemoteExcetion to the client.

5/31/00

422