Wednesday, December 5, 2007

What counts as transaction regarding to electronic voting system

Any of the database updating is transactions. On the precinct voting server, there is precinct voting DB to store precinct voting data; on the central voting server, there is central voting DB to store central voting data. Most commonly database uses locking to ensure ACID capabilities. For example, when precinct vote collector is performing a write operation on a row of data that precinct uploader wants to perform read operation on, read operation is blocked until the lock is released by the write operation.

Queries could participate in the transaction. Sometimes it is important in which order queries run, all queries in a group run or none at all. For example, one query is to update the vote total of individual candidate by adding votes while another query is to updating the vote total of all other candidates by deducting votes. Either query as a group will run, or neither will run. Both of these queries are one transaction.

In reality, most of the applications rely on database to provide transaction support. There are exceptions: Transactional file systems could be used instead of database to provide transactional support. One example of that is Journaling file system.

Oracle has recently acquired Tangosol Coherence to provide in-memory data management. It provides transactional support without the durability since data are only stored in-memory. The usage is mostly in ensuring data integrity for cached data.

Tuesday, December 4, 2007

The non-technical aspect of IT security

There are different aspects of IT security. Instead of focusing on security technique and algorithm, I will touch on another dimension of security topic: security policy.

A security policy concerns with what it means to be secure and what mechanisms to be used for enforcing the security standards.

For organization, the policy addresses the behavior constraints of its members. For systems, the policy addresses the flow between them, for example how people/program access functions and data.

As we all know, the weakest link in the security concern is people. Employing security policy and enforcing it will help people practicing sensible security measures such as logging out while away from desk, choosing sensible passwords, not writing down password, having different password for different systems, not opening dubious attachments in an email and etc.

We have most often hear about the external attacks in the media, however, the internal attack accounts for most of the computer security related crime. It is difficult to prevent insider attack; the best defense might be to improve management instead of employing another technical solution. There need to be a vigilant management of access privileges when employee leaving company or changing roles. The proper access privileges are given to employees whose jobs requires.

For a company, managing security is always a balancing act between balancing risks and benefits. Since achieving total computer security is impossible, company needs to conduct a risk assessment to decide on the appropriate balance between cost and risk. Threat modeling helps discovering various ways of possible security bleaches. The next step would be to figure out the cost benefit of implementing defenses against the attack. The defenses could include mitigation, outsourcing and insurance.

Tuesday, November 27, 2007

SOA Part 6 - BPEL

BPEL programming allows developers to form composite applications from services. To facilliate this type of distributed programming, IDEs includes a workflow-based or BPEL-based process engine, it saves the programmers some works to code the interactions between services. It also has the inclusion of a separate rules engine to help programmers. Specifically we will be using Oracle JDeveloper for BPEL process orchestration. Packaged with JDeveloper, there are a set of tools we will likely use - adapters for connectivity to back-end systems, transformation tools and engine, human workflow services.

Compares to what we had before, stand alone programs, we now can use BPEL to describe and use BPM to manage the end-to-end business process.

The benefit of stitching distributed service should be obvious:
  • This should improve our visibility to business events; And also improve our ability to predict and respond to the changes of the business need.
  • It should facilitate better decisions with accurate business intelligence; help enabling the knowledge sharing and improve organizational productivity.
  • It offers an incremental approach for integrating the existing infrastructrue.

Thursday, November 15, 2007

SOA Part 5 - SOAP

The SOAP protocol is concerned with using XML to represent messages and use the underlying protocol to communicate them. SOAP could be used on top of different protocols including HTTP, SMTP, TCP or UDP.

SOAP supports two modes of interactions: client-server (RPC) and asynchronous.
• The more commonly used messaging pattern is the RPC pattern. In this mode, SOAP describes how XML is used to represent the contents of request and reply message. RPC use the synchronous HTTP POST method for exchange the messages.
• Asynchronous pattern separates the request and response messages in time. They could be implemented as two unidirectional messages. After the application sends a SOAP request, it does not block and wait for the response. Instead, the sender gets notified when the receiver receives the message. SOAP header contains a message ID to correlate the messages.

SOAP message may be used in two different ways:
• SOAP defines a scheme for the communication of documents. The SOAP message has the document to be communicated placed inside the SOAP body element. SOAP message used to convey a document could be sent either synchronously or asynchronously.
• For RPC mode, the SOAP message has the RPC request and response elements placed in the SOAP body. Our current implementation of SOAP message is based on RPC.

Friday, November 2, 2007

SOA Part 4 - OWSM

Oracle Web Services Manager (WSM) is a Web Services security and management solution that provides a common security infrastructure for all Web Service applications. With Oracle WSM, we could avoid the duplicated effort in building security into each Web Service by leveraging a centralized security infrastructure.

WSM would intercept every incoming request and apply the policies. Policies are a mechanism used by the Web Services to indicate their preferences and constraints. The example of the policies could be:
Authorization policies
Encryption policies
Maintenance windows policies
Auditing policies

The Oracle WSM provides SSO, including authentication, authorization, and auditing for Web Services. The WSM supports WS-Security, SAML, and XML signature.

The Oracle WSM can utilize LDAP or other identity management product to provide web access control. This area needs to be expanded…

Wednesday, October 31, 2007

SOA Part 3 - WS-Security

When we talk about security, we need to be concerned about all aspects of security: authentication, authorization, integrity, confidentiality, and auditing.

WS-Security aims to guarantee integrity and confidentiality of SOAP messages. The security considerations could be based on many factors. For example, if application interacts with the Web service directly, transport-layer security provides sufficient protection and better performance. If a Web service request can pass through intermediate servers, the message-layer security provides an end-to-end data protection. If SOAP needs to run on top of multiple protocols, transport-layer security built on HTTP might not be of use.

It is common for an environment to provide both transport-layer and message-layer security for Web services.

Transport-layer security: HTTPS protocol is used to provide point-to-point encryption. In Java, the cert is installed for the JVM the client is running in and is used automatically by the JVM to do SSL handshake.

One configuration I have seen is to have Transport layer protection up to the proxy server. Once it is inside the DMZ zone, the protection of data is via the server access control.

Message-layer security: WS-Security specification describes how to encode X.509 certificates, Kerberos tickets, and UsernameTokens as part of a SOAP message.

WS-Security specification could be used to provide authentication, authorization, and encryption of the request and response. We might use WS-Security to only authenticate requests but not encrypting Web service requests and response if we already use HTTPS/SSL for the transport.

One thing to point out: for HTTPS/SSL, both requests and responses are encrypted for the duration of the session once the secure link is established. For SOAP, you have to specifically work to enable encryption of the response even if the request is already encrypted.

To provide authorization once the request has been authenticated, you might have to examine the details of the certificate to restrict access to resources. For the Java Web service, a Java Authentication and Authorization Service (JAAS) might come into play.

Tuesday, October 30, 2007

SOA Part 2 - WSDL

WSDL are XML documents that describe service interfaces. The WSDL specify the supported operations (port types), defines the Web Service access mechanism (messages) and the location at which the service is available (port defined by network address with binding).

To define a WSDL interface, these are the steps to be followed:
• Identify and define all the data structures that are involved in message exchange.
• Define messages that build on this data structure.
• Define operations or interactions.

There are four basic operations: one-way, request-response, solicit-response, and notification. In our current implementation, request-response synchronous interactions are implemented. We are looking at WS-Addressing to provide support for asynchronous interactions.

You normally never have to generate WSDL files from scratch. There are many toolkits available. the toolkit we used is GLUE from the Mind Electric which has been acquired by WebMethod. Glue is a Java based modular platform for building and invoking distributed web services. Glue can handle almost any data structure as long as it is properly defined by WSDL.

There are some characteristics to our Web Services:
• Using XML Schema types within WSDL, including the use of Map and complex types.
• The Web services we build are not published to the world at large, we are not concerned with advertising the services.
• For us, providing client stubs is less a problem since the client side environment is Java which uses GLUE as well.

To consume a WSDL file, the client stub/proxy generator generates Java classes and serialization routines. For developers, you don't even need to be aware of you are dealing with a XML document. You are working at Java object and attributes level.

We are moving towards Oracle/Peoplesoft environment. It would be interesting to compare the simple WSDL generated by GLUE to the WSDL published by Peoplesoft Component Interface.

WSDL file doesn’t describe the whole interface for a service. In another word, WSDL defines only core properties for interoperability. Additional attributes for security, SLA are provided by other standards.

It is worth mentioning that while the WSDL 1.1 model lacks flexibility, some of these will be addressed by WSDL 2.0.

SOA Part 1 - Web Services

HTTP request-reply protocol is the basis for the communication of the Web. Browsers, a general-purpose client, can view web pages and access resources via URLs. Enhancement such as applets broadens the applications that can be accessed via the Web.

Compare to the simple and general-purpose HTTP request-reply communication protocol, Web Services bring a much richer and more structured form of interoperability between clients and servers.

Web Services is one way to implement a service-oriented architecture. The core specifications that define Web services are modular: SOAP, WSDL, UDDI. There are additional specifications which are referred to as WS-*: WS-Security, WS-Reliability, WS-Reliability, WS-ReliableMessaging, WS-Addressing, WS-Transaction.

Specifically to our current implementation, we have utilized the following stacks: SOAP, WSDL, WS-Security. In addition, we have started looking at WS-Addressing to provide support for asynchronous interaction.

More details about each Web Services stacks will be followed as separate post.

Wednesday, October 24, 2007

RESTful approach to design SOA application (2)

Something to add to the original post:

The reality is that customer don't have the resource or expertise to provide us with a well specified requirement. The way it worked out is that we provide an sofeware specification based on some of the understanding we have:
1. Customer would require the new system be integrated in with legacy system;
2. The new application should be comparable in terms of the service offerring the market leader Flikr provides.
3. The new application has to be delivered within a 6 month time frame.
4. The new application has to design with security, performance, scalability and reliablity in mind.

One most important design decision we made is to take RESTful approach. There are two main reasons for that decision:
1. The web is built on this REST idea.
2. RESTful concept is very easy to understand and learn, learning curve is low for developers.
3. SOAP stack requires a lot of toolings. It addes complexity to the architecture, and it could be hard to understand to a deep level.
4. ATOM doesn't say anything about concurrency control, but HTTP response header ETag could provide such functionality.

One important requirement for new system is to integrate with the existing infrastructure. The ISP has made a significant investment in the existing infrastructure (custom framework layer on top of J2EE and HSM). In particular account and backup management provide significant differentiation. The new system needs to hide the actual implementation of custom API and HSM.

With the new API, the storage of data and metadata is performed by the same operations, which are the standard HTTP verbs: GET, POST, PUT, and DELETE. However, data and metadata are operated on separately: data is uploaded or downloaded via standard files, as identified by MIME types. Metadata, on the other hand, is represented using a XML schema (extending Atom through XML namespaces).

All the metadata are stored in Oracle database. All collections actually correspond to database queries on metadata. This gives significant flexibility.

Another important requirement is high performance. In particular, the new API must be designed to use the existing web infrastructure in an optimal way. It should use compression, caching, virtualization, and other mechanism. It must support direct path access for common operations, especially read access.

The design decision made to achieve this high performance requirement is to directly serving files via NFS mount.

Now I will talk about security requirement and ACL.

Since the new system is RESTful, it means that resources are identified by URLs. We knew customer would want to have all URLs secured. All URLs go through an authorization phase using whatever authentication credentials a user agent presents. This could be basic, digest, WSSE, or cookies. Security can be public, shared, or private.

We evaluated LDAP as solution for authorizationand determined that the solution might be an overkill for our purpose. The alternative solution was to use Association tables for ACL.

We used open source package Twisted to implement most of the server functionality. The reason is that it has a very simple model for coordinating threads and async I/O, which minimizes the overhead necessary for sharing complex results. However, it is necessary to do resource authorization ealier. So Apache is responsible for securing resources, basing on the authentication credentials presented by the user.

-Angela

RESTful approach to design SOA application (1)

This is based on my last project from my previous company. We preferred a RESTful approach to build our application.

We were charged to build a value add service for one of the biggest ISP provider in a foreign country. What our customer had in mind was Flickr like service offering. The solution must be designed to use the existing web infrastructure in an optimal way, and meet the high performance, low cost, security, reliability and usability objective.

To minimize development costs and lock-in risks, we preferred using an available API. Atom API's simplicity design presents itself a good candidate. Atom API is a REST implementation of a SOA. There are two aspects to the Atom API:

* Atom Syndication Format (ASF). ASF is directly comparable to RSS.
* Atom Publishing Protocol (APP). This protocol describes a usage of the REST web service style refined for use for the management of web resources.

(Atom also has a SOAP interface. it could provide further usability if needed.)

For the rapid delivery of leading services, the following objectives and means are employed:

* Apache is used to manage client connection.
* Direct execution paths. Serve files directly via a NFS mount.
* Caching. REST interfaces can take advantage of existing world-wide caching infrastructure.
* GET of a resource and POST to a container directly usable by a standard web browser, via a standard forms-based interface. AJAX can directly consume Atom interfaces, via DOM, XPath, or XSLT.
* Container model; queries can be containers.
* Publish-subscribe offer significant flexibility, since it is based on containers.
* Gatewayable to RSS.
* Extensible metadata model.
* Division of responsibility for Data and Metadata.
o This virtualization enables the division of infrastructure responsibility.
o Metadata can be associated with one or more collections, linking to any corresponding data files.
o Metadata is typically more volatile than stored multimedia data - tags may be changed, albums composed of multimedia files, etc. - but the original multimedia file will rarely be changed. Caching, through expiration and validation, can take advantage of this.

As a SOA, here are some standard phases that this request will go through: load balancing(via specialized applicance, DNS round robbin, or rewrite), cache management (entry/validation/expiration), authentication, authorization, namespace management(URL rewriting to a filesystem) to the URL. However, these are relatively lightweight phases, applied at the document level. Then the file itself is directly retrieved.

For data files, the natural point of integration with existing infrastructure is through the account of the data file owner. The account is treated as a collection.

For managing metadata, we prefer the declarative operations vs procedural. Some of the advantages of being declarative are:

* File transformations can be thrown away – classic time/space tradeoff – since they can be reapplied if desired.
* Listing associated tags makes sense in the metadata.

-Angela