Tuesday, August 23, 2011

SSL enabled JConsole to monitor a WSO2 Carbon Server Securely

Written by Denis Weerasiri

WSO2 Products like WSO2 AS, ESB, BPS etc. are MBeans enabled servers such that they can be monitored via JMX clients. JConsole is a graphical JMX monitoring client which comes as a part of JDK.
Recently I had to securely monitor a remote WSO2 carbon server.
But the problem is, now any remote user can implement a MBean on the target server and use System.exit() from the client end to kill the Carbon server. So we need to harden  (or secure and restrict) the communication between client and server.
So I used jConsole via a SSL tunnel which enforces client authentication and RMI-registry authentication. Here’re the steps I took to solve the problem.
Note - Feel free to shout back in case you need more clarifications. In some steps I assumed the audience is aware of JMX, public key cryptography etc.

Content

Applied for
  • Carbon 3.2.0 (or above) based products (WSO2 BPS 2.1.0, WSO2 AS 4.1.0, WSO2 ESB 4.0.0 etc)

  • Sun JDK 1.6.0_24


Enable remote JMX monitoring for Carbon
    Once you start a WSO2 Carbon instance, default JMX Server is started as bound to localhost.
    Refer the Carbon console log.

    You can modify these ports at $CARBON_HOME/repository/conf/carbon.xml. See

    But to enable remote access, the JMX server should be unbound from localhost and bound to a remotely accessible IP address. This can be done by modifying $CARBON_HOME/repository/conf/advanced/jmx.xml. Modify the to the preferred IP address.

    Once the server is restarted, any external user can remotely monitor the Carbon instance via the exposed ports.
    See the console log to make sure, whether the modifications were applied correctly.

    Now the problem is using this exposed URL, a remote user can implement a MBean on the target server and use System.exit() from the client end to kill the Carbon instance. So we need to harden  (or secure and restrict ) the communication between client and server.

    Enforcing SSL
    Next step is to adding SSL to the communication.
    First of all we need to create a certificate which is used to encrypt the communication between JMX client and JMX server. For the simplicity we can use the keytool shipped with JDK to generate a self-signed certificate which will be used by the Carbon instance.
    Note - For more information on keytool refer http://download.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html

    Use the following command to generate the certificate.
    Note - you can prefer any place to keep the certificates. In as Carbon developers we use this location to store as a best-practice.

    During this operation, a public and private key pair and a certificate which is signed by the private key is generated.

    Now we need to export this self-signed certificate which is used by the JMX server and import it into trust store of our JMX client. In our case it’s jConsole. To do that use the following steps.
    1. Export the certificate to file called jConsole.cert

    2. Securely transfer jconsole.cert to the machine where the JMX client is installed

    3. Import the jconsole.cert to a truststore used by jConsole using the following command


    Now all the configurations are set for enforce SSL communication. Now the Carbon instance and jConsole need to be restarted with relavant JVM options.
    • Use the following command to start the Carbon instance with the mentioned JVM options.
      Note - Here the keystore password is what is specified while generating the self-signed certificate for Carbon instance.

    • To start jConsole


    Now the next step is to enforce SSL client authentication.

    Enforcing SSL client authentication

    To enable SSL client authentication, what we have to do is same as enforcing SSL communication.
    All we have to do is generate the self-signed certificate for jConsole and export that certificate and import it back to a trust store used by the Carbon instance.

    Use the following command to generate the certificate.

    Now Export the certificate to file called jconsole_client.cert.

    Then securely transfer jconsole_client.cert to where the Carbon instance is running.

    Now import jconsole_client.cert to the trust store used by Carbon instance using the following command.

    Now all the configurations are set for enforce SSL communication and SSL client authentication. Now the Carbon instance and jConsole need to be restarted with relavant JVM options.
    • Use the following command to start the Carbon instance with the mentioned JVM options.
      Note - Here the keystore password is what is specified while generating the self-signed certificate for Carbon instance.


    • To start jConsole use the following command


    Enforcing RMI-registry authentication

    Now RMI-registry which is remotely accessible from a separate port (in the above description it’s 9999) also need to be enforced with SSL client authentication. As we have all configured the trust stores and keystores in both client and server end, only requirement to enable RMI-registry authentication is to add the following JVM option to the WSO2 Carbon instance starting script.

    eg - 

    See original post

    WSO2 BPS 2.1.0 Available for Download

    Written by Denis Weerasiri


    The WSO2 Business Process Server(BPS) team is pleased to announce the release of 2.1.0 version of the Open Source Business Process server. WSO2 BPS 2.1.0 is based on WSO2 Carbon 3.2.0 which is the OSGi-based component framework allows the complete set of WSO2 products to leverage shared components, ensuring a consistent set of features between products, a consistent user experience, and reusing of identical components. You can find the release note for WSO2 BPS 2.1.0 from here.

    Two fresh products; WSO2 MB and WSO2 CEP also were released with the existing set of products.

    Few excerpts from the WSO2 BPS 2.1.0 release note...
    • WSO2 Business Process Server (BPS) is an easy-to-use Open Source Business Process Server that executes business processes written following WS-BPEL standard. WS-BPEL is emerging as the defacto standard for composing multiple synchronous and asynchronous web services into collaborative and transactional process flows which increase the flexibility and agility of your Service Oriented Architecture. WSO2 BPS is powered by Apache ODE and available under Apache Software License v2.0. WSO2 BPS provides a complete Web based graphical console to deploy, manage and monitor business process and process instances.

    • WSO2 BPS is developed on top of the revolutionary Carbon platform (Middleware a' la carte), and is based on the OSGi framework to achieve the better modularity for you SOA. Carbon platform contains lots of new features and many other optional components that can be used to customize or enhance the functionalities provided by BPS to suits you SOA needs. In addition to installing optional components you can uninstall unwanted features without any trouble.
      WSO2 team recently released 3.2.0 version of WSO2 Carbon platform which is the OSGi-based component framework allows the complete set of products to leverage shared components, ensuring a consistent set of features between products, a consistent user experience, and reusing of identical components.

    • An open source product, WSO2 BPS is available under the Apache Software License (v2.0) . This includes all of the extra integration and management functionality as well.

    See original post

    Apache Axis2: Code Generator

    Written by Thilini

    Validate the wsdl file using wsdl validator.
    This tool is available in every carbon product.


    The wsdl2java tool is bundled with Axis2 Binary Distribution.


    goto AXIS2HOME/bin and execute following command to generate java source.


    sh wsdl2java.sh -uri /home/thilini/BPELApplicationAdmin.wsdl -o temp -u





    -u --unpack-classes Unpack classes. This option specifies whether to unpack the classes and generate separate classes for the databinders.






    -o <output Location> --output <output Location> Output file location. This is where the files would be copied once the code generation is done. If this option is omitted the generated files would be copied to the working directory.


    Here you need to provide the absolute path for the validated wsdl file. Then it will store generated source at temp folder or wherever you defined it in the above command.



    See original post

    Packaging Components in a Single Server: P2 Feature Management

    Written by Thilini

    Packaging components on one server is a marvelous feature addition that will enable you to create your own SOA solution with all wanted features.



    As a example lets assume you need to get Data Service Hosting functionality inside Enterprise Service Bus (ESB), You simply need to install it as a p2 feature inside ESB.



    P2 features come as a hosted solution as well as a zip archive. You can use either the hosted solution [1] or the packaged solution [2], but if you are behind a proxy you will face a problem when using hosted solution. In that case use the zip archive.



    [1] https://svn.wso2.com/repo/p2repo/carbon/releases/3.2.0/

    [2] http://dist.wso2.org/p2-zip/carbon/releases/3.2.0/20-06-2011/p2-repo.zip



     Add p2 location: Point to either [1] or [2]





     Find Features



    Select components that you need to install.

              eg: Service Hosting (for WSO2 App Server features) , Data Service Hosting / Datasource Management (for WSO2 Data Services Server)











    Restart the server after successfully installing selected features.







    Finds installed features as shown below.





    Refer more details on Provisioning WSO2 Carbon based SOA Products with Equinox P2 and find p2repository locations from [3].

    [3] http://wso2.org/projects/carbon/provisioning-wso2-carbon-with-equinox-p2



    See original post

    Saturday, February 26, 2011

    How to setup a BPEL project in Carbon Studio from an existing BPEL artifact

    Written by Denis Weerasiri


    In this blog post is about how to setup a WSO2 Carbon Studio BPEL project from an existing BPEL artifact.
    Suppose there's a BPEL process, and you need to edit it via WSO2 Carbon Studio. We can't directly open a BPEL process via Carbon Studio. First you need to create a BPEL project and import the BPEL process to that BPEL project.

    How to create Carbon Studio BPEL project from an existing BPEL process
    • Start Eclipse Carbon Studio. Here you need to make sure you have installed Carbon Studio in Eclipse version you use.
    • In the menu bar goto File -> New -> Other -> BPEL Project . Then the following dialog will appear.

    • Click on Next. Then the following dialog will appear.

    • Add a Project name .Under Configuration click on Modify and put a check on BPEL 2.0 Facet. Click OK.


    • Then click Finish in “New BPEL Project” dialog box.
    • Now the Carbon Studio BPEL project has been created. And now we need to import the process files to this project.
    • For that; first extract a process we have provided. 
    • Then in Carbon Studio; Right click on the project in the “Project Explorer” Window -> Import... Then the following wizard will pop up. Choose “File System”, then click Next.


    • Then the following dialog will appear. And give the location of the previously extracted BPEL process in 7. Then add all the files in that BPEL process. Then Click on Finish.

    • Now the Carbon Studio project is created and you can edit the BPEL process via our editor.


    How to deploy and run BPEL projects
    • In Carbon Studio goto File -> Export. Then in the appearing dialog choose "WSO2 BPS BPEL Artifact". Then export the project.
     
    • Add the created BPEL artifact to WSO2 BPS via Web UI.

    See original post

    Saturday, February 19, 2011

    WSO2 Carbon Studio: Tools for WSO2 Middleware Platform

    WSO2 is an open source middleware company with a complete and comprehensive SOA middleware platform which is well known as Carbon and a PaaS which is known as Stratos.  But without proper tools, developers who develop their own solutions based on these SOA middleware will not get maximum benefits of them. Therefore, tools can play a significant role in reaching new sights. WSO2 Carbon Studio plays this significant role for WSO2 Carbon stack and Stratos PaaS by allowing new developers to try and evaluate Carbon platform with ease and making tasks easier for existing users.  WSO2 Carbon Studio is a collection of Eclipse plugins which enhances Eclipse IDE functionalities by extending IDE features to support WSO2 Carbon products and Stratos  with many other SOA features. Therefore Eclipse users can download Carbon Studio install it on your Eclipse installation. We decided to use Eclipse because it is completely free and open source and it is the most popular and widely used Java IDE and it will allow us to reach a much wider audience than any other IDE.   Following are the features that are included in the latest Carbon Studio 1.0.4 release. Application Server ToolsCreate and Edit Apache Axis2 Web ServiceContract first (Top down approach) Code first (Bottom-up approach) Create WSDL for Apache Axis2 Web Service archive (aar file) Generate Web Service clientFrom aar file From WSDL Web ApplicationsCreate and edit web applications Test and debug Apache Axis2 Services and Web Applications Deploy Apache Axis2 services and web applications Deploy JAX-WS services Enterprise Service Bus ToolsView, Create and EditEndpoints Proxy Services Sequences Local Entries Create custom mediators Registry Referencing Test and debug custom mediators and other ESB artifacts Deploy custom mediators and other ESB artifactscontaining as hot deployable file containing as registry resource Governance Registry ToolsCreate and deploy registry resource artifactsfrom a local file or a folder Import from a registry or as a registry dump Create, edit, debug and deploy registry handlers and filters Registry ManagementWorking with a registry onlineAdding multiple remote registries at once View, add, edit and delete registry resources and collections Import (drag-drop) resources from registry and file system View, add, edit and delete Properties, Associations, Dependencies, Comments and Tags Modify permission of a resource or collection Easily modify resources through configured Eclipse editors Check-out registry content to Eclipse workspace Working with a registry in the offline modeAdd resources in Eclipse workspace to the registry Add, modify and delete checked-out resources in the workspace and commit the changes back Sync the checked-out resources with the online registry User ManagementAdd, modify and delete users Modify the permissions of a given role Modify permission for a selected registry resource Business Process Server ToolsView, create and edit BPEL projects Test and deploy BPEL artifacts Gadget Server ToolsCreate and edit gadgets Test and deploy gadget artifacts Data Services Server ToolsCreate and edit data services (XML configurations) Create and edit data services validators Test and deploy data services artifacts and data services validators Carbon ToolsCreate, edit, debug and deploy Carbon UI bundles Deploy third party libraries as bundles Test and deploy data service artifacts and data service validators The recommended configuration for WSO2 Carbon Studio is as follow. 1. Eclipse Helios (3.6) or Helios SR1 (3.6.1) for Java EE developers.2. Oracle JDK 1.63. Any Operating System4. Around 100Mb of Hard Disk space In order to install Carbon Studio, there are 2 methods of doing that. You can follow any of them according to your preference. 1. Offline installation via Downloaded WSO2 Carbon Studio P2 features- If you prefer download first and install later, this option is for you.2. Online installation via WSO2 P2 feature repository

    See original post

    Tuesday, February 15, 2011

    Tools for Developers who want to use SOA Middleware

    Written by Sami

    The WSO2 Carbon Studio is a complete, Eclipse-based SOA development environment, consisting of a broad set of development tools for developing Services, Clients and other related SOA artifacts for your SOA.

    You can develop SOA applications using wide array of artifacts with WSO2 Carbon Studio.

    The full list of WSO2 Carbon Studio features include:

    Application Server Tools

    1. Create and edit Apache Axis2 Web service
      • Contract first (Top-down approach)
      • Code first (Bottom-up approach)
    2. Create WSDL for Apache Axis2 Web service archive (aar file)
    3. Generate Web service client
      • From aar file
      • From WSDL
    4. Web Applications
      • Create and edit web applications
    5. Test and debug Apache Axis2 services and Web applications
    6. Deploy Apache Axis2 services and web applications
    7. Deploy JAX-WS services

    Enterprise Service Bus Tools

    1. View, create and edit
      • Endpoints
      • Proxy Services
      • Sequences
      • Local Entries
    2. Create custom mediators
    3. Registry referencing
    4. Test and debug custom mediators and other ESB artifacts
    5. Deploy custom mediators and other ESB artifacts
      • Containing as hot deployable file
      • Containing as registry resource

    Governance Registry Tools

    1. Create and deploy registry resource artifacts
      • from a local file or a folder
      • Import from a registry or as a registry dump
    2. Create, edit, debug and deploy registry handlers and filters
    3. Registry management
      • Working with a registry online
        • Adding multiple remote registries at once
        • View, add, edit and delete registry resources and collections
        • Import (drag-n-drop) resources from from registry and file system
        • View, add, edit and delete properties, associations, dependencies, comments and tags
        • Modify permission of a resource or collection
        • Easily modify resources through configured eclipse editors
        • Check-out registry content to eclipse workspace
      • Working with a registry in the offline mode
        • Add resources in Eclipse workspace to the registry
        • Add, modify and delete checked-out resources in the workspace and commit back changes
        • Sync the checked-out resources with the online registry
      • User management
        • Add, modify and delete users
        • Modify permissions of a given role
        • Modify permission for a selected registry resource

    Business Process Server Tools

    1. View, create and edit BPEL projects
    2. Test and deploy BPEL artifacts

    Gadget Server Tools

    1. Create and edit gadgets
    2. Test and deploy gadget artifacts

    Data Services Server Tools

    1. Create and edit data services (XML configurations)
    2. Create and edit data services validators
    3. Test and deploy data service artifacts and data service validators

    Carbon Tools

    1. Create, edit, debug and deploy Carbon UI bundles
    2. Deploy third party libraries as bundles
    3. Test and deploy data service artifacts and data service validators

    See original post

     

    Copyright 2009 All Rights Reserved Revolution Two Church theme modified by Milinda Pathirage