Monday, August 17, 2015

RahasNym: Protecting against Linkability in the Digital Identity Eco System

This is the poster paper published and presented on the $subject in IEEE International Conference on Distributed Computing Systems (ICDCS 2015) which was held in Ohio, Columbus, USA from 29th June to 2nd July.

The poster paper can be found in the conference proceedings.

Following is the poster that was presented during the poster session of the main conference:



We were lucky to get the best poster award for this work.


Privacy Preserving Biometrics-Based and User Centric Authentication Protocol

This is my first research paper from grad school. This was published in the 8th International Conference on Network and System Security (NSS 2014) which was held in Xi'an, China from 15th-17th October 2015.

The full paper can be found here in Springer Lecture Notes in Computer Science.

Following are the slides I used when presenting the paper at the conference.



Interestingly, we got the best paper award for this paper at NSS 2014.



Friday, March 28, 2014

Global Cafe this week: Japan - a country of sushi eating samurai

Global Cafe is a very interesting weekly event held at International Center of Purdue University on Friday from 5.30-7.30 PM where students from a particular country can present about their country, culture and importantly share an authentic dish of the country with the attendees.

Today, the Japanese students association did a session on Japan. I am writing down some of the interesting and new things I got to know here.

Japan is a small island with a very high population. Sushi is considered as the most favorite food among school children. Washoku is the traditional meal served in traditional restaurants which includes a soup and about 3 side dishes. This is considered as an intangible heritage by UNESCO.
Takikomi Gohan is another popular Japanese rice dish which they shared with us today. It was delicious and following is a picture I took before I start eating it. :)


They clarified the actual meaning of Otaku which means a person who is dedicated for a certain hobby or a favorite activity. I also heard for the first time that Japan is famous for anime. It might be my ignorance that I haven't heard it before. They showed some famous animations and also an video of real people who mimic cartoons. Anime Otaku are the people who are into animations.

Geisha is traditional female who entertain visitors in traditional restaurants. But they are not prostitutes as interpreted by some movies. They wear traditional Japanese dress and it needs lot of practice to become Geisha. Apprentice of Geisha are called Maiko. Geisha are not seen by general public and their performances can not be recorded or taken photographs of where as Maiko can be seen by public. Cost of visiting such traditional restaurants where Geishas are, is very high.

Budo is different kinds of Japanese martial arts such as Karathe, Judo etc. Some say that Budo descend from Samurai-who are the warriors in ancient Japan. But it is a both yes/no question. Budo is not to hurt anyone else but to overcome one's own self.

They also clarified the difference between Ninja and Samurai. Ninja are the people who were considered as messengers employed in spying etc. They usually carry a small a knife like tool where as Samurai are the real military warriors who carry the traditional samurai sward. But once the Samurai was prohibited in Japan around 1867, currently people have only the dream of becoming a samurai because they are very attractive.

So above is just a glimpse of what I learned about Japan from today's session most of which are new to me and I hope to explore more about certain aspects such as Japanese cuisine etc.
Looking forward to do a session on Sri Lanka with the Sri Lanakan friends in Purude. :)

Tuesday, February 4, 2014

Presenting Algorithms/Protocols in a neat way using Latex

Latex is a very useful tool for scientific writings. It has many cool features to present our writings in a neat manner. I use the TeX Live version of Latex on Ubuntu and I am going to describe how to present algorithms/protocols which contains different steps using the algorithm and algorithmic packages of Latex.

If these two packages do not come with the default installation, you need to install algorithm.sty and algorithmic.sty files to your local installation or you can just place them in the folder where you have the latex file you are currently writing.

First let me show an example output of the latex script which uses the above two packages:

As shown above, algorithm and algorithmic packages take care of all the details such as putting a border around the algorithm/protocol, including a topic for that, numbering the steps with precise alignment and breaking the steps even across several lines without affecting the alignment and numbering.

Following is the Latex script to get an output as above:

1. First you need to include the two packages with \usepackage command as shown below:
\documentclass[a4paper,11pt]{article}
\usepackage{algorithm}
\usepackage{algorithmic}

2. Then you can use the actual script which produces above output using the two packages as shown below:
\begin{algorithm}[H]
\floatname{algorithm}{Attack}
\renewcommand{\thealgorithm}{}
\caption{Steps that Mallory follows to obtain key K}
\label{protocol1}
\begin{algorithmic}[1]
\STATE $M$ : Eavesdrops the protocol 1 above and gets $X$ from step 1 and initiates the same protocol with $B$, by substituting $X$ for $K$ above.
\STATE $M\rightarrow{B}$ : $P = E_{B}(S_{M}(X)) = E_{B}(S_{M}(E_{B}(S_{A}(K))))$
\STATE $B$ : $V_{M}(D_{B}(P)) = V_{A}(D_{B}(E_{B}(S_{A}(X)))) = X$
\STATE $B\rightarrow{M}$ : $Q = E_{M}(S_{B}(X)) = E_{M}(S_{B}(E_{B}(S_{A}(K))))$\\
Since the same key pair is used for both encryption and signing, $S_{B}(E_{B}(message)) = message$\\
Therefore, $Q = E_{M}(S_{A}(K))$
\STATE $M$ : $D_{M}(Q) = S_{A}(K)$
\STATE $M$ : Since the same key pair is used for both encryption and signing, $E_{A}(S_{A}(K)) = K$. Mallory can obtain the key $K$ in this way and decrypt all the subsequent messages encrypted with key $K$.
\end{algorithmic}
\end{algorithm} 

[H] in line one specifies to include this algorithm in the current position itself without floating to somewhere else in the document.

Line 2 customizes the name used to categorize these set of steps: you can name it as 'Algorithm', 'Protocol' etc. Here I have used the name 'Attack', since this describes an attack scenario.

Line 3 also customizes a default command in the package by specifying not to number this particular piece of writing. In a research paper, when you have several protocol/algorithm listings, you might need to number them as you want. This command allows to customize that numbering in the way you want, by specifying whether to use Roman numbers, Arabic numbers or letters.

Line 6 specifies style of numbering you need to number the steps of the protocol/algorithm. You also can opt out numbering by leaving the brackets blank.

As shown in Lines 7 and below, each different step in the protocol needs to be preceded by the command \STATE to differentiation and numbering of each step in the protocol.

That covers all the features need to obtain an output shown at the beginning of the post. Hope this helps. 

Monday, October 21, 2013

Random Secrets in Cryptographic Operations

Often we might need to generate random secrets and use them in cryptographic operations when we are implementing cryptographic protocols.

For an example, I recently had to implement Zero Knowledge Protocol with Pedersen Commitment where I need to generate a random secret and convert it to a BigInteger in order to compute the pedersen commitment.  

In this simple post, I thought of noting down the way I found how to do it in Java.

First, we can generate a random secret using "SecureRandom" in java. The article: "Proper Use of Java's SecureRandom" explains how to use SecureRandom properly in order to get it working in a uniform way across different platforms. 
In our example, we generate the random secret by feeding a pre-defined seed - our secret - into the pseudo random number generator of the SecureRandom, so that we can generate the same random secret at a later time as well.

Next, we can convert it to a BigInteger value so that we can use it in cryptographic computations.

Following code shows how the above two steps are implemented:
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;

public class Test {
    public static void main(String[] args) throws NoSuchProviderException, NoSuchAlgorithmException,
                                                  UnsupportedEncodingException {
        String password = "secret";
        //generate random secret using password as the seed
        SecureRandom randSec = SecureRandom.getInstance("SHA1PRNG", "SUN");
        randSec.setSeed(password.getBytes("us-ascii"));

        //create BigInteger of length 256 from the output of the SecureRandom's pseudo random number generator
        BigInteger randSecBI = new BigInteger(256, randSec);

    }
}



How to convert strings to big integers and vice versa

This is a very simple post on something I found useful in recently.

When creating cryptographic elements, we might need to convert Strings to BigIntegers and vice versa.

A good example is: when you want to hide a secret value using a commitment scheme such as pedersen commitment (I avoid explaining the pedersen commitment here and will leave it for a future post).

Following code demonstrate how you achieve the $subject in java:
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;

public class Test {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String identifier = "secretPW";
        //convert string to big integer
        BigInteger identifierBI = new BigInteger(identifier.getBytes("us-ascii"));
        System.out.println("Identifier: " + identifier + " converted to Big Integer: " + identifierBI);

        //convert the big integer back to identifier and verify
        String verifyIdentifier = new String(identifierBI.toByteArray());
        System.out.println("Big Integer converted back to string val: " + verifyIdentifier);
    }
}


Note: as in line 8 above, it is good to mention the encoding when converting the string to bytes so that your code will run in the same way even when deployed in different platforms.

Monday, September 30, 2013

How to build an Android app with Eclipse in Ubuntu

Recently I had to write an Android app and I followed the official Android app development guide at http://developer.android.com/training/index.html

Here in this post, I intend to write down the steps I followed, issues I came across and how I did overcome them. I followed the approach of downloading the SDK separately and integrating eclipse with it, because I needed to use it with some other IDE too. You also can follow the other approach where you can download the ADT bundle which has an Eclipse IDE with built-in Android Developper Tools.

Step 1: Installing Android SDK

Download the Android SDK from http://developer.android.com/sdk/index.html and unzip it to a location of your choice.
Change directory to [android_sdk_home]/tools and run ./android. This starts the Android SDK Manager through which you can install the platform tools, APIs etc. Check and install the necessary artifacts as shown below:


While installing, you might come across an error saying: "Stopping ADB server failed (code -1)", after the first installation completes, you might need to re-run the Android SDK Manager following the same steps above and the above error will not occur during the installation. It is important that you get rid of that error because it causes problems while you run the program later.

Step 2: Setting up the IDE

I used eclipse for my first app and you can setup eclipse for Android application development by installing ADT plugin as mentioned in http://developer.android.com/sdk/installing/installing-adt.html

If the Android related options are not shown in the tool bar of eclipse once you restarted it after the installation of the plugin, go to Window->Custom Perspective->Command Groups Availability and check Android SDK and AVD Manager. Then go to the other tab in the same window: Toolbar visibility and check the same. You will see Android development options in the toolbar as shown below:



Step 3: Creating the Android Application and Running it on the Emulator

You can follow the post at http://developer.android.com/training/basics/firstapp/creating-project.html to create an Android project in eclipse and identify its main component. Then you can follow the post: http://developer.android.com/training/basics/firstapp/running-app.html in order to get to know how to run your app in an emulator.

You can read more about Android Emulator at http://developer.android.com/tools/devices/emulator.html

You have to create and run a virtual android device which is used as the emulator to run your app. You can do this via Android Virtual Device Manager which can be started either through the icon in the eclipse tool bar above or through command line, by executing ./android avd command.

If you are using a 64-bit Ubuntu version, you may get an error saying: "Failed to start emulator: Cannot run program "/home/hasini/android//tools/emulator": error=2, No such file or directory" when you are trying to run the emulator.
In this case, you need to install ia32-libs with: "sudo apt-get install ia32-libs"

After that you can successfully create a Android Virtual Device and run your project in it by Run->Run As->Android Application in Eclipse.
Following is a screen capture of my first hello world Android App:


That's it. Hope this post helps if you too came across the same problems I did, in creating my first android app.

Tuesday, July 2, 2013

WSO2 Identity Server in the SCIM Interop at Cloud Identity Summit 2013

WSO2 Identity Server is remotely participating in the SCIM Interop which will be held in parallel to Cloud Identity Summit 2013...

Following are the connection details of the publicly hosted WSO2 IS instance for this interop:

SCIM User Endpoint URL : https://209.126.229.93:9443/wso2/scim/Users

SCIM Group Endpoint URL : https://209.126.229.93:9443/wso2/scim/Groups

Credentials for Basic Auth Authentication:

          User Name : interopUser
          Password : interop#321

Details for OAuth Bearer Token Based Authentication:

          Client Id : 00bZzLviiM1QOSvtFv7ZQDOWBNEa
          Client Secret : CsN87SjTCG_X9qGN6xcfwJOakrga
          Access Token URL : https://209.126.229.93:9443/oauth2endpoints/token
          Authorize URL : https://209.126.229.93:9443/oauth2/authorize

For more details, you may refer my previous posts on how to authenticate to SCIM REST endpoints via OAuth and how to consume SCIM endpoints through curl...

Please let us know your feedback...

Update on 8th July: Interop testing was performed during the week of 1st July - 5th July with selected  two partners: PingOne & Salesforce. The graphic below was designed to illustrate the WSO2 Identity Server - SCIM integration with two partners in the SCIM-Interop - CIS 2013.


Monday, July 1, 2013

OAuth Bearer Token based Authentication for WSO2 IS SCIM endpoints

WSO2 Identity Server acts as a SCIM Service Provider (both hub and spoke type service providers) as well as SCIM Service Consumer.

My previous post (WSO2 Identity Server as a SCIM Service Provider) explains how to consume SCIM REST endpoints in WSO2 IS, with curl - using Basic Auth authentication.

WSO2 IS supports OAuth bearer token based authentication for SCIM REST endpoints from its 4.5.0 release onwards...
This post explains how to leverage OAuth 2.0 feature of IS in order to authenticate to SCIM REST endpoints of IS...

Step 1:
Login to IS (default credentials admin:admin) management console and create a new entry for an OAuth client application. After creating the application entry, click on it to view its details as below.


Now copy the Client Id, Client Secret & Access Token Url for future use.

Step 2:
Now lets obtain a valid access token in order to get authenticated to SCIM REST endpoints.
We can use resource owner password credential grant type for this. Format of the the curl command to obtain the access token is:

curl --user Client Id:Client Secret -k -d "grant_type=password&username=username&password=password" -H "Content-Type:application/x-www-form-urlencoded" https://localhost:9443/oauth2endpoints/token

You need to replace the bold strings in the above command with valid values copied from the step 1 above and the username & password of the resource owner. (You can use admin,admin for that in default pack)

Once you execute the above command, you will get a response as below:

{"token_type":"bearer","expires_in":3600,"refresh_token":"16e3de3b7af4e7a43b7e56cd9362ff","access_token":"492d8b51cb815bbe143f219ac2cf61c3"}

Copy the access token value in the above response.

Step 3:
Now we can consume the SCIM REST endpoints using the above access token.

For an e.g; you can use a curl command like below to create a user through SCIM REST endpoints:

curl -v -k --header "Authorization: Bearer access_token" --data "{"schemas":[],"name":{"familyName":"gunasinghe","givenName":"hasinitg"},"userName":"hasi","password":"hasinitg","emails":[{"primary":true,"value":"hasini_home.com","type":"home"},{"value":"hasini_work.com","type":"work"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users

You need to provide the access token copied in the above step 2, for the bold string in the above command...

That's it.. You can refer more curl commands to consume SCIM endpoints from my previous post. And also, you can use the SCIM sample clients in WSO2 IS samples to invoke the SCIM endpoints using both Basic auth and OAuth.

Tuesday, April 16, 2013

Enterprise Security and Identity Management Use Cases with WSO2 Identity Server

This is the set of slides used in WSO2Con 2013 - tutorial session on the topic: "Enterprise Security and Identity Management Use Cases with WSO2 Identity Server", along with demos for each of these use cases.

I plan to blog about individual samples used to demonstrate each of these use cases in my future posts.


Friday, January 4, 2013

Authorization with XACML when authenticated with X.509 certificates

Use Case:

In addition to authentication, authorization is a mandatory security requirement in most of the cases where users try to access various resources based on their privileges.
Usually the same user identifier is used for both authentication and authorization.


The most common scenario is to authenticate the users with their user names and use that user name to authorize the user based on their roles and privileges.

In this post, we are going to implement a scenario where X.509 certificates are used in authentication and authorization is also performed in the flow, using XACML.

WSO2 ESB will be the point of authentication and policy enforcement while WSO2 Identity Server will be the policy decision point.

Deployment:


1. Proxy service at ESB fronts a back end web service (lets say echo service hosted in the ESB itself) which is the actual resource accessed by the user.
2. Proxy service is secured with WS-Security Sign & Encrypt policy where users are authenticated with their signatures based on X.509 certificates.
3. ESB or the PEP identifies the user identifier as the DN in the certificate and sends the authorization request to the PDP-which is Identity Server.
4. Identity server evaluates the authorization request based on the defined XACML policies and returns the decision.
5. Based on that decision, ESB grants or denies the user the access to the actual web service.

Implementation with WSO2 Enterprise Service Bus and Identity Server:

1. Setting up Identity Server.

- Download Identity Server 4.0.0 from here and unzip it.
- Change the port offset in carbon.xml to 1. (Since we are running both ESB and IS in the same machine)
- Start the server, login to management console and go to Entitlement->Administration to upload the XACML policy.
- Obtain the XACML policy from here and import in to IS.
- Promote the policy to PDP as shown in the below diagram.



2. Setting up ESB

- In ESB, we need to create a proxy, add Entitlement mediator to its in sequence and secure the proxy service with Sign & Encrypt - X.509 policy.
- Download and unzip ESB 4.5.0.
- Obtain the proxy service configuration from here and deploy it in [ESB_Home]/epository/deployment/server/synapse-configs/default/proxy-services folder and start ESB.
- In proxy service configuration, you might notice we have configured the entitlement callback class to org.wso2.carbon.identity.entitlement.mediator.callback.X509EntitlementCallbackHandler which extracts the user identifier from the X.509 certificate.

3. Running the client.

In order to invoke the above created proxy service and run the end to end scenario, obtain the sample secured client from here and run it main class named : SignEncryptClient.

You can try changing the certificates that the client uses and observe the authorization decision.



Friday, December 7, 2012

WSO2 Charon - Design


Getting started with WSO2 Charon 1.0.0

WSO2 Charon 1.0.0 is released... It is successfully integrated in WSO2 Identity Server 4.0.0 for identity provisioning.

WSO2 Charon is the open source implementation of SCIM specification, and it is made available under Apache 2.0 license.

You can check out my previous blogs which was written around its Milestone 1 release.

In this post, I will provide you step by step guide to play around with it by running the sampels.

Step 1: Obtaining binaries
Two jars are shipped with the distribution. They are:

1. Charon-Core-1.0.0 jar - This is the library that implements the specification and which can be used by any identity management solution to add provisioning capability.

2. charonDemoApp.war - This is the reference implementation of SCIM service provider which uses Charon-Core for SCIM support. It is a RESTful webapp exposing SCIM endpoint which you can host in a servlet container.

You can either obtain these jars from the release distribution or by building the source code.

Step 2: Setting up SCIM service provider
We need two parties to observe identity provisioning capability. i.e: Service Provider and the Consumer. You can use either Charon-Impl hosted in tomcat or WSO2 Identity Server 4.0.0 as the service provider.

My previous blogs explain WSO2 Identity Server's capability as a SCIM service provider. Therefore, here I will explain how to setup Charon-Impl as a SCIM SP.

1. Download tomcat 7.0.11
2. Replace server.xml and tomcat-users.xml [found in tomcat_home/conf] with the attached files here.
4. Place the attached keystore in your file system.
5. Open the server.xml and locate the HTTPS connector. Edit the keystore file location to point to the above keystore.
6. Run the server with sh catalina.sh jpda run.
7. Access http://localhost:8080/ and click on Manager APP.
8. Login with credentials: hasini@wso2.com, 7786htg
9. Upload the
charonDemoApp.war which is obtained from step 1 and access http://localhost:8080/charonDemoApp/ - you should see the Charon home page.

Step 3: Running the samples
1. Compile the source of the charon-samples which is a maven project and found in the release distribution, using the command: maven clean install.
2. Open charon-samples from your IDE.
3 .Go to SampleConstants - here is where all the constants needed to run the samples are hard coded.
          i. Change the KEY_STORE_PATH to your file system location if the default one doesn't work. (This is only needed if you use https as the transport)
          ii. Change the User and Group resource endpoint urls according to your system.
4. Now access "CreateUserSample" class from your IDE. You will see the constants defined at the top - which are the values for the attributes of the user that we are going to create.
5. Run the client. You will see that the user created at server side is returned in JSON format and printed at client side. (You can observe the message on the wire using a tool like tcpmon, as I have shown in a previous post)
6. In the same way, try other samples as well, paying attention to instructions mentioned as comments in the sample code.


Note: You can also run the same set of samples against the SCIM endpoints of WSO2 Identity Server. The configuration that matches with Identity Server, is kept commented out in the SampleConstants file.

That's it.. Enjoy SCIM..! :)

Wednesday, November 14, 2012

Towards a viable and secure health information system - Part 5

This is the fifth and the final of the series of blog posts that I have been writting on the $sbject, inspired by the paper[1].

Let me include the following diagram which illustrates the overall picture on the security requirements of a health information system.


In my previous four posts in this series, I have discussed about Identity Management/Authentication,, Authorization, Auditing and Cryptographic Operations related to the security of health information systems. In this post, I am going to write about another three aspects which are discussed in the paper[1]: de-identification of EMRs for research purposes, user interaction and dispute resolution and security metrics.

5. De-identification

While the EMRs are very useful in medical research as statistics, it should be guaranteed that the records are properly de-identified before disclosing them for research purposes.
Due to the ambiguities in related laws, complexities in de-identifying protected data and the risk involved, the data is rarely shared for research purposes which negatively affect the medical research.
The paper mentions that it is challenging task than implied in the report to develop cryptographic mechanisms to properly anonymize records as required by secondary use considerations.

I need to read about data de-identification before providing my on views on this. However, those techniques should use proper protection against re-identification in order to maintain individuals’ health privacy and build trust in the health care system.

During the research, I came across a description of an interesting research project named "Cloud DNA" [2]. This project is said to investigate on how to enable scientists to share properly de-identified EHRs in the cloud for easy storage, sharing and retrieval.

6.  User Interaction/Dispute Resolution

User Interaction:
Among other factor that we discussed, user interfaces for patients, providers and administrators are eaqully improtant for a secure system.
The paper suggests the following areas to be explored with regard to this aspect:
1. User friendly mechanisms to deal with complexity of user-selected privacy preferences.
2. How much data to make available to patients in what format
3. Techniques for patients to delegate their access rights

Educating the patients on how to use a PHR service or patient's interface of an EMR system is very important aspect in realizing the goal of a widespread health information echo system. While informing them that they have the control of outside access to their records, it is important to highlight that more it is accessible to physicians, better the service they get.

When the patient signs up for a PHR service or a health care provider, he can be presented with a set of easily understandable questions which ultimately defines the access control policies of their medical records.

Dispute resolution
While it needs for patient to have access to and control of their records, should the patients given the right to correct their record? Or else how to resolve disputes on the information in the records? Most administrators do not like this since they can not always trust patients to keep their medical records honestly.
But the patients should be given the chance to raise any dispute against the records in their profile.

The paper illustrated following aspects to be explored with regard to this:
1. Developing way for patients to securely and privately monitor their health records.
2. Allowing ways for patients to dispute the records while preserving original records
3. Coming up with ways to resolve conflicts on the deisputed records

In my view: Patients should have access to all his EMRs and should be able to establish access control over them. But they should not be able to change the medical records as they wish. If there is dispute, or if  a patient suspects a particular report, there should be a way to mark it as suspected immediately - but could only be changed by an authorized medical officer after further tests etc.

7. Security Metrics

Though it is obvious that EMRs have benefits over traditional paper based medical records, there should be proper security metrics to gauge the level of information security/privacy provided by a particular health care information system.

The paper mentions that in order to provide such assessment/analisis, meaningful matrics should be well developed and accepted which opens up research problems on which current work is also going on. Since the domain is limited, the paper believes that matrics can be developed.

Challenges in developpping such metrics are the variety and complexity of threat models and diffculty of measuring potential flaws in Software.

Research problems related to this aspect are:
1. developing threat models covering both electronic and paper based medical records.
2. developing techniques to quantify level of risk associated with sw based health information system

Conclusion:
  • I have been writing this series of blog posts about the security, privacy, access control and identity management aspects related to health care IT systems from the  understanding that I got from various sources and my experiences as well. This was mainly inspired by the paper[1] which provides a research road map on the same topic.
  • The paper[1] is mainly based on the PCAST report 2010 and this PCAST report have caused some arguments in the field. However, the paper[1] and this blog series has only taken the technical requirements that it has highlighted into consideration to identify the research problems and this blog series doesn't  intend to support or unsupport the report.
  • Although the research community has identified and actively working on the research problems pertaining to the subject, there are many obstacles as well, such as difficulty in obtaining testbeds and test data for research  due to the sensitivity and critical nature of the data. Therefore it has been hard for research to comeup with successful results without realistic and live data and also those results obtained from sample mock data are unlikely to be accepted by the community.
  • No matter how technically strong the healthcare IT solution is, there should be adequate and non-ambiguous legislation to fully realize the goal of a nation wide health IT echo system.
  • During my research on this, I've come across some active and interesting research efforts from some research groups such as Health & Medical Security Lab[3], SHARPS [4] , CERIAS [5], and MediVault [5].
  • The paper[1] provides a good overall understanding of the security requirements of a healthcare information system. Most importantly, it provides a very good understanding about the current research problems in the area for a budding researcher who is passionate about carrying out research in security, privacy and access control aspects, outcome of which can be contributed to realize the vision of the secured and viable health IT echo system. 
Related work:
I have done a webinar on Security Patterns with WSO2 ESB for which I picked use cases from health care domain and it was when I first got interested in investigating further on the security, privacy and identity management requirements of healthcare IS. In that effort, I mainly referred MSc thesis on the topic : Security in SOA-Based Healthcare Systems by Richard Sassoon.

References:
[1] A Research Roadmap for Healthcare IT Security inspired by the PCAST Health Information Technology Report
[2] Cloud DNA
[3] Health and Medical Security Lab
[4] SHARPS
[5] CERIAS
[6] MediVault
[7] Security in SOA-Based Healthcare Systems

Tuesday, November 13, 2012

Towards a viable and secure health information system - Part 4

This is the fourth of the series of blog posts that I have been writting on the subject, which was mainly inspired by the paper[1].

For the clarity and the ease of summarizing, let me include the following diagram which illustrates the overall picture on the security requirements of a health information system.


In my previous three posts in this series, I have discussed about Identity Management/Authentication, Authorization and Auditing. In this post, I am going to write about what role cryptographic techniques play in healthcare IS.

4. Cryptographic Techniques
Confidentiality, integrity and non-repudiation are key security requirements that should be met by any health information system. Encryption, digital signature are the de-facto mechanisms of achieving them. However, traditional encryption mechanisms have major limitations in accomplishing the goals of a distributed, country wide health information echo system.
Let me discuss this further adhering to my usual format: i.e discussing views from the paper[1] and me.
  •  As in any security sensitive system, data both at rest and on the wire should be encrypted.
  • Traditional public key cryptography has limitations to be used in a health information echo system because of the complexity in exchanging keys used to decrypt the EMRs, among the authorized principals who may come from around the country.
  • Therefore, keys used to encrypt the data (we can call this cryptographic authorization as well) are not attached to individuals, but attached to role/identity attributes.
  • If encrypted data is stored in one machine, the keys to decrypt should be obtained from  another service which is separately managed.
  • The metadata related to EMR(which was discussed in detail in my second post) which contains information about access control to EMRs, should be digitally signed.
  • Some of the metadata can be encrypted as well. Since the EMRs should be able to be searched from anywhere in the country, the keys to decrypt the metadata should be known to secure search engines but only the authorized personal should be able to decrypt the actual EMR data.
  • The paper highlights the research problems motivated by the above requirements.
    • Developing techniques to support flexible key management policies 
    • Paper recommends using Attribute Based Encryption (ABE) for cryptographic access control and identifies research problems along that line as:
                  - Developing techniques to specify and enforce access control for EMRs based on ABE
                  - Developing key management solutions for ABE
                  - Provide cryptographic mechanisms to properly anonymize records as required by secondary use considerations such as research.

Here are some of my thoughts on the usage of cryptographic techniques in healthcare information systems
  • As the paper suggests, Attribute Based Encryption(ABE) would provide a scalable solution for the cryptographic needs of a health information system and also a solution for the key management requirements.The post[2] describes ABE in detail, in summary what happens is:
    "The plaintext is encrypted with a set of attributes. The KGS(Key Generation Server), which possesses the master key, issues different private keys to users after authenticating the attributes they possess".
  • The same post[2] describes two flavors of ABE which are Key Policy - Attribute Based Encryption and Ciphertext Policy Attribute Based Encryption. I believe the second one is more scalable since the keys are issued for the attributes that a principal possesses and whether the given cipher text can or can not be decrypted by that key is determined by the access policy enforced in the cipher text.
  • In the paper[4], Akinyele et al. have implemented a solution for self protecting EMRs using Attribute Based Access Control. There, they have used a standard format (CCR) and an automated policy engine which assign a access policy for each record in patients' EMRs using which the records are encrypted with ABE.
  • However, there is huge trust placed on Key Generation Server for correctly authenticating and validating the attributes that a user possesses before issuing keys. Therefore necessary actions should be taken in order to prevent it being a central point of failure.
  • Performance should also be considered along with security. Public key cryptography is known to posses performance bottlenecks than symmetric key cryptography. However, symmetric key cryptography also has its own limitations. The thesis[3] introduces a symmetric cryptographic approach for key management known as Attribute Based Group Key Management.
Above are based on some of my readings about privacy preserving cryptographic techniques which can be used to accomplish the requirements of healthcare IT systems.

Another area related to the above discussion that I need to explore further is privacy preserving secure searching techniques to make the necessary EMRs available for the authorized physicians when they submit the search query from any location in the country.

References:
[1] A Research Roadmap for Healthcare IT Security inspired by the PCAST Health Information Technology Report
[2] Attribute Based Encryption
[3] Privacy Preserving Access Control for Third Party Data Management Systems
[4] Self-Protecting Electronic Medical Records Using Attribute-Based Encryption

Towards a viable and secure health information system - Part 3

This is the third of the series of blog posts that I have been writting, inspired by the paper[1].

Let me include the following diagram which illustrates the overall picture on the security requirements of a health information system.


In my previous two posts in this series, I have discussed about Identity Management/Authentication and Authorization. In this post, I am going to write about another important aspect of health care IS which is auditing.

3. Auditing
Auditing helps mainly in investigations about frauds or security breaches. In order to recreate an incident, meaningful and useful audit logs should be readily available. Protecting audit log archives is another challenge to be addressed.

Let me discuss this further adhering to my usual format: i.e discussing views from the paper[1] and me.
  • The report mentions that the actions like the ones below in a health IT system should be monitored and audited by a security infrastructure which is independently managed.- Actions taken by different principals interacting with the system such as accessing, modifying and deleting EMRs
    - The policies/information used to authorize those actions.
    - Changes to authorization policies.
  • It highlights the need of protecting audit logs with cryptographic mechanisms such that they can not be deleted, changed or tampered even by the administrators.
  • It also raises the need of facilitating the patients to review audit records pertaining to their EMRs.
  • The paper[1] draws attention towards an important concern related to auditing. That is: although it is easy to log every action, it generates lot of volume which causes problems in storage and retrieving info & recreatingan event when an incident occurs.
  • Research problems identified by the paper in this space:- Exploring techniques to create audit logs in such a way that we can recreate events as well as limit the amount to store.
    - Finding new approaches for storage and retreival and also user-friendly access to logs.
Let me note down some of my ideas with this regard:
  • Distributed logging standards such as XDAS[2] can be used in for auditing at a certain layer in the distributed health IT echosystem.
  • Efficient digital signature mechanism needs to be in place for integrity protection of the log.
  • Cassandra storage can be used to overcome the issue of large volumes of audit logs and a parallel processing techniques such as MapReduce can be used to efficient processing of audit logs at the retrieval stage. (Cassandra has been used in WSO2 Stratos which is the open source cloud middleware platform offered by WSO2. There, each tenant is able to view logs specific to that particular tenant. Similar techniques can be used to make audit records related to EMRs of a particular patient available to that patient which is a requirement raised in PCAST report as well.)

References:
[1] A Research Roadmap for Healthcare IT Security inspired by the PCAST Health Information Technology Report
[2] Introduction to XDAS

Sunday, November 11, 2012

Towards a viable and secure health information system - Part 2

I have started discussing the $subject in my previous post based on a research paper[1] that I happened to read.
This is the second post of the series. Lets again take a look at the following image which summarizes the key considerations with regard to security, privacy and identity management of a healthcare information system.


In my previous post, I have given an overall idea on security in health care IS and discussed the first aspect, which is Identity Management and Authentication.
In this post, I am going to take the second aspect into consideration..

2. Authorization
Since a health information system contains personal information with varying sensitivity, not only authentication is sufficient, but also the rights of the authenticated principals to access certain data should be validated - which we refer as authorization.

For an example, a patient's medical records should only be possible to access by an authenticated principal in the role of a physician and also only during his/her working hours, while clinical data can be accessed by nurses as well. On the other hand, researchers can access medical data only if they are properly de-identified.
There should be proper mechanisms in place to enforce such fine grained authorization.

Let me discuss this in terms of, what the paper[1] analyzes and what my views are, on the mechanisms to accomplish the security requirement of authorization.
  • The PCAST report highlights that according to current regulations, it is not necessary to have patients' consent to disclose treatment/payment information in certain conditions. Therefore patients do not have control over privacy of their medical records which affects negatively to build and maintain public's trust in health care IT.
  • Mentioning some background information, report advocates the idea of a universal language to exchange health information between different healthcare providers who may still have proprietary formats/schema of storing data. It proposes to use a language structured as individual data elements, together with metadata that provide an annotation for each data element. It can be an extensible markup language, where individual pieces of data can be tagged with context-sensitive metadata.
  • Report envisions that such a data representation framework can enable fine grained authorization/privacy preferences where the consent for access each data element (authorization policy) is expressed through meta data attached to it. 
  • The paper[1] believes that the data representation framework plays a big role in secured EMR system with fine grained access control, and illustrates how the above recommendations motivates interesting research problems such as:
          - how to programatically tag data based on a particular security/authorization policy
          - how to efffectively feed tagged-data elements to an policy engine to get the decision whether the   requested access is allowed or not.
          - how to efficiently parse and process tagged data elements.

Let me mention some of my views on this aspect:
  •  Although I do not have much understanding to comment on meta-data tagged data elements[2], I too strongly believe that there should be fine grained authorization models employed which are also robust, efficient and scalable to achieve the level of privacy that the records in a healthcare IS needs.
  • From my understanding about the authorization models used in the identity/privacy world, XACML is a good candidate to implement a fine grained authorization system for healthcare information echo system. It is a policy based mechanisms which is flexible for changing requirements and which facilitates to define fine grained authorization policies based on identity attributes of the principals.Other key attributes of a XACML based solution are: loosely coupled, externalized, centralized and standardized.
  • A real world use case example of using a XACML based authorization solution for health care can be found at [3].
  • Privacy preserving secure search is an interesting aspect brought to discussion by the PCAST report. Although the search engines aggregate relevant data from multiple providers and provide the result for a search query, engine itself can not see the data which is authorized to be seen only by the certain parties.
  • Authorization delegation is another aspect which has not been taken into consideration in the above report and the paper. It is important when physicians and patients use various mobile devices to access EHR and PHR where constrained authorization delegation needs to be performed. Industry standard to accomplish this requirement is OAuth[4].
  • I found an interesting research project description [5] which develops an security schema for Veterans Affairs (VA) which claims to provide a secure, manageable, portable, scalable and cost effective solution with fine grained access control in place and which is easily pluggable to the existing system.

In summary:
- Enabling to specify fine grained authorization rules based on privacy preferences and to enforce access control is a key aspect of a secure healthcare information system.
- It should be possible to realize such an authorization model even with existing legacy EMR systems with minimal or no change to the underlying persistent mechanisms.
- One strong mechanism suggested by PCAST report is to use metadata in a tagged data elements framework to achieve this which motivates several research problems.
- Some existing technologies and standards can be used to implement certain aspects of an authorization solution for a health information system such as XACML for fine grained policy based access control and OAuth for authorization delegation.

References:
[1]  A Research Roadmap for Healthcare IT Security inspired by the PCAST Health Information Technology Report
[2] Metadata and Meaningful Use
[3] XACML Sample for Health Care Application
[4] OAuth
[5] Trusted Medical Information System and Health Informatics

Friday, November 9, 2012

Identity Provisioning from On-Premise to Cloud

Quoting from one of my initial posts on SCIM:

"Today the enterprise IT solutions adopt products and services from multiple cloud providers in order to accomplish various business requirements. Hence it is no longer sufficient to maintain user identities only in corporate LDAP.

In most cases, SaaS providers also need dedicated user accounts created for the cloud service users, which raises the need of proper identity provisioning mechanisms to be in place."

Identity Server(IS) 4.0.0 which is a 100% open source Enterprise Identity & Entitlement Management Server, supports the open standard SCIM for identity provisioning as I have mentioned in my previous posts as well.

With this, WSO2 Stratos Live next release will also be supporting SCIM for Identity Provisioning.

This post is about implementing a use case of identity provisioning from on-premise to cloud using Identity Server and Stratos (here, same IS distribution can be used to simulate Stratos IS with multi-tenancy aspects).

Following diagram gives an overview of the deployment:

Use case:
Two organizations called wso2.com and willpower.org have their on-premise enterprise Identity Management Solutions running with Identity Server.
Both these organizations use cloud services offered by WSO2 StratosLive and have created tenants in there.
Now, they want to provision the user account, identity management operations such as creating/deleting users and groups, updating user identity attributes etc which happens in their on-premise Identity Server to the respective tenants they have in StratosLive, as shown in the above diagram.

Implementation:
In this case, Identity Server running inside the organizational boundaries of each organization act as SCIM consumers and the Identity Server as a Service running in StratosLive acts as a SCIM Service Provider.

Each organization can register SCIM provider configurations pointing to their tenant space in SLive, within enterprise IS instances.

Following is a step by step guide for this.
Step1: setup
Download and unzip IS distribution into three different folders (to represent  instances at: 1.wso2, 2.willpower, 3.SLive)

Increment Ports->PortOffset element in carbon.xml s.t three instances are running in following ports:
IS of WSO2: 9443
IS of Willpower: 9444
SLive IS: 9445

You can find more details on how to do this step from the step1 of my previous post.

Step 2: creating tenants
Login as admin to the IS instance that simulates Stratos IS in our setup and create two tenants named "wso2.com" and "willpower.com".

Screen shots of the steps shown below:




Step3: registering SCIM providers

Now login to IS instances of WSO2 and WillPower organizations as admin user and register SCIM provider configurations pointing to their respective tenant spaces in SLive IS instance.
For a more detailed guide on how to register SCIM providers, please refer to step3 of my previous post.
Example configurations shown below:




Step 4: testing provisioning

Now you can test creating/deleting/updating users, groups in organizational IS instances and verify that they are provisioned to particular tenant space of each organization in SLive IS instance.

That's it... Thanks..!


Saturday, November 3, 2012

Identity Synchronization across Multiple Nodes with SCIM

We sometimes manage user identities in multiple nodes and we need to synchronize all the nodes when one node gets updated.

In this post we will look at how we can leverage SCIM - an open standard for identity provisioning, to achieve this requirement of Identity Synchronization.

As I have mentioned in my previous post, WSO2 Identity Server (IS) supports identity provisioning with SCIM, based on WSO2 Charon which is the implementation of the specification.

Identity Server can act as both SCIM Consumer and Service Provider.
To achieve the aforementioned requirement, we leverage both those capabilities of IS at once.

Let me describe a use case and then provides steps how to implement that with WSO2 Identity Server.

Use Case:

Lets say we have an organization which has multiple stores distributed across a region. Each store maintains a user store. And there is a central store as well. When one sub store updates its user accounts, that update should be propagated to central node and the central node sends that update to all the other sub stores.
If an update happens in the central node, that should also be propagated to all the sub stores.

Following diagram depicts this better: The directions that each node's updates propagate, are indicated by arrows with specific colour of each node.


Aside each node, I have listed a list of 'Provisioning Admins' along with their provider, if they have any.
Let me describe it. We send a provisioning request to a SCIM provider node from a consumer node. Therefore, we need to register providers at the nodes which plays the role of a consumer at a particular time.

And you need to have an account in the provider node, with proper permission to do provisioning. Because, as I mentioned in the previous post, SCIM Service Provider authenticates and authorizes your provisioning request and fulfils it only it is authenticated and authorized.

Lets implement the above scenario step by step so that you will have a better idea:

Step 1: Setting up three nodes..
Download Identity Server 4.0.0 and unzip it into three folders named: 'store1', 'central', 'store2'.
Since we are starting in the same machine, we need to change the port of set of each IS instance.
Go to [IS_Home]/repository/conf and open carbon.xml. In 'central' instance, make Ports->OffSet to 1 and in 'store2' instance, make Ports->OffSet to2.
Start the three instances.
Now our three instances are running in following ports.
store1: 9443
central: 9444
store2: 9445

Step 2: Registering Provisioning Administrators...
Lets now create user accounts in each node which has privileges to register SCIM providers and/or perform provisioning on behalf of each store, as listed in the above image.

Store1:
Got to management console of store1 IS instance by typing url: https://localhost:9443/carbon/ in a browser, login to management console as admin,admin and go to configure-> users and roles
Create 'centraladmin', 'store2admin' user accounts.
Also create a role called 'provisioning admin' and assign that role the above two users and the two permissions: 'login' and 'Identity Provisioning' as shown in the following diagram.


Now, centraladmin user has the permission to provision user account updates happen in central store, to store1. In this case, central store becomes a SCIM Consumer and store1 becomes a SCIM Service Provider.

And store2admin user has the permission to send provisioning requests to store 1, via central store in order to propagate updates happen in store 2.

Default admin account of store1, which has all the permission, provision the updates happen in store1, to central store.

In this way, please create the relevant provisioning admin user accounts in central store and store2 IS instances as well, as illustrated in the first diagram above and assign them to the provisioning admin role with the two permissions.

Step3: Registering Providers
Identity Server allows consumer nodes to register SCIM providers in two ways:

1. Registering global providers - any user management operation performed in a particular tenant space will be provisioned to the global providers.

2. Registering providers specific to particular user account - any user management operation comes through SCIM Service Provider endpoints of a particular node will be further provisioned to the providers registered under the account from which SCIM requests was authenticated and authorized.

Lets look at how to register SCIM Providers at the central store in our scenario so that both above mechanisms will be clear to you.

1. Registering global SCIM providers at the central store.
According to our requirement, any user management operation performed by users in the admin role of central store should be provisioned to store1 and store2.
- Login as default admin user in central node (https://localhost:9444/carbon/admin/login.jsp)
- Access Main->Manage->SCIM
- Register New SCIM Provider.
We need to register both store1 and store 2 as global providers.
Following image shows the configuration of store1 SCIM provider.
Here we need to define a provier id, and provide user name and password to  authenticated and authorized to SCIM provider node(in this case it is centraladmin account which we registered in both store1 ans store2 in the previous step) and the URLs of the SCIM User & Group endpoints.


You need to register store2 also as a global provider with relevant configuration.

2. Registering SCIM providers specific to user accounts, at the central store.
According to our requirement, any provisioning request coming to central store from store1 should be provisioned to all the other sub stores except to store1.

Therefore, user account of the store1admin in the central store should be able to define to which providers my scim provisioning request should be further provisioned to, from the central node.

- Login to central node as store1admin.
- Access Main -> My Identity -> My SCIM Providers
- Now as the store1admin, you can register store2 as the SCIM Provider  by providing relevant configuration as shown below.

- And then login to central node as the store2admin account and register SCIM provider pointing to store1 endpoints.



Now we are done configuring central node for our provisioning scenario.

Then login to store1 and store2 IS instances as default admin and register central node as the global provider in both store1 and store2 as shown below.

Store1:

Store2:

 
Please refer the very first image in this post to make sure that you have created all the relevant provisioning admin user accounts in each IS node, given them proper permission and registered the corresponding SCIM providers as listed in that diagram for each node.

Step 4: Test Identity Synchronization
Now login to store1 as default admin and create a user account. Observe the logs at the backend console of each node. You will observe info logs mentioning that the user created at store1 is also created at central store and store2.

You can login to management console of central store and store2 and verify that the user created in store1 is listed in other two nodes as well.

You can perform other user and role management operations as well in each node and verify whether it is synchronized with other nodes as expected in our use case.

Following are the list of user management operations currently supported in WSO2 Identity Server to be provisioned via SCIM.
1. Create User
2. Delete User
3. Update credential of the user by admin
4. Update the profile of a user by admin
5. Update the profile of a user by the user himself
6. Create Group
7. Delete Group
8. Add users to group by updating group (Update user list of role)
9. Rename Group

Following are the list of user management operations allowed by WSO2 Identity Server, but not currently supported to be provisioned via SCIM.
1. Update credential of the user by user himself.
2. Add users to group by updating user (Update role list of user) - same outcome can be achieved by the no. 8 operation above.

I hope now it is clear to you how we can leverage SCIM - open standard for Identity Provisioning to achieve a use case of Identity Synchronization across multiple nodes using the capabilities of WSO2 Identity Server.

Configuring provisioning through configuration file
Identity Server also supports configuring SCIM providers through configuration file, in addition to allowing to register providers through UI which was explained above.
In this case, it is the admin of a particular node who configure providers which is different to individual provisioning admins registering SCIM providers through UI.

The relevant configuration file is: [IS_Home]/repository/conf/provisioning-config.xml

If you are configuring through configuration file, you need to follow the above steps until step 2 is completed.

Then shut down all the three IS instances. Replace provisioning-config.xml file of each instance with the ones shown below and restart the IS instances.

store1 configuration file:

    
        
            store1admin
            store1admin
            https://localhost:9444/wso2/scim/Users
            https://localhost:9444/wso2/scim/Groups
        
    
    
        
            
        
    

central store configuration file:

    
        
            centraladmin
            centraladmin
            https://localhost:9443/wso2/scim/Users
            https://localhost:9443/wso2/scim/Groups
        
 
            centraladmin
            centraladmin
            https://localhost:9445/wso2/scim/Users
            https://localhost:9445/wso2/scim/Groups
        
    
    
        
            
     
        
 
     
        
 
            
        
    

store2 configuration file:

    
        
            store2admin
            store2admin
            https://localhost:9444/wso2/scim/Users
            https://localhost:9444/wso2/scim/Groups