- XML Reference Guide
- Overview
- What Is XML?
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Table of Contents
- The Document Object Model
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- DOM and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- Implementations
- DOM and JavaScript
- Using a Repeater
- Repeaters and XML
- Repeater Resources
- DOM and .NET
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Downloads
- DOM and C++
- DOM and C++ Resources
- DOM and Perl
- DOM and Perl Resources
- DOM and PHP
- DOM and PHP Resources
- DOM Level 3
- DOM Level 3 Core
- DOM Level 3 Load and Save
- DOM Level 3 XPath
- DOM Level 3 Validation
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Implementations
- The Simple API for XML (SAX)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- SAX and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- SAX and .NET
- Informit Articles and Sample Chapters
- SAX and Perl
- SAX and Perl Resources
- SAX and PHP
- SAX and PHP Resources
- Validation
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Document Type Definitions (DTDs)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XML Schemas
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- RELAX NG
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Schematron
- Official Documentation and Implementations
- Validation in Applications
- Informit Articles and Sample Chapters
- Books and e-Books
- XSL Transformations (XSLT)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XSLT in Java
- Java in XSLT Resources
- XSLT and RSS in .NET
- XSLT and RSS in .NET Resources
- XSL-FO
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XPath
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XML Base
- Informit Articles and Sample Chapters
- Official Documentation
- XHTML
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XHTML 2.0
- Documentation
- Cascading Style Sheets
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XUL
- XUL References
- XML Events
- XML Events Resources
- XML Data Binding
- Informit Articles and Sample Chapters
- Books and e-Books
- Specifications
- Implementations
- XML and Databases
- Informit Articles and Sample Chapters
- Books and e-Books
- Online Resources
- Official Documentation
- SQL Server and FOR XML
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Implementations
- Service Oriented Architecture
- Web Services
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Creating a Perl Web Service Client
- SOAP::Lite
- Amazon Web Services
- Creating the Movable Type Plug-in
- Perl, Amazon, and Movable Type Resources
- Apache Axis2
- REST
- REST Resources
- SOAP
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- SOAP and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- WSDL
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- UDDI
- UDDI Resources
- XML-RPC
- XML-RPC in PHP
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Ajax
- Asynchronous Javascript
- Client-side XSLT
- SAJAX and PHP
- Ajax Resources
- JSON
- Ruby on Rails
- Creating Objects
- Ruby Basics: Arrays and Other Sundry Bits
- Ruby Basics: Iterators and Persistence
- Starting on the Rails
- Rails and Databases
- Rails: Ajax and Partials
- Rails Resources
- Web Services Security
- Web Services Security Resources
- SAML
- Informit Articles and Sample Chapters
- Books and e-Books
- Specification and Implementation
- XML Digital Signatures
- XML Digital Signatures Resources
- XML Key Management Services
- Resources for XML Key Management Services
- Internationalization
- Resources
- Grid Computing
- Grid Resources
- Web Services Resource Framework
- Web Services Resource Framework Resources
- WS-Addressing
- WS-Addressing Resources
- WS-Notifications
- New Languages: XML in Use
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Google Web Toolkit
- GWT Basic Interactivity
- Google Sitemaps
- Google Sitemaps Resources
- Accessibility
- Web Accessibility
- XML Accessibility
- Accessibility Resources
- The Semantic Web
- Defining a New Ontology
- OWL: Web Ontology Language
- Semantic Web Resources
- Google Base
- Microformats
- StructuredBlogging
- Live Clipboard
- WML
- XHTML-MP
- WML Resources
- Google Web Services
- Google Web Services API
- Google Web Services Resources
- The Yahoo! Web Services Interface
- Yahoo! Web Services and PHP
- Yahoo! Web Services Resources
- eBay REST API
- WordML
- WordML Part 2: Lists
- WordML Part 3: Tables
- WordML Resources
- DocBook
- Articles
- Books and e-Books
- Official Documentation and Implementations
- XML Query
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XForms
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Resource Description Framework (RDF)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Topic Maps
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation, Implementations, and Other Resources
- Rich Site Summary (RSS)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Simple Sharing Extensions (SSE)
- Atom
- Podcasting
- Podcasting Resources
- Scalable Vector Graphics (SVG)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- OPML
- OPML Resources
- Summary
- Projects
- JavaScript TimeTracker: JSON and PHP
- The Javascript Timetracker
- Refactoring to Javascript Objects
- Creating the Yahoo! Widget
- Web Mashup
- Google Maps
- Indeed Mashup
- Mashup Part 3: Putting It All Together
- Additional Resources
- Frequently Asked Questions About XML
- What's XML, and why should I use it?
- What's a well-formed document?
- What's the difference between XML and HTML?
- What's the difference between HTML and XHTML?
- Can I use XML in a browser?
- Should I use elements or attributes for my document?
- What's a namespace?
- Where can I get an XML parser?
- What's the difference between a well-formed document and a valid document?
- What's a validating parser?
- Should I use DOM or SAX for my application?
- How can I stop a SAX parser before it has parsed the entire document?
- 2005 Predictions
- 2006 Predictions
- Nick's Book Picks
It's not surprising that web services, with its promise of remote computing and platform independance, also has its share of security concenrs. After all, any technology specifically designed to let outsiders interact with your company has got to have its own set of concerns built in.
In fact, for a long time the question of how to secure web services was a major sticking point it its wider adoption, as companies tried to figure out how to make good use of it without cutting their own throats.
Web services security generally takes into account four issues: access control, confidentiality, data integrity, and non-repudiation.
Access control
How do you make sure that only those permitted to access a web service can do so? We're dealing with a situation in which web services messages are designed to be widely accessible. How do we limit that? Two specifications that attempt to address this problem are SAML and XACML.
Security Assertion Markup Language (SAML) is an XML vocabulary for specifying "assertions," such as the fact that a certain person, or subject, is permitted to access a particular resource at certain times of the day. A SAML-enabled system compares the various assertions with the given situation and makes an authorization decision, which is then relayed back using SAML.
XML Access Control Markup Language (XACML) seems on the surface as though it is a competitor for SAML, but in fact both are being managed within OASIS, and XACML complements SAML. XACML provides a way to specify groups of subjects who have specific privileges, authentication methods that must be used, and other information needed for a SAML solution to work properly.
Encryption and its benefits
The other major issues can all be managed by encryption of one sort or another, so let's look at how they figure into the equation.
Confidentiality
How do you make sure that nobody reads the web services message besides the sender and intended recipient? Web services messages are simply XML that travels the same hops through the Internet as email and web page requests; any intermediate recipient could conceivably read the data.
Data integrity
How do you make sure the message received is actually the message sent, and not some corrupted or tampered-with version? Those same intermediate recipients mentioned above could conceivably alter the data for their own (nefarious) purposes, such as redirecting replies to themselves.
Non-repudiation
How do you prove the alledged sender of the message is the actual sender? Think of this the same way you'd think of a signature on a credit card slip. How can you prove the requestor actually did the requesting?
So how can we solve all of these problems through the use of encryption? Well, it depends on what kind of encryption we're talking about.
XML Encryption is perhaps the most basic part of this picture, as a specification that enables you to use cryptographic techniques to encrypt some or all of an XML document and then include the encrypted information within the XML. It also enables you to encrypt different parts of a document with different keys, so that multiple recipients can retrieve only the data intended for them.
So that seems to take care of the confidentially issue, but what about data integrity and non-repudiation? It turns out that by using the proper encryption method, we can cover those, as well.
There are two types of encryption in general use on the web: symmetrical, or "shared key" encryption, and asymmetrical, or "public key/private key" encryption. In "shared key" encryption, the same secret code, or key, is used to encrypt and decrypt the message. Anyone who has that key can read or send messages in that particular conversation, but of course pains are taken to make sure that only the sender and receiver have that key.
In "public key/private key" encryption, the situation is a little bit different. In this case, you have a situation in which one party has a pair of keys. One is kept secret; theoretically, only the owner has it. The other is public, and everyone knows that it belongs to that person because it's published to some sort of registry. A message encrypted with one key can only be decrypted with the other, and vice versa. So it works like this:
You want to send me a message, but you don't want anyone else to read it. You look up my public key and use it to encrypt the message. Now that message is unreadable to anybody but me; I can only read it because I have the private key that matches the public key you used to encrypt it in the first place. On the other hand, when I send you a response, I encrypt it with my private key. That means that anybody with my public key -- which is to say, potentially anybody -- can read it, but the goal here wasn't secrecy, it was identification. That message had to come from me, because it was encrypted with my private key. You know that because you were able to decrypte it with my public key.
So what does this have to do with web services? First off, it takes care of the non-repudation problem. If you can decode a message with my public key, it had to have been encrypted with my private key, so it had to come from me. I can't deny sending it.
Second, there's an interesting side-effect to this process. The encrypted messages are extremely sensitive to changes, so if anybody tries to tamper with these messages, that'll show up in the decryption process. So that takes care of the data integrity issue.
OK, so how do we put this to work, in a practical sense?
As far as web services are concerned, we can "sign" messages using the XML Digital Signatures speficiation, which provides a vocabulary for representing the encrypted data and provding any data necessary for the recipient system to retrieve the appripriate key and decrypt the message.
Of course, all of these keys floating around have to be managed somehow, and the idea of Public Key Infrastructure (PKI) installations has been around in one form or another for some time. (In order for this scheme to work, you'd have to be able to get hold of my public key so you can encrypt the initial message to me.) All of this is moving into the XML world with the XML Key Management (XKMS) specification, which consists of the overall structure and two sub-specifications.
Confused yet? And I haven't even mentioned the numerous other web services security-related specifications!
- Helping to pull it all together, we have specifications such as WS-Security, which doesn't actually
specify how to protect something, but rather provides a way to explain how you've protected
something. It defines a number of extensions that can be placed in the
Head
of a SOAPEnvelope
to specify all of this information.In future entries, we'll look at each of these individual topics, but for now check out the resources for more information.