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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Struts supports multiple mechanisms to map URIs for different actions; there are<br />

two common approaches to define the URIs that will be processed by the<br />

controller servlet - prefix matching and extension matching.<br />

►<br />

►<br />

Prefix matching means that you want all URIs that start with a particular value<br />

to be passed to this servlet, for example:<br />

http://www.xyz.com/myapp/execute/myaction.<br />

Extension mapping, on the other hand, matches request URIs to the action<br />

servlet based on the fact that the URI ends with a period followed by a<br />

defined set of characters. For example, the JSP processing servlet is mapped<br />

to the *.jsp pattern so that it is called to process every JSP page that is<br />

requested. In the case of Struts, we can map actions to the .do extension, that<br />

implies, “to do something”; the URL looks like the following:<br />

http://www.xyz.com/myapp/myaction.do<br />

In any case, the actions are differentiated based on URIs, although only one<br />

servlet performs the action. You have to make sure that you protect all the<br />

required URIs for your application for all the actions with Struts. Just because<br />

you will only have only one servlet mapping, this does not mean you only have to<br />

set up one constraint. The only difficulty with Struts and with these approaches is<br />

that you have to design and administer your security constraints for your Web<br />

application very carefully, just as in any other case of security design. It is easy<br />

not to secure or to set wrong access control to a sensitive resource and leave a<br />

security hole in your application.<br />

You can also protect your resources based on URL patterns using a security<br />

reverse proxy in your infrastructure, for example via Tivoli Access Manager’s<br />

WebSEAL.<br />

Page expiration<br />

This is a useful tip that you might want to keep in mind. The pages that are<br />

served from application servers are cached at least on the client side, regardless<br />

of whether the resource was secured or not.<br />

It will be a problem in a live system, where sensitive information can be found in<br />

the cache.<br />

It is definitely a problem during development, when security settings were<br />

changed for the Web module but the Web browser is still showing the pages from<br />

the cache without going out to the server and getting the latest content, so that<br />

no authentication or authorization check is performed. In this case, you can<br />

simply set your browser to not cache pages and always send a request.<br />

Chapter 4. Securing Web components 71

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

Saved successfully!

Ooh no, something went wrong!