Inside Java 2 Platform Security Architecture API Design and Implementation 2nd Edition Li Gong instant download
Inside Java 2 Platform Security Architecture API Design and Implementation 2nd Edition Li Gong instant download
https://ebookname.com/product/inside-java-2-platform-security-
architecture-api-design-and-implementation-2nd-edition-li-gong/
https://ebookname.com/product/java-data-mining-strategy-standard-
and-practice-a-practical-guide-for-architecture-design-and-
implementation-1st-edition-mark-f-hornick/
https://ebookname.com/product/api-std-1164-scada-security-first-
edition-api/
https://ebookname.com/product/software-architecture-design-
patterns-in-java-1st-edition-partha-kuchana-2/
https://ebookname.com/product/organizational-behaviour-canadian-
edition-mitchell-j-neubert/
A Revised List of Roman Memorial and Triumphal Arches
Analecta Gorgiana 1st Edition Arthur Frothingham
https://ebookname.com/product/a-revised-list-of-roman-memorial-
and-triumphal-arches-analecta-gorgiana-1st-edition-arthur-
frothingham/
https://ebookname.com/product/the-stuffed-owl-an-anthology-of-
bad-verse-d-b-wyndham-lewis/
https://ebookname.com/product/mobile-citizenship-spatial-
privilege-and-the-transnational-lifestyles-of-senior-
citizens-1-edition-margit-fauser/
https://ebookname.com/product/introduction-to-the-mathematics-of-
medical-imaging-2nd-edition-charles-l-epstein/
https://ebookname.com/product/security-awareness-applying-
practical-security-in-your-world-3rd-edition-mark-ciampa/
The Moral Wager Evolution and Contract 1st Edition
Malcolm Murray
https://ebookname.com/product/the-moral-wager-evolution-and-
contract-1st-edition-malcolm-murray/
Inside Java™ 2 Platform Security:
ISBN: 0-201-78791-1
Copyright
The authors and publisher have taken care in the preparation of this book, but
make no expressed or implied warranty of any kind and assume no
responsibility for errors or omissions. No liability is assumed for incidental or
consequential damages in connection with or arising out of the use of the
information or programs contained herein.
The publisher offers discounts on this book when ordered in quantity for bulk
purchases and special sales. For more information, please contact:
International Sales
(317) 581-3793
international@pearsontechgroup.com
Sun, Sun Microsystems, Sun Microsystems Computer Corporation, the Sun logo,
the Sun Microsystems Computer Corporation logo, Java, JavaSoft, Java Software,
JavaScript, Java Authentication and Authorization Service, JAAS, Java
Cryptography Extension, JCE, Java GSS-API, Java Secure Socket Extension, JSSE,
Java IDL, Java Plug-in, Java Remote Method Invocation, Java RMI, Java Web Start,
EmbeddedJava, PersonalJava, JVM, JavaOS, J2EE, J2ME, J2SE, JDK, and J2SDK are
trademarks or registered trademarks of Sun Microsystems, Inc. UNIX® is a
registered trademark in the United States and other countries, exclusively
licensed through X/Open Company, Ltd. All other product names mentioned
herein are the trademarks of their respective owners.
For information on obtaining permission for use of material from this work,
please submit a written request to:
1 2 3 4 5 6 7 8 9 10—CRS—0706050403
Dedication
To Roger Needham, 1935–2003
—Li Gong
To SAM
—Gary Ellison
—Mary Dageforde
The Java™ Series
http://www.javaseries.com
Eric Armstrong, Stephanie Bodoff, Debbie Carson, Maydene Fisher, Dale Green,
Kim Haase
The Java™ Web Services Tutorial
Joshua Bloch
Effective Java™ Programming Language Guide
Patrick Chan
The Java™ Developers Almanac 1.4, Volume 1
Patrick Chan
The Java™ Developers Almanac 1.4, Volume 2
Zhiqun Chen
Java Card™ Technology for Smart Cards: Architecture and Programmer's Guide
Doug Lea
Concurrent Programming in Java™, Second Edition: Design Principles and Patterns
Sheng Liang
The Java™ Native Interface: Programmer's Guide and Specification
Seth White, Maydene Fisher, Rick Cattell, Graham Hamilton, Mark Hapner
JDBC™ API Tutorial and Reference, Second Edition: Universal Data Access for the
Java™ 2 Platform
Stephanie Bodoff, Dale Green, Kim Haase, Eric Jendrock, Monica Pawlan, Beth
Stearns
The J2EE™ Tutorial
Mark Hapner, Rich Burridge, Rahul Sharma, Joseph Fialli, Kim Haase
Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™
Platform
Bill Shannon, Mark Hapner, Vlada Matena, James Davidson, Eduardo Pelegri-
Llopart, Larry Cable, Enterprise Team
Java™ 2 Platform, Enterprise Edition: Platform and Component Specifications
—Charles Kettering
The target audience of this book is varied. We believe this book will be a useful
resource to those seeking a general understanding of the security foundation
the Java 2 security architecture provides and relies on. The book should also
prove particularily useful to software practitioners building enterprise-class
applications that must meet varied security requirements, ranging from
authentication to authorization to information protection. This book provides
insight into some of the design trade-offs we made as we developed the platform
and the lessons we have learned as we continue to evolve and enhance the
platform. We provide guidance to those needing to customize the security model
for their specific purposes. We describe the inflection points we designed into
the platform to accommodate those rare but critical customizations. Most of
the aforementioned topics are targeted to system developers, yet we recognize
that security is not limited to the implementation of an application. Equally
important is the deployment of the application. For deployers, we supply
descriptions ranging from expressing security policy to hardening the
installation of the runtime environment.
This book does not explain to any level of detail the Java programming language.
We recommend the book by Arnold and Gosling [3] as a good starting point. Also,
we do not cover the various security APIs in their entirety, and thus we refer the
reader to the Java 2 SDK documentation.
Acknowledgments
This project began as a casual conversation between Li Gong and me at the 2001
JavaOne conference in San Francisco. Prior to that conversation, Li had
transitioned from the role of chief security architect for the Java 2 security
development project to leading Project JXTA, whereas I had transitioned into
the lead security architect role for the Java 2 development team near the end
of the prior millennium. I mentioned to Li that the security architecture had
evolved to the point that the first edition was no longer current and thus not an
authoritative text.
Nearly two years later, the results of that conversation have come to fruition,
and I can confidently state that we have come a long way to reach our goal of
producing a book that thoroughly and accurately describes the Java 2 security
architecture. This clearly would not have been possible without Li's support, and
I am grateful for having had the opportunity to work with Li in the past and
especially on this project.
This book would probably be stuck in the starting blocks if it were not for the
guidance and gentle nudging of Lisa Friendly, Manager of Software Technical
Publications at Sun Microsystems. Lisa recognized early on that my commitment
to the project was absolute but that my copious free time, which was allotted to
this effort, fell between the hours of 10 P.M. and 2 A.M. Lisa quickly solved this
problem by engaging Mary Dageforde as technical editor. I am forever grateful.
Not only is Mary an excellent technical writer and editor who ended up writing
enough to get coauthor billing, but she can code too! Mary truly made this
project happen with her drive, dedication, and thoroughness. I cannot say
enough about Mary, so I will keep it brief. Thank you, Mary.
Tim Lindholm was also an early inspiration, and I appreciate his support in
helping me keep things in perspective. I also want to acknowledge the support
of my management—Larry Abrahams, Maxine Erlund, Sharon Liu, and Stephen
Pelletier—who understood how important this project was to me.
Being a part of the team that created something that has had such a significant
impact on computing is an honor not shared by many. The success of Java is
obviously a result of the high caliber of people who made it a reality. I have had
the luxury of working alongside many talented people, and I expressly want
to thank Lars Bak, Josh Bloch, Gilad Bracha, Zhiqun Chen, Steffen Garup, James
Gosling, Graham Hamilton, Mark Hapner, Stanley Ho, Peter Jones, Peter Kessler,
Tim Lindholm, Ron Monzillo, Hans Muller, Hemma Prafullchandra, Mark
Reinhold, Rene Schmidt, Bill Shannon, Bob Scheifler, Jim Waldo, and Ann
Wollrath for the great experience, mentoring, and technical challenges.
Few people realize the existence and close working relationship the Java security
development team at Sun Microsystems maintains with our peers in other
organizations. I specifically wish to acknowledge the team at IBM, including
Larry Koved, Marco Pistoia, Tony Nadalin, and Bruce Rich, who have been
instrumental in enhancing the feature set of the Java 2 security architecture.
I also want to thank the many reviewers of this text and specifically recognize
Gilad Bracha, Matt Curtin, James Hoburg, Peter Jones, Charlie Lai, Brian Larkins,
Rosanna Lee, John Linn, Ram Marti, Doug Monroe, Sean Mullan, Shivaram
Mysore, Vincent Ryan, Bob Scheifler, Andreas Sterbenz, Brad Wetmore, and Phil
Yeater for the feedback they provided. I also wish to recognize Peter Jones and
Shivaram Mysore for their content contributions.
Finally, I want to express my gratitude to the production team. I thank the copy
editor, Evelyn Pyle, and the production folks at Addison-Wesley for their support
and effort in getting this book off my laptop and into print. Thanks to Marcy
Barnes, Jacquelyn Doucette, Amy Fleischer, John Fuller, Mike Hendrickson,
Michael Mullen, and Ann Sellers. Also, I want to acknowledge Mary Darby and
Amy Girard from Duarte Design for their innate ability to take my graphically
challenged images and turn them into a thousand words.
Gary Ellison
San Mateo, California
March 2003
I am grateful to all past and current members of the Java Security and
Networking group at Sun, as well as contributors from all over the world, who
continue to strengthen Java's position as the premier computing platform in
these areas. I am in debt to Gary Ellison and Mary Dageforde for their
tremendous effort in producing this second edition which significantly expands
the coverage of the first.
Li Gong
Beijing, China
It has been a pleasure working with Gary Ellison on this book. I thank him for
his vision, dedication, encouragement, feedback, enormous effort in the face of
multiple competing responsibilities, and sense of humor. It has also been my
good fortune to work with Li Gong and members of the top-notch Java Security
and Networking team at Sun at various times throughout the past several years.
I thank them all. Thanks also to Lisa Friendly of Sun and Mike Hendrickson of
Addison-Wesley for their support and their roles in facilitating publication of
this book. Finally, I would like to thank the copy editor, the graphics designers,
and the very helpful production folks at Addison-Wesley.
Mary Dageforde
Santa Clara, California
—Archimedes
Since Java technology's inception, and especially its public debut in the spring
of 1995, strong and growing interest has developed regarding the security of
the Java platform, as well as new security issues raised by the deployment of
Java technology. This level of attention to security is a fairly new phenomenon
in computing history. Most new computing technologies tend to ignore security
considerations when they emerge initially, and most are never made more
secure thereafter. Attempts made to do so typically are not very successful, as
it is now well known that retrofitting security is usually very difficult, if not
impossible, and often causes backward compatibility problems.
Thus it is extremely fortunate that when Java technology burst on the Internet
scene, security was one of its primary design goals. Its initial security model,
although very simplistic, served as a great starting place, an Archimedean
fulcrum. The engineering talents and strong management team at JavaSoft are
the lever; together they made Java's extensive security architecture a reality.
From a technology provider's point of view, security on the Java platform focuses
on two aspects. The first is to provide the Java platform, primarily through the
Java Development Kit, as a secure platform on which to run Java-enabled
applications in a secure fashion. The second is to provide security tools and
services implemented in the Java programming language that enable a wider
range of security-sensitive applications, for example, in the enterprise world.
I wrote this book with many purposes in mind. First, I wanted to equip the
reader with a brief but clear understanding of the overall picture of systems and
network security, especially in the context of the Internet environment within
which Java technology plays a central role, and how various security
technologies relate to each other.
Third, I sought to tell the reader about security deployment issues, both how an
individual or an enterprise manages security and how to customize, extend, and
enrich the existing security architecture.
This book is centered around JDK 1.2 security development, a project that lasted
fully two years, during which many people inside and outside of Sun
Microsystems contributed in one way or another to the design, implementation,
testing, and documentation of the final product. I would like to acknowledge
Dirk Balfanz, Bob Blakley, Josh Bloch, David Bowen, Gilad Bracha, David
Brownell, Eric Chu, David Connelly, Mary Dageforde, Drew Dean, Satya Dodda,
Michal Geva, Gadi Guy, Graham Hamilton, Mimi Hills, Ted Jucevic, Larry Koved,
Charlie Lai, Sheng Liang, Tim Lindholm, Jan Luehe, Gary McGraw, Marianne
Mueller, Tony Nadalin, Don Neal, Jeff Nisewanger, Yu-Ching Peng, Hemma
Prafullchandra, Benjamin Renaud, Roger Riggs, Jim Roskind, Nakul Saraiya,
Roland Schemers, Bill Shannon, Vijay Srinivasan, Tom van Vleck, Dan Wallach,
and Frank Yellin. I also appreciate the technical guidance from James Gosling
and Jim Mitchell, as well as management support from Dick Neiss, Jon
Kannegaard, and Alan Baratz. I have had the pleasure of chairing the Java
Security Advisory Council, and I thank the external members, Ed Felten, Peter
Neumann, Jerome Saltzer, Fred Schneider, and Michael Schroeder for their
participation and superb insights into all matters that relate to computer
security.
Isabel Cho, Lisa Friendly, Charlie Lai, Jan Luehe, Teresa Lunt, Laura Michaels,
Stephen Northcutt, Peter Neumann, and a number of anonymous reviewers
provided valuable comments on draft versions of this book.
G. H. Hardy once said that young men should prove theorems, while old men
should write books. It is now time to prove some more theorems.
Li Gong
Los Altos, California
June 1999
Chapter 1. Computer and Network
Security Fundamentals
The three golden rules to ensure computer security are: do not own a
computer; do not power it on; and do not use it.
Security is all about ensuring that bad things do not happen. This deceptively
simple brief statement can in fact have very complicated interpretations.
Exploring them can help in understanding what security really means.
Second, security is relative to the threat that one considers. For example, the
effectiveness of your house's locked front door to prevent theft depends heavily
on the types of thieves against which you are guarding. Although the lock might
deter an amateur thief, it might not pose a problem for a sophisticated one
equipped with the right tools.
Security mechanisms often can benefit from the use of cryptography, such as
when running a network-based user login protocol. However, they do not
necessarily depend on the use of cryptography, such as when implementing
UNIX-style access control on files.
These three categories of attacks are intricately related; that is, the techniques
and results of attacks in one category can often be used to assist attacks in
another. For example, by compromising secrecy, an attacker could obtain
passwords and thus compromise integrity by gaining access to and then
modifying system resources, which in turn could lead to successful denial-of-
service attacks. When a system failure occurs during an attack, most systems
are not fail-safe—that is, they do not enter into a state that is deemed
secure—because they are not designed to do so [111]. For example, it has been
shown that a system crash sometimes leads to a core dump in a publicly readable
directory, where the core can contain sensitive information if the dump occurs
[1]
at the right time.
[1]
Of course, attacks can be viewed from other perspectives. For
example, there is widespread public concern about the privacy of the
unregulated and sometimes illegal collection and distribution of
personal data, such as birth dates and U.S. social security numbers.
To protect data secrecy, you can store the data in an obscure place in the hope
that attackers will not find it. Or you can install strict access control procedures
to guard against unauthorized access. Or you can use encryption technology to
encrypt the data such that attackers cannot access real data unless they can steal
the encryption key or can break the cryptosystem, which could be extremely
difficult. Of course, multiple measures can be deployed at the same time. Note
that, for secrecy, the most important technique is prevention. A loss of data is
very difficult to detect, and lost data is impossible to recover.
To protect data integrity, you can use any or all the mechanisms mentioned
previously. However, in this case, detection is easier, and recovery is often
possible. For example, you could compute the hash value for a file x, using a
wellknown one-way function f(), and store f (x) separately. If x is then modified
to be x', f (x) very likely will not be equal to f (x'), according to the properties of f().
Thus, you can recompute the hash value and compare it with f (x). A mismatch
will indicate that integrity has been compromised. See Section 1.5.1 for more
information on one-way hash functions.
To be able to restore the data to its original form after an integrity compromise,
you can back up data and store the backup in a secure place [96]. Or you can use
more complicated distributed computing techniques to back up the data in an
insecure network [53, 98, 114, 118].
Faced with such a messy picture, it is no surprise that companies find it easier,
both psychologically and physically, simply to divide the world into two camps:
"us" and "them." "Us" includes all machines owned, operated, or, in general,
trusted by the concerned enterprise, whereas "them" includes all other
machines, which are potentially hostile and cannot be trusted. Once the border
is drawn, it is a matter of keeping "them" out and "us" in. Such a defensive
posture is often called perimeter defense.
“No, Aunt,” said the girl quietly; and then, to herself, “Papa
must have told Aunt Anne not to let me be along with Tom,
or she would not have spoken like that.”
Then aloud—
“Good-bye, Mr Beck;” and she held out her hand, which was
taken for a moment and then dropped, as she turned and
left the room.
The vicar’s son had hardly left the house an hour when Sir
Cheltnam rode over to make inquiries, and was leaving his
card, when Alison came into the hall and went out on the
steps to speak to him.
“Can’t ask you in,” said Alison. “The governor’s very bad.”
“But our doctor here is not attending him, for I met him,
and he was asking about it, and thought it rather strange
that he had not been sent for.”
Alison winced.
“Oh, it is only Neil’s way,” said Alison sulkily. “And you don’t
seem much better. If you came over to my place, I should
ask you in, and call a man to take your horse.”
“Bah! He’ll be off to sea directly, and she’ll soon forget him.”
“Then you think I had better not come in to-day? I’m off,
then. Wish the old man better. I’ll come on again to-morrow
to see how he is. I say, tell Isabel I called and was in great
trouble, and that sort of thing.”
He bit one of his nails and watched the visitor till he was out
of sight, and still stood at the foot of the steps frowning.
“My dear Aunt,” he said at last to that lady, who was greatly
agitated in his behalf, “a doctor grows used to watching by
his patient’s bedside, and gets little snatches of sleep which
refresh him. Believe me, I am not a bit tired.”
“Hayle.”
Aunt Anne pursed up her lips, and tried to look wise and full
of experience—a difficult task for a lady with her plump,
dimpled countenance.
He led the way out on to the drive, and, after hesitating for
a few moments, Alison followed, frowning, just as the sound
of horses’ hoofs was heard, and Saxa and Dana Lydon rode
up.
“Here, we’ll come round to the stables with you,” said Saxa.
“I want to see The Don. Is he any the worse for his fall?”
His heart sank low as he looked into the future with a kind
of wonder as to what his future life would be bound up to a
woman like that, and a feeling of anger rose within him at
his weakness in letting the affair drift on so far.
Neil turned to hurry into the house, but his sister held him
fast.
Neil looked in the direction taken by her eyes, and saw that
the young lieutenant was striding rapidly toward them,
coming by the short cut across the park, and now, seeing
that he was observed, he waved his hand.
“Neil!”
She gave him a tearful look, and went in with her head bent
down to hide her face from anyone who might be at the
windows.
The next minute the young sailor hurried up.
“It would help her. She would know I was near. I can’t go
and leave her knowing what I do about that fellow
Burwood.”
“Of course you could, but neither Isabel nor I are going to
let you degrade yourself. My father is dangerously ill, and
nothing such as you fear can advance a step for months to
come, so join your ship like a man, and show that you have
faith in the girl you believe to love you.”
“In you? My dear Neil,” cried the young sailor warmly, “if
ever fellow looked upon another man as a brother, I do
upon you. Why, you know that.”
“Yes, I know that,” said Neil, taking his arm and walking up
and down the drive with him, “and I am going always to
behave like a brother to you. Go and join your ship.”
“But Isabel?”
“But Burwood?”
“I don’t like Burwood, and I do like you,” said Neil, smiling.
“Come, will not that satisfy you?”
“Neil, old fellow,” cried Beck, facing round and grasping the
young surgeon’s hand, “I don’t wonder that you are getting
to be a big fellow at your hospital.”
“My dear old fellow,” cried the sailor, with tears in his eyes.
“And you will go off like a man and join your ship?”
“No.”
“No, my lad. Say good-bye to me, and I’ll tell her you love
her truly, and that you have gone off to your duty like a
man—an officer and a gentleman. That you have exacted no
promise from her, and that you have taken the advice of her
brother—a man who loves you both and will help you to the
end. There, I must go back to my father’s room. Good-bye.”
Neil held out his hand, but it remained untouched for the
full space of a minute before it was seized and crushed
heavily between two nervous sets of fingers, while the
young man’s eyes gazed fixedly in his. Then it was dashed
aside. Beck swung himself round and dashed off across the
park as hard as he could go, without trusting himself to look
back.
Chapter Eight.
Conflicting Emotions.
“Poor fellow!” said Neil to himself; “and the dad prefers that
hunting, racing baronet to him for a son-in-law! Why it
would break little Bel’s heart.”
He stopped and turned to go, but a hand was laid upon his
arm, and, as he faced round, it was to see a little white
appealing face turned up to his, and as he passed his arm
round his sister’s waist the horses’ hoofs crushed the gravel
by the door, passed on, and the sound grew more faint.
“What was it, then? Oh, Neil, dear, you hurt me. You are
keeping something back.”
He led her into the drawing room and closed the door, while
she clung to him, searching his eyes with her own wistful
gaze, as her lips trembled.
“Yes.”
Neil nodded, and drew her more closely to him, but she
resisted. His embrace seemed to stifle her; she could hardly
breathe.
“You are cruel to me,” she panted. “But I know,” she cried
half hysterically; “he has to go soon.”
“Yes, dear.”
“And he is to go soon?”
“I will, dear, with all my strength. You know that Tom has
his duty to do, like the rest of us, and you have yours to our
poor father.”
Neil bent his head sadly, and she literally snatched herself
away.
Neil had just left his sister’s room and gone back to his
father’s to find him hot and feverish to an extent which
rather troubled him, and once more made him long for the
friendly counsel and advice of a colleague.
But his sound common sense gave him the help he needed,
and after administering medicine he became satisfied with
the result and sat by the bedside thinking of the stern duty
he had to fulfill.
But Neil Elthorne did not speak the words he had meant to
say, for, as the visitor turned at his step, he stopped short
with the blood rushing to his brain, and a strange sensation
of vertigo attacking him as he faltered out:
“Then, pray, what is it?” This question very sharply, and the
patient moved in her bed in a way that showed very little
feebleness.
“Simply hysteria.”
“What! Sterricks?”
“Oh, yes, I know. And you are as bad as they are. It’s
shameful!”
“Go on, pray, ma’am. You’ve all got me down here and are
trampling on me. I’m unreasonable now, am I?”
“Pray, hush,” said the nurse. “You are hurting yourself and
upsetting the other patients.”
“Nursing?”
“Why?”
“I could not go, Sir Denton; I beg you will not send me.”
“Thank you, Sir Denton, but you must excuse me from this.”
“Can you not trust me to advise you for your good?” said
Sir Denton gravely.
“At once.”
“The nurse for Hightoft?” said the voice; and as she turned
she found that it was only a servant.
“That little black bag, that is all,” said the nurse quietly.
“Don’t mean to stay long, then,” said the man with a laugh,
as he took the little travelling bag, and swung it up on to
the foot-board, while the nurse stood patiently waiting, and
without resenting the man’s insolence and indifference as
he entered into a conversation with the coachman before
turning and, stepping back, stared hard at the calm, refined
face dimly seen by the feeble station lamps.
“Eh? Open the door? Of course. Just going to,” said the
footman cavalierly, as he snatched open the door and
rattled down the steps.
He held out his hand, but she stepped in without his
assistance, the door was banged sharply to, and the handle
took some time to turn, as the man stared in at the visitor,
who quietly drew up the window and sank back in her seat.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com