03.05.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.1 Securing EJBs<br />

EJBs, or Enterprise Java Beans, are J2EE components which implement the<br />

business logic of an application. They typically have access to sensitive data,<br />

and it is very important to understand how security is applied to these resources.<br />

There are three types of EJBs:<br />

1. Session Beans, which represent clients inside the J2EE server. Clients call<br />

session bean methods to access an application.<br />

2. Entity Beans, which represent persistent business objects in an application’s<br />

relational database. Typically, each entity bean has an underlying table in the<br />

database, and each instance of the bean corresponds to a row in that table.<br />

3. Message-Driven Beans, which allow J2EE applications to process messages<br />

asynchronously. Message-driven beans’ methods are invoked by the<br />

application server runtime as part of message queue processing.<br />

Important: Since queued messages generally do not have any<br />

authentication information associated with them, authentication information<br />

is unavailable to message-driven beans’ methods. As a result, securing<br />

message-driven beans from unauthorized access is really a matter of<br />

securing the message queue.<br />

<strong>Security</strong> can be applied to EJBs in the following ways:<br />

► Access control can be applied to individual session and entity bean methods<br />

so that only callers who are members of particular security roles can call<br />

those methods.<br />

► Session and entity bean methods which need to be aware of the role or<br />

identity or the caller can programmatically call the J2EE API methods<br />

isCallerInRole and getCallerPrincipal to determine a caller’s role and<br />

principal, respectively. When using isCallerInRole, security role references<br />

are used, which are later mapped to security roles.<br />

Note: If <strong>WebSphere</strong> security is not enabled, or if the EJB is not a protected<br />

resource, isCallerInRole will return false and getCallerPrincipal will return<br />

UNKNOWN.<br />

Note: See below for details on how security role references are<br />

administered for EJBs. Programmatic security is covered in detail in<br />

Chapter 8, “Programmatic security” on page 179.<br />

74 <strong>IBM</strong> <strong>WebSphere</strong> <strong>V5.0</strong> <strong>Security</strong> Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!