Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Java certification success, Part 4: SCEA

Sivasundaram Umapathy (authors@whizlabs.com), Programmer, Sella Synergy India Limited
Sivasundaram Umapathy holds a bachelor of engineering degree in computer science from the University of Madras and a master of science degree in software systems from BITS, Pilani. He is presently associated with Sella Synergy India Limited, India, the software division of Banca Sella, S.p.A, where he designs and develops mission-critical banking applications using the BEA WebLogic application server. He is also crazy about certifications, with SCJP, SCBCD, SCWCD 1.4, SCMAD, SCEA, OCA, BEA WL7, IBM, and PMP certifications to his credit. He has authored the Whizlabs SCWCD 1.4 and co-authored the Whizlabs SCMAD exam simulators. He actively participates in the open source movement in his free time and is in an expert group member of JSR 244 (J2EE 5.0) and JSR 245 (JSP 2.1).

Acknowledgements

I wish to thank my friend and colleague Mrs. Rajeswari for her support and suggestions in completing this tutorial.

Summary:  This tutorial aims to help SCEA certification aspirants clear the first part of the SCEA certification exam, a knowledge-based, multiple-choice exam. The tutorial introduces the reader to the concepts and then builds upon them to cover other topics such as common architectures, legacy connectivity, Enterprise JavaBeans technology, the Enterprise JavaBeans container model, protocols, applicability of J2EE technology, design patterns, messaging, internationalization, and security. Readers' understanding is then reinforced through examples and practice questions and guides them to various useful resources for SCEA certification exam preparation.

Date:  16 Aug 2005
Level:  Intermediate PDF:  A4 and Letter (1372 KB | 89 pages)Get Adobe® Reader®

Activity:  45052 views
Comments:  

Security

Security introduction

Security has become a prime concern these days due to the financial damages caused by malicious hack attacks. As an architect, you should be in a position to minimize these attacks by building a robust security model for your application. In this section, we briefly introduce to the Java 2 security model and the security restrictions on applets. Later, we discuss important security concepts, such as authentication, authorization, symmetric and asymmetric encryption algorithms, and digital signatures and certificates. We end this section with a discussion on topologies.


Java 2 security model

In JDK 1.1, any downloaded code, such as applets, was considered untrusted and consequently run in a restricted sandbox, whereas local applications and signed applets were given full access to the system resources. The Java 2 security model changes this coarse-grained approach to a fine-grained, policy-driven approach. When code is loaded, a policy file is read, and the allowed permissions are granted to the code. The permissions can be anything from read or write access to a directory to connect permission to a host computer. Code can access the resource only if it has been granted the required permissions for accessing that resource. Permission classes are extensible, so custom permissions and properly configured policy files provide the required granularity of security.

Applet security

Applets are Java programs that run inside the Web browser. They are typically embedded in a Web page to add dynamic behavior. Applets are loaded with a restrictive policy file. The most important restrictions are:

  • Making network connections to arbitrary hosts other than the originating host.

  • Reading/writing on the client file system.

  • Starting other programs on the client.

  • Loading native libraries.

  • Defining native methods.

  • Any operation that could be detrimental to the client system. (This excludes attacks such as excessive usage of CPU, memory, and network resources, as they can be handled at the OS level.)

It is important to know that these restrictions do not apply to applets loaded from the local file system whose classes are present in the client's CLASSPATH.


Security fundamentals

Following are some of the fundamental terminologies you must be familiar with when dealing with security issues:

  • Principal
    Any identifiable person, role, or a system.

  • Authentication
    The means by which communicating entities prove to one another that they are acting on behalf of specific identities authorized for access (that is, the process by which a user or a system is identified by the other party). For example, a customer logs in to a bank's Web site using his or her login and password. This combination of user name and password identifies the user to the system.

  • Authorization
    The means by which interactions with resources are limited to collections of users or programs for the purpose of enforcing integrity, confidentiality, or availability constraints. For example, a manager can see all the employee details, whereas employees can only see their details.

  • Data integrity
    The means used to prove that information has not been modified by a third party while in transit. For example, if you send a file and its checksum separately, the receiving party can compute the file's checksum and match it with the received checksum to ensure the file's contents were not tampered with along the way.

  • Confidentiality (data privacy)
    The means used to ensure that information is made available only to the users who are authorized to access it. For example, you can encrypt the data and send. The receiver who has the decrypting key alone would be able to read the data.


Cryptography

Cryptography is the practice and study of encryption and decryption -- encoding data so it can only be decoded by intended recipients and rendered unreadable for others. There are two forms of encryption:

  • Symmetric
  • Asymmetric

Symmetric

Both sender and recipient know a common key used to encrypt and decrypt messages. Because the keys are same for both encrypting and decrypting, it is known as symmetric encryption.

One benefit of this method is:

  • Requires significantly less resources in terms of CPU cycles to encrypt and decrypt the data.

A disadvantage of this method is:

  • Both the sender and receiver must share the key in a secure way. If it is leaked to a third party, the entire mechanism becomes futile.

Asymmetric

Two different but related keys are used in such a way that one key, called a private key, is kept as a secret, while the other public key is available to anyone. The two fundamental principles that drive this method are:

  • One key cannot be deduced from the other.
  • Messages encrypted with one key can only be decrypted by the other and vice versa.

One advantage of this method is:

  • Completely eliminates the need to securely share the keys, as a sender can use the recipient's public key to encrypt the message, which can be read only by the recipient using his or her secure private key.

One downside of this method is:

  • It is computationally expensive.

In reality, you can use both forms of encryption in combination for enhanced security and efficient use. You can use symmetric encryption to encrypt the message, thereby reducing the computational cost involved in decrypting; the shared key (which would be small compared to the data) is encrypted using the asymmetric encryption, eliminating the necessity to transfer the keys securely.


Digital signatures and certificates

You can use asymmetric keys to verify the sender. Let's say if a message can be decrypted using one's public key, it ensures that it was encrypted using the sender's private key. This fact can be used to verify the sender's authenticity because he or she is the only one who has access to his or her private keys (provided it has not been hacked by someone else).

But how do you get an individual's public key, and how do you know that it's really his or her public key? A certificate that contains the name of the individual, expiration date, and a copy of the individual's public key solves this dilemma. A central certificate issuing authority called the Certificate Authority (CA) verifies people's identity and grants them the certificates. The granted certificates are digitally signed by the CA to ensure their credibility. The CA certificates are typically installed, by default, in applications such as Internet browsers. The CA is trustworthy, so the individuals who are trusted by it are also trustworthy. This chain of trust is what makes the entire system function properly.

Certificates are issued in various strengths depending on the level of credibility the CA has on the individual. A certificate of the lowest grade could be obtained by simply proving you have a valid e-mail ID, whereas a commercial grade might require advanced identification techniques such as DNA test.

The CA's job does not end with issuing of certificates. It's also in charge of maintaining the certificate's status. If someone's private key is lost, he or she can report the theft to the CA that issued the certificate. CA adds the certificate to the CA Revocation List (CRL) that lists the compromised certificates. Anyone can access this database to ensure that the certificate they trust is not a malicious one.


Network topologies for implementing security

The layout of the network has a strong correlation with the security of the network. Multiple entry points to the network without proper access control mechanisms are a boon for intruders looking to penetrate corporate networks. For enhanced security, the entry points into the network have to be restricted and must be guarded by well-configured firewalls. Once the topology is set, there must be constant monitoring of the firewall, server, and other network equipment log files to uncover any malicious activities, such as unauthorized intrusions, in a timely manner.

Simple firewall

This is a simple model in which the internal network and the external network are separated by a firewall.

Simple firewall

Two firewalls and DMZ

You use this model when you must offer a significant amount of services to the external network. You place the externally accessible servers in a demilitarized zone (DMZ) surrounded by firewalls on either side of the network. You configure the inner firewall more restrictively than the other firewall. Any communication from the external network to the internal network happens only through the servers deployed in the DMZ.

Two firewalls and DMZ

Tunneling

The firewall setup does not generally allow every protocol to communicate through it. Opening up numerous ports can result in an extremely vulnerable firewall. So, administrators generally allow only well-defined protocols, such as HTTP and HTTPS.

You can use tunneling to access an external service that is not allowed by the firewall by piggy-backing the requests onto a protocol that is allowed by the firewall (for example, using HTTP as a covert channel for invoking Web services).

Similarly, external networks can tunnel into an internal network. But this is not good practice as it allows anyone with malicious intentions to bypass the firewall rules.


Security summary

In this section, we discussed the security model of the Java language and the fundamentals of security required to face this exam. Remember the security restrictions imposed for an applet. Also, try to understand the various basic concepts of security, such as cryptography, signatures, firewalls, DMZ, and tunneling. The exam does not require you to know, in detail, the algorithms and mechanisms; rather, it tests your overall knowledge on the concepts and terminologies.


Test yourself on security

Question 1:

Which of the following statements are true about a DMZ?

Choices:

  • A. A DMZ is the zone secured behind a firewall.
  • B. A DMZ is the zone before a firewall.
  • C. A DMZ is the zone in front of two firewalls.
  • D. A DMZ is the zone between 2 firewalls.

Correct choice:

D

Explanation:

Choice D is the correct answer.

A DMZ is the zone between two firewalls. Hence, choice D is correct. The remaining choices are incorrect as they do not describe a DMZ.

12 of 16 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology
ArticleID=132106
TutorialTitle=Java certification success, Part 4: SCEA
publish-date=08162005
author1-email=authors@whizlabs.com
author1-email-cc=