Friday, November 30, 2012

How to Enable Secure Vault in a WSO2 Carbon Product



1. Extract the carbon product to a preferred location

2. Make sure that cipher-text.properties file is available in CARBON_HOME/repository/conf

3. Make sure that ciphertool.sh file is available in CARBON_HOME/bin

4. From a command line, navigate to CARBON_HOME/bin. From there, run the following command; In Linux, sh ciphertool.sh -Dconfigure 
In Windows,   ciphertool.bat -Dconfigure
This would prompt the following in the command line
[Please Enter Primary KeyStore Password of Carbon Server : ]There, you can give ‘wso2carbon’

5. After finishing the execution of ciphertool.sh, check the values in the cipher-text.properties file. It would contain an encrypted value as below.
bUJNAEp+hrzC97bxZfdehpi78SoQVCdy0Nnv/5KUvyi14BEc3b4d9Z7fD5TRyWgRyE8rZqZSVg7jFSBxcWnHRmdldTkPBT4x8wZhRDIFtvnI7KzCj9kUdPwol849EDno6ogsG3K+jlm7wEPvE1dGsw46dimb3JiNFJiw1HxQi+g\=

6. Then start up the server normally with In Linux, sh wso2server.sh In Windows,   wso2server.batDuring the server start up, it would prompt the following twice.
[Enter KeyStore and Private Key Password :] There also you  need to provide ‘wso2carbon’ in both the instances.

7. Now your server system is protected with the secure vault configuration, and all the passwords are encrypted and exposed to outside via aliases.

x



When configuring Secure Vault with WSO2 products : Error initializing Cipher

You can configure Secure Vault with WSO2 ESB (or any other Carbon product) to secure the data in the configuration files such as
 - User Store passwords
 - Database passwords           etc.
You may get this work completely if you follow this blog on How to configure Secure Vault in WSO2 Products.
If you try with a custom keystore, you might encounter the following error for certain instances.
Exception in thread "main" org.wso2.ciphertool.CipherToolException: Error initializing Cipher
at org.wso2.ciphertool.CipherTool.handleException(CipherTool.java:861)
at org.wso2.ciphertool.CipherTool.initCipher(CipherTool.java:202)
at org.wso2.ciphertool.CipherTool.main(CipherTool.java:80)
Caused by: java.security.InvalidKeyException: Wrong key usage
at javax.crypto.Cipher.init(DashoA13*..)
at javax.crypto.Cipher.init(DashoA13*..)
at org.wso2.ciphertool.CipherTool.initCipher(CipherTool.java:200)
... 1 more
Then you can analyze the public certificates of the two jks's  - In default wso2carbon.jks, the KeyUsage is
KeyUsage [
  DigitalSignature
  Non_repudiation
  Key_Encipherment
  Data_Encipherment
]
 - In the custom .jks, the KeyUsage is
KeyUsage [
  DigitalSignature
  Key_Encipherment
]
Since the custom key store's certificate does not have 'Data_Encipherment' it can't use the Ciphertool and encrypt data for secure vault. So they may have to generate a new key store with at least a Self signed certificate. 

Thursday, August 30, 2012

Monitor Stats of Carbon 3.2.x products with WSO2 BAM2

Configuring WSO2 ESB Server with Data Publishers
  1. Download WSO2 Enterprise Service Bus 4.0.2. Unzip the distribution to your preferred location. This directory will be referred as ESB_HOME.
  2. Remove the following jar from ESB_HOME/repository/components/plugins directory.
org.wso2.carbon.statistics-3.2.2.jar

  1. Place the following set of jars into ESB_HOME/repository/components/dropins directory. These jars will act as data publishers of WSO2 ESB.
    1. gson-2.1.jar
    2. org.wso2.carbon.bam.service.data.publisher.ui-3.2.3.jar
    3. libthrift-0.7.wso2v1.jar   
    4. org.wso2.carbon.bam.services.stub-3.2.3.jar
    5. org.wso2.carbon.bam.activity.mediation.data.publisher.stub-3.2.3.jar
    6. org.wso2.carbon.eventbridge.agent.thrift-3.2.3.jar
    7. org.wso2.carbon.bam.data.publisher.util-3.2.3.jar
    8. org.wso2.carbon.eventbridge.commons-3.2.3.jar
    9. org.wso2.carbon.bam.mediationstats.data.publisher.stub-3.2.3.jar
    10. org.wso2.carbon.eventbridge.commons.thrift-3.2.3.jar
    11. org.wso2.carbon.bam.service.data.publisher-3.2.3.jar
    12. org.wso2.carbon.statistics-3.2.4.jar
    13. org.wso2.carbon.bam.service.data.publisher.stub-3.2.3.jar
    14. org.wso2.carbon.utils-3.2.3.jar
The above jars can be downloaded from the FTP Location

  1. Start up the WSO2 AS with the following command from the ESB_HOME/bin directory.
sh wso2server.sh
  1. Log into the management console with the credentials. Go to “Configure” tab. You will see a new feature has been listed in the menu named “Service Data Publishing”. When you clicked on the the feature, the UI will be as follows.


  1. Check the “Enable Service stats” check box under “Service Configuration”.
  2. Specify the Stream Definition Configuration parameters as preferred.
  3. Specify the “BAM URL” under “BAM Credential” in the following format.
tcp://<ip_address>:7611 (eg:  tcp://10.10.12.79:7611)

  1. Click on “Update”.

PS: Similarly, you can configure the other carbon server nodes as well (eg: WSO2 BPS, WSO2 DSS and WSO2 AS)




Configure Standalone WSO2 BAM and Monitor Data

  1. Change the port offset of WSO2 BAM server, so that it will not get port clashes with earlier configured WSO2 ESB.
Change the <Offset> parameter in carbon.xml file that resides in BAM_HOME/repository/conf directory.
  1. Start up the server with the following command from the BAM_HOME/bin directory.
sh wso2server.sh
  1. Invoke the service/s deployed in WSO2 ESB.
  2. Login to the WSO2 BAM Management Console. Go to “Main” tab --> “Manage” menu --> “Cassandra Explorer” --> “Connect to Cluster”.
Provide the following inputs
Connection URL: localhost:9160
Username: admin
Password: admin
Click on “Connect”.
  1. This will list the “Keyspaces”. Analyze the details of the respective Stream Name  under  “EVENT_KS” keyspace. A sample record will be as follows.
With these details, create a BAM Archive package and deploy as a “BAM Toolbox”.

  1. Create a Toolbox that contains the following components.
    1. Database script
    2. Gadget XMLs
    3. Jaggery scripts
The Toolbox should be packaged to a “.bar” package. The sample Toolbox can be found from the FTP location

  1. Deploy the Toolbox from “Main” tab --> “Manage” menu --> “BAM Toolbox” --> “Add” from the WSO2 BAM management console.

  1. From the Custom Toolbox table, browse for the created .bar package and hit on “Deploy”.
  2. Until the complete deployment, the status of the package will be shown as “Awaiting to Deploy”.

  1. Refresh the page until the status changes to “Deployed”.

  1. Go to “Main” tab --> “Manage” menu --> “Analytics” --> “List Scripts”.
  2. Click on “Edit”.

  1. This will open up the Script Editor and it will show the Database script that we have included in the deployed .bar package. Click on “Run”.

  1. With the successful execution of the script, it will show up the Results in the “Script Results” section below the “Script” editor section.
  2. Go to “Main” tab --> “Dashboard” menu --> “BAM Dashboard”. The deployed gadgets on the dashboard will be shown as follows.

Tuesday, August 28, 2012

Authentication on a deployed Web App??

Enterprises use Java Web Applications for various requirements. Often these applications may require to be implemented with access control and authentication as an organization policy. 
In the provided article, I have showed how WSO2 Application Server acts as a deployment container for a web application and authenticate the hosted application against a preferred User Store. Furthermore, the write-up focuses on enforcing secure connections via HTTPS enablement on the Web Application.

Saturday, October 1, 2011

Process Automation Facet in WSO2 BPS, Mechanizes Human Interaction


Every heterogeneous business revolves around tasks that need human interactions. There are computerized procedures that execute much of these bulky tasks. Still they have to be incorporated with human communications. In a business process flow, there are multiple tasks performed by multiple Human Roles and Human Users. Some need to be synchronized, while some needs the pipeline implementation.

For an instance, consider Tasks A and B and Human Roles X and Y that would be completed synchronously. Task A will be accomplished by Human Role X. For the invoke of next task, Task B in line which will be handled by Human Role Y needs a trigger after the completion of Task A. This activator should be prompted for the particular Role Y; not for the Task B.  
WS-BPEL standards facilitated the integration of Human Interaction onto the Process flow. This has been demonstrated by a sample implemented for the WSO2 Product Pack Release Process Automation flow. 

Existing Work Flow of Product Release Process

Build Manager is a person who triggers this process at first place. A build manager can play any role within any product team. He is solely responsible for building products for testing. In the milestones that development teams come across routinely, the build manager builds the products and releases the built pack for the QA for testing. 
Once the issues are being tracked in the product, those are reported and assigned to a developer to resolve. When the issues are fixed by the assignees and after thorough sessions of testing, those products are released as Release Candidates (RC). These RCs too are built by Build Manager and notifications are sent through mails to Carbon – Dev. If they come across any more issues or bugs, then again they are fixed and build the packs again. There can be versions of RCs like RC1, RC2 etc. These package builds are being uploaded to a location where accessible via web. This is followed by checking published packs which includes, ensuring that the binaries are functioning appropriately and completing preparation of documentation and release notes. Then a notification is sent to the relevant groups informing that the particular RC is equipped for the release. 
Then the product managers download the packs and sign them using their private key and upload the signature in a separate location different from the RC hosting site. When that task is completed, the infrastructure people upload the RCs to the relevant correct server where all the finalized releases are maintained. 
Subsequently Oxygen Tank (OT) staff takes up the task of creating a page for the newly done RC and publish it on OT and host the pack there as showed in [1].
Ultimately the Product Release Process comes to an end when the release notes are sent to the relevant mailing lists and forums and blogs are properly updated.
 
Automated Product Release Process

Currently no means of automation is involved with this Product Release Process. Synchronization issues and tracking issues engrossed in the manual release process, will be easily resolved by this automation initiative making the process flow less complicated.
The process is triggered or initialized when an RC is being finalized for the release by the Build Manager. Then the normal work flow will be followed and tasks will be assigned to various members. There will be a “TASK” list for each party who is involved with the process which will display the tasks that have been assigned to each ‘User Role’. This has become a convenient and efficient way of tracking the tasks that takes place during the process. Even the bottle necks of the process, the current progress etc. too can be identified without much difficulty through this system. 
Once a member finishes a task, the system generates a notification saying that the task is ‘COMPLETED’ and the task next in-line will be triggered for the relevant User Role with the ‘READY’ tag. Then all the synchronizations take place and the relevant places get updated appropriately with the proper notices. 

The detailed configuration for Human Task related process automation will be posted soon...

References

Tuesday, September 20, 2011

New Angle to look at SOA...

--- essence from Ganesh Prasad's Practical SOA 

Among numerous trends that has struck the IT industry, SOA holds an important place. Service Oriented Architecture has been a buzz word, for a certain period of time. Most of the enterprises and businesses proudly announce that they "MOVE to SOA"; or their "Business is SOA compliant". But when we take a look at their implementation, still it resides in the complex, spaghetti kind of set up. This complexity and non SOA existence can majorly cause
  • performance drawbacks
  • single point of failure
 If a proper SOA implementation has been executed, it ideally should have
  • loosely coupled components
  • good governance
  • re-usability of components
In a proper SOA architecture, there are 3 main lego blocks namely
  • Service Container
  • Message Broker
  • Process Coordinator 

Service container - Holds the service logic (eg: WSO2 AS)
Process Coordinator - Run time / dynamic process evaluations based on state is handled here. (eg: WSO2 BPS)
Broker - Acts as an adapter, mediator and transformer. Sits in between two applications perform the tasks. (eg: WSO2 ESB)

In any kind of complex deployment environment, first it should be clearly identified what is needed where, out of the above 3 main components.
When the coarse grain analysis is over, in the fine grain analysis, supporting SOA elements such as Rule components, Data services components, Presentation components, Governance components, Registry/repository components etc. can be identified and then deploy the relevant systems appropriately. 

SOA is NOT EASY. But SIMPLE. So plan well & handle with care.

Monday, September 5, 2011

WSO2Con 2011 - Hub of Expertise, Experience and Knowledge

All are keen; lots of enthusiasm; late night hours; ideas coming from every nook and corner; constant follow ups - sync ups; from the topmost head of the office to all the colleagues and subordinates and even the machinery are busy; focused on one main thing. WSO2Con 2011, the BIGGEST IT Conference in Sri Lanka is being held for the second consecutive time with splendor and glamour.

As almost all the WSO2ers too, I am so excited to be a part of this Gala event, rather to be an active participant this time. Because by the time that the last year's WSO2Con 2010 was happening, I was just a mere spectator/ audience there because I was a 'just joined' to WSO2 and had no clue at all what were there around. 

Things started with I getting involved with Undergraduate Registration for the Con. Having a round of lengthy calls with all the Heads of the local and foreign Universities to pass the SPECIAL STUDENT OFFER message, mailing e-flyers around and visiting all the universities to distribute promotional printed material was an enjoyable experience indeed. 
And now looking forward to execute the selection process on the 120+ undergrad registrants and select the TOP 50 who will be lucky participants to witness and be a part of this event. 

Indeed one should be lucky to witness this event because this will have an eminent set of key note speakers from enterprise giants such as Dr C. Mohan from IBM  (Former IBM India Chief Scientist), Sastry Malladi form eBay (distinguished Architect), Gregor Hohpe from Google (Engineer). Also another 20+ speakers who deal with immense industry know how will share their thoughts about the industry trends, customer experiences with WSO2 and expertise with the audience. 

The event which comprise of 3 conference days and 2 tutorial days will be a spring of knowledge to the participants. The registrants have the choice of selecting the speech and tutorial sessions according to their interest out of the multiple available tracks. Have a look at the program line up. 


This time the Conference will be from September 12th - 16th at Waters Edge, Sri Lanka, one of the picturesque locations which is enriched with natural beauty of Sri Lanka. 



Log in to WSO2Con 2011 page and register. Still you are not late to get hit from the IT storm of Sri Lanka. 
See you there!!!