Introduction
Different applications and environments have different security requirements. To help categorize the security needs of your application better, you need to look at some of the basic underlying principles on which security is based for most applications.
Physically Separated Tiers
An important part of the implementation of the security infrastructure is the physical separation of the data, application, and web servers. These servers all run on different tiers, and it is best if all three tiers are implemented on different physical machines. The Web server is typically on a machine that has dedicated internet access. This tier is usually the gatekeeper for client requests from outside the organization’s network. Client applications running on remote machines access the web server via the internet to request access to the application tier.
The application server is usually on a physical machine separate from the machine housing the web server. The application tier typically cannot be accessed directly by remote clients from the internet. These days, many vendors provide implementations where the Web Server is incorporated into the EJB server. While these implementations provide faster performance and easier maintenance for system administrators, they are a potential security risk. Since both the web server and application server are housed together, if a hacker gains access to the webserver, it will be easier for the application server to be exposed as well, as it is also running on the machine that has direct internet access.
The data server runs on a separate that may also be running ERP systems. The data server is the repository of the entire system. The data server should be well-protected within the organization’s network. Precautions, such as encrypting the information stored in the database via systems, are one way of countering potential information breaches. Such encryption systems should be run on separate machines that are not connected to the internet. This will mean a slight loss in performance, but will lead to increase in protection for the data.
Figure 1 below illustrates a physical network topology for a typical EJB application. The Web-tier between both the firewalls is most in danger from intruders and hackers.
Figure1: EJB Application Network Topology
User-level Access Based on Username/Password
Another common way to implement security in EJB systems is to authenticate users using a username and password. This method relies on maintaining security by allowing the username and password to be the only two pieces of information provided by the end-user. Applications use digital certificates to protect the user’s authentication details. Digital certificates use the Secure Socket Layer (SSL) to protect data sent via web browsers. SSL makes use of an SSL-compatible variant of the HTTP protocol, called the HTTPs protocol.
Usually, certificates are installed only on the web server and not on the clients machine. If the client also has a certificate and provide it as a means of authentication. It is known as a case of mutual authentication, as each party can authentication the other. This is more common in B2B applications than in B2C applications.
Different vendors
EJB developers can select products from different vendors while building their EJB application environment. Interoperability is one of the main goals of EJB architectures and the EJB and J2EE specifications provide strict guidelines for interoperability between different components in the EJB application. Achieving interoperability between security products in the same application however, throws many challenges. You may find it difficult to use different security products, which follow the same security specification, together, unless they have been developed by the vendors in collaboration.
This problem is often overcome by using the SSL as a standard for security interactions between system tiers. As J2EE uses RMI/IIOP to communicate between clients and containers. IIOP can be stacked on top of SSL.
Sensitive and Non-Sensitive Data
The choice of security measures being implemented also depends on the kind of data being exchanged , and what parties it is being exchanged between. Applications often implement secure modes such as HTTPS only when sensitive data is being transmitted. This can be data such as credit-card numbers or username/passwords.
The choice of when to use what security mode is made during the design of the system. Designers choose what data to secure and how to security is, only after looking at the degree of sensitivity and vulnerability of data being transferred.
J2EE Security Architecture
The J2EE security architecture specifications are based on certain security requirements as well as non-requirements.
Requirements
The J2EE security architecture of the J2EE specifications are based on certain security requirements.
Flexibility
The security mechanisms and declarations of applications should not be used to impose any security policy, but only to help in implementation of over-all security policies specific to the particular J2EE installation.
Transparency
The security policies of the J2EE implementation need not be visible to the Bean providers who write the beans.
Demarcation
There is complete demarcation of responsibilities between the deployer and the system administrator . The deployer establishes the authentication and access control on the J2EE implementation and the system administrator manages the same.
Portability
The J2EE security architecture must not compromise Java policy on application portability. J2EE applications that need access to information available in the security environment, make use of APIs for interacting with container/server information. Only those applications that restrict their interactions to the provides APIs manage to retain portability.

Join the conversation! Your thoughts help the community grow.