Securing applications during assembly and deployment
Several assembly tools exist that are graphical user interfaces for assembling enterprise or Java™ Platform, Enterprise Edition (Java EE) applications. You can use these tools to assemble an application and secure Enterprise JavaBeans (EJB) and web modules in that application.
About this task
To secure an EJB module, a Java archive (JAR) file, a web module, a web application archive (WAR) file, or an application enterprise archive (EAR) file, you can use an assembly tool. You can create an application, an EJB module, or a web module and secure them using an assembly tool or development tools such as the IBM® Rational® Application Developer.
Procedure
- Secure EJB applications by using an assembly tool. For more information, see Securing enterprise bean applications.
- Secure web applications by using an assembly tool. For more information, see Securing web applications using an assembly tool.
- Add users and groups-to-roles while assembling a secured application using an assembly tool. For more information, see Adding users and groups to roles using an assembly tool.
- Map users to RunAs roles using an assembly tool. For more information, see Mapping users to RunAs roles using an assembly tool.
- Adding the was.policy file to applications for Java 2 security.
- Assemble the application components that you secured using an assembly tool. For more information, see Assembling applications.
Results
After securing an application, the resulting .ear file contains security information in its deployment descriptor. The EJB module security information is stored in the ejb-jar.xml file and the web module security information is stored in the web.xml file. The application.xml file of the application EAR file contains all the roles that are used in the application. The user and group-to-roles mapping is stored in the ibm-application-bnd.xmi file of the application EAR file.

不過,即使應用程式含有 Java EE 5 之前的檔案,且所用的副檔名是 .xmi,其中也可以有 Java EE 5 或更新版本的模組。
ibm-webservices-ext.xmi、ibm-webservices-bnd.xmi、ibm-webservicesclient-bnd.xmi、ibm-webservicesclient-ext.xmi 和 ibm-portlet-ext.xmi 檔會繼續使用 .xmi 副檔名。
sptcfgThe was.policy file of
the application EAR contains the permissions that are granted for
the application to access system resources that are protected by Java 2 security.
This task is required to secure EJB modules and web modules in an application. This task is also required for applications to run properly when Java 2 security is enabled. If the was.policy file is not created and it does not contain required permissions, the application might not be able to access system resources.