Go to primary content
Oracle® Retail Service Backbone Oracle Retail Service Backbone Security Guide
Release 16.0.023
E89305-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

3 Installation Overview

This chapter provides an overview of the installation framework for the RSB.

Installing Infrastructure Components

RSB provides the framework and toolset for centralized software product lifecycle management of RSB components. All configuration and management tasks are done from a single centralized location defined as rsb-home using specific tools that support all phases of the RSB product lifecycle. The framework and the toolset are collectively referred to as RSB Kernel or RSB Builder tool.

For information on RSB Kernel and installation details, see the Oracle Retail Service Backbone Installation Guide and the Oracle Retail Service Backbone Implementation Guide.

Assumptions / Prerequisites

RSB security principles are based on the following assumptions:

  • Participating Retail Applications or external applications are hosted on a WebLogic server.

  • The Web services are secured using WebLogic policies (as opposed to OWSM policies).

  • If the application services are secured with any policy other than what is mentioned in this document or custom policies, the instructions in the document do not work.

  • The security setup in the document does not address authorization. Authorization must be taken care by the individual application hosting the services.

  • <DomainHome> is the home directory of the WebLogic domain where the application services are deployed.

Secure Installation and Configuration

Security configurations for Web services are generally performed after the services are deployed. The application services need to be secured before security configurations can be applied in the integration layer (RSB). There are no programmatic changes needed for securing the application services.

Administrative access to the application server is required for completing the security configuration of the application services.

Security configurations must be executed with accuracy. A small mistake in the security configuration setup can make the whole system nonfunctional. Troubleshooting of security related issues are generally harder than troubleshooting of application issues. Considering this, Oracle recommends that you verify the configuration after every step. Oracle provides ”sample” scripts and detailed instructions to minimize the chances of error.

Application teams may need to modify the sample scripts to suit their needs and/or incorporate similar concepts in their install scripts/process.

Security configuration comprises broadly of three phases, each must be performed sequentially as described. The following sections describe each phase and the detailed steps that you need to take for a successful configuration. Most of the steps have been automated and can be achieved by running the scripts provided. However, there are some required manual steps.


Note:

Due to known vulnerabilities, Oracle recommends disabling SSLv3 in all products. We recommend using the TLSv1.2 protocol. WebLogic server can be configured to use the TLSv1.2 protocol by adding the following line in the setDomainEnv.sh. Restart the server after making the change.

JAVA_OPTIONS=”$JAVA_OPTIONS -DwebLogic.security.SSL.minimumProtocolVersion=TLSv1.2”


Pre-Installation Steps

Perform the following steps regardless of the policy (A or B) you are using to secure the services. Once these are done, perform the policy specific tasks described in the following sections.

  1. Download and extract the RTG provided RsbAppServiceSecuritySetupSamplesPak16.0.023ForAll16.0.023Apps.zip. The zip file contains the sample scripts to help you configure the application server for Web service security. The structure of the extracted zip file should be as shown in the figure below:

    security-setup-home/     service-provider/         config/            security-setup/                                                                    app-lib                 lib     service-consumer/
    
  2. Copy the contents of security-setup-home/service-provider directory to <DomainHome>/config directory of the WebLogic application server where your RSE generated Web service is deployed.

    scp security-setup-home/service-provider/* <user>@<your host>:/<your path>/<DomainHome>/config/
    
  3. Run setDomainEnv.sh in the current shell. (In order to run a script in the current shell, enter a dot and space before the script. This is required to make the variables set in the script be available to the current shell.)

    .  <DomainHome>/bin/setDomainEnv.sh
    

Configuring Security for Policy A

Surrounding text describes configure-sec-policyA.jpg.

Securing Edge Application Services with Policy A

This section describes the steps you need to take to secure the edge application services with Policy A.

Enabling the HTTPS Port

To enable the HTTPS port, take the following steps:

  1. In WebLogic Admin Console, click Environment --> Servers.

  2. Click the server where the Web service is deployed.

  3. Click the Configuration -- > General tab.

  4. Check the SSL Listen Port Enabled check box. Do not uncheck the Listen Port Enabled check box. The OSB needs both the HTTP and SSL listen ports enabled.

  5. Enter a port number for the SSL Listen Port. This is the port number for the service endpoint.

  6. Enter the hostname in Listen Address field.

  7. Click Save.

    Surrounding text describes image015.png.

Configuring and Using Authentication

If your credentials are stored in an external repository (e.g., LDAP), follow the WebLogic documentation to make these credentials available to the WebLogic Web service infrastructure so that it can authenticate you during Web service invocation. If you are testing with users in the built-in user registry of WebLogic, you may follow the instructions below.

You can add a user using the provided script or through the WebLogic Admin Console.

  • If you are using the script, run the following command from the security-setup-home created during pre-installation steps:

    cd security-setup-home/service-provider
    app-service-security-config.sh -add-user
    
  • The script prompts for the following:

    • username

    • password

    • WebLogic admin URL

    • WebLogic Admin username

    • WebLogic Admin password

The username and password from the service consumer is authenticated against the username and password entered in this step. For manual steps to create users in the WebLogic server, refer to the WebLogic 12.2.1.2 documentation.

Configuring and Using Security Policies

This section describes steps to configure and use security policies.


Note:

To secure an EJB app, it must be deployed with custom role and policies. During application deployment, after selecting the target server, select the "Custom Roles and Policies" option under Security settings. Security policies (Policy A and Policy B) can be attached to edge app Web services using either the provided script or by attaching the policies manually.

Configuring Security Policies for Policy A Setup - Script Method

Take the following steps:

  1. Copy the ear files of the Web service provider EJBs to the service-provider/config/security-setup/app-lib folder.

  2. Run app-service-security-policy-condition-config.sh –u <WebLogic Admin Server URL> –a -e <Enterprise Application Name> –t user –n <user>.

  3. Change directory using cd security-setup-home/service-provider.

  4. Run app-service-security-policy-config.sh –u <WebLogic Admin Server URL> –a -e <Enterprise Application Name> –p PolicyA.

The usage of the script is displayed when the script is run with the –usage parameter. The script extracts the ear file and uses all the jars from the ear file in classpath. It attaches the Web service policies corresponding to Policy A to the services defined in the ear file.

Configuring Security Policies for Policy A Setup - Manual Method

For each of the services to be secured, perform the following steps in WebLogic Admin Console. Make sure you attach the user created in the Configuring and Using Authentication section to the EJB.

  1. Click Deployments. Click on the EJB (not the Service) you want to secure and then click Security --> Policies. Surrounding text describes image017.png.
    Surrounding text describes image019.png.

  2. Click Add Conditions --> Predicate List. Pick User from the dropdown list and then click Next --> User Argument Name. Type the username you created and then click Add --> Finish --> Save. Surrounding text describes image021.png.

  3. Attach policy to the service and navigate to Configuration tab --> WS-Policy --> click on the service port. Surrounding text describes image023.png.

  4. Pick WebLogic --> Next --> Service Endpoint Policies. Select policy: Wssp1.2-2007-Https-UsernameToken-Plain.xml and then click Finish. Surrounding text describes image025.png.

  5. Click OK if WebLogic asks to save Plan.xml.

  6. Restart the WebLogic server.

  7. Verify the configuration by checking the WSDL of the service. The WSDL must have the policy information in it.

Securing Decorator Services with Policy A

Decorator services can be secured using rsb-home if their edge application service is secured using one of the supported security configurations. If the edge-app security configuration is not one of the supported security configuration, then you need to follow the fusion middleware documentation for security and secure the proxy and business services manually from the OSB console.

Configuring Security Using rsb-home

As described earlier in the Installing Infrastructure Components section, the complete RSB lifecycle management including security configuration and maintenance must be performed using the tool set packaged as rsb-home.

Configuring Security (In Brief) Using rsb-home

  • There are no changes to the decorator deployment process. Initially the decorators are deployed as unsecured services. After deploying decorator services, it is recommended that you test the services to make sure that they are able to invoke the edge application services and the flows are working as expected. The https configurations in the rsb-deployment-env-info.properties must be correctly configured with the https settings. For more information, see the Oracle Retail Service Backbone Installation Guide.

  • Once the services are verified, secure the edge application services as described in the Securing Edge Application Services with Policy A section.

  • After securing the edge application services, secure the business and proxy services. rsb-home consists of scripts to configure security for the decorator services. When these scripts are executed, the following events take place in the background:

    1. The edge application service WSDL downloads from the URL which is available in rsb-deployment-env-info.properties file.

    2. The WSDLs contain information about the policy files that are used to secure the Web service.

    3. Based on the policy, the script determines which OWSM client policy is suitable for business service and which OWSM service policy is suitable for a proxy service. This can be achieved only for the security configurations that are supported by RSB. If the policy file of edge application service does not match with the supported configurations, then the script throws an error that the decorator services cannot be secured using the script and they should be secured manually following the fusion middleware security documentation.

    4. If the security configuration is one of the supported configurations, then the proxy and business service files in the decorator jar are updated with the changes that are required for that security configuration.

The structure of the directory is shown below. The scripts responsible for security configuration are shown in bold/bold-italics and the folders that stage the security related files are shown in italics.

rsb-home
|
|---- deployment-home
|        |---- bin
|        |     |---- configure-rsb-app-server-for-security-policy-b.sh
|        |     ---- rsb-deployer.sh
|        |---- conf
|        |     |---- ddl
|        |     |   `---- RSB_INFRASTRUCTURE_SCHEMA_DEFINITION.SQL
|        |     |---- rsb-decorator-instrumentation.properties
|        |     |---- rsb-decorator-service-to-family-name-association.properties
|        |     |---- rsb-deployment-env-info.properties
|        |     `---- rsb-integration-flows.xml
|        `---- log
|---- download-home
|        |---- all-app-service-decorator
|        |---- all-business-process-service-decorator
|        |---- all-functional-business-process
|        |---- all-functional-service-int-flow
|        |---- bin
|        |     `---- check-version-and-unpack.sh
|        |---- integration-guide
|        `---- log
|---- integration-lib
`---- service-assembly-home
        |---- app-service-decorator
          |---- bin
        |     |---- download-app-service-wsdl.sh
        |     |---- generate-rsb-decorator-security-config.sh
        |     |---- rsb-compiler.sh
        |     `---- setup-message-protection-security-credentials.sh
        |---- business-process-orchestration
        |---- business-process-service-decorator
        |---- conf
                |---- default-rib-files
                |                                |---- rib-func-artifacts
                        |                                |---- rib-global
                |                                |---- rsb-admin-internal
                `---- app-service-policy-id-to-decorator-service-policy-id-map.properties
        |     |---- logging.properties
        |     `---- rsb-builder-internal-trust-store.jks
        |---- integration-guide
        |---- log
        |---- service-integration-flow
        `---- service-policy-config
                |---- input
                |        |---- app-service-provider-wsdl
                |        `---- security-policy
                `---- output
                        |---- app-service-provider-security-policy
                        |---- decorator-service-biz-security-policy
                        |---- decorator-service-consumer-client-security-policy
                        |---- decorator-service-proxy-security-policy
                        |        `---- service-name-to-policy-id-map.properties
                        `---- decorator-service-proxy-wsdl

For more information on securing the decorator services, see the Oracle Retail Service Backbone Installation Guide.

Consumer Side Configuration for Policy A

For invoking services over SSL, consumer applications must be able to validate service provider server certificate. For more information on installing certificates on a WebLogic server, see the WebLogic documentation.

After the certificates are installed, the consumer applications should have access to a wallet file. This wallet file contains the username and password required for user authentication by the Web services.

Refer to Appendix A for a sample Java code for invoking a service over SSL. In the sample code, the username and password have been hard-coded for simplicity. But in real applications, it is recommended that you use a wallet file.


Note:

For access to the wallet file, you may use the CSM package that Oracle provides.

Consumer Side Configuration for Policy A (PLSQL Apps)

If the service consumer is a PLSQL based application as opposed to a Java application, the security is configured from inside the database. The PLSQL consumer invokes the service. The Retail SOA Enabler (RSE) tool accesses the database and generates PLSQL consumer sample code. It describes step-by-step process to invoke a secured service from a PLSQL client in PLSQLServiceConsumer_ReadMe packaged inside the RSE generated consumer artifacts. For more information, see the Oracle Retail Integration Bus Service-Oriented Architecture Enabler Tool Guide.

Post Installation Steps

After the successful configuration of security, verify it before running the real functional tests. Verification can be done by invoking a ping operation of a RSB decorator service securely in the following ways:

  1. Using the Retail Integration Console (RIC)

  2. Using a SOAP User Interface

Verify Policy Using the Retail Integration Console

Surrounding text describes image027.png.

Verify Policy Using a SOAP User Interface

Surrounding text describes image029.png.

Configuring Security for Policy B (Message Protection)

Surrounding text describes configure-sec-policyB.jpg.

Securing Edge Application Services with Policy B

This section describes the steps that you can take to secure an edge application service using Policy B.

Generating Key Store and Certificates

Generate public and private keys and key store for message encryption and digital signing.

  1. Download RsbAppServiceSecuritySetupSamplesPak<version>ForAll<version>Apps_eng_ga.zip

  2. Unzip and copy the scripts from /security-setup-home/service-provider to the <Edge-app-domain-home>/config folder.

  3. Navigate to <Edge-app-domain-home>/bin folder and execute. SetDomainEnv.sh


    Note:

    WebLogic server should be up and running.

  4. Run the script located in <Edge-app-domain-home>/config to generate necessary certificates, keys, and key store.

app-service-security-config.sh -generate-cert

Enter the key store password and private key password.

Note down these passwords for use in the next step.


Note:

You should obtain certificates from CA in production environments. Generated certificates should be used only for development and demo purposes.

Configuring the WebLogic Server to Use the Certificates

  1. Configure the WebLogic server to use the certificate, keys, and key store to protect messages.


    Note:

    WebLogic server should be up and running.

    app-service-security-config.sh -config-wls-cert-keystore

    Enter the required inputs:

    1. WebLogic admin URL, for example: t3://<hostname>:<port>

    2. Username, password

    3. Key store password

    4. Private key password


      Note:

      Keystore and private key password should be same as provided in previous step.

  2. If needed, restart the WebLogic server after the configuration updates.

  3. Verify that above configuration reflects in WebLogic console.

    In the WebLogic Admin console, click the domain name in Domain Structure. Then click Web Service Security --> default_wss --> default_x509_cp. The configuration screen is displayed. Surrounding text describes image032.png.

Configuring and Using Authentication

If your credentials are stored in an external repository (e.g., LDAP), follow the WebLogic documentation to make these credentials available to WebLogic Web service infrastructure so that it can authenticate you during the Web service invocation. If you are testing with users in the built-in user registry of WebLogic, follow the instructions below.

You can add a user using the provided script or through the WebLogic Admin console. If you are using the script, run the following command:

Navigate to <Egde-app-domain-home>/config folder, and execute

app-service-security-config.sh -add-user

The script prompts you for the following:

  • Username and Password (for user authentication)

  • WebLogic Admin URL, for example: t3:// <host name>:<port>

  • WebLogic Admin username and password

The username and password from the service consumer is authenticated against the username and password entered in this step.

Configuring and Using Security Policies

Security policies (Policy A and Policy B) can be attached to edge app Web services using either the provided script or by attaching the policies manually.

Configuring and Using Security Policies - Script Method

Take the following steps:

  1. Copy the application ear file (e.g.: javaee-service-interface-tester-<version>.ear) of the Web service providers EJBs to <Egde-app-domain-home >/config/security-setup/app-lib

  2. Change directory using below command cd security-setup-home/service-provider/config.

  3. Execute app-service-security-policy-condition-config.sh -u <WebLogic Admin Server URL> -a -e <Service Name> -t user -n <user>.

    For example: sh app-service-security-policy-condition-config.sh -u t3:// <host name>:<port> -a -e customerservice -t user -n rsbuser


    Note:

    The above example will apply policy conditions to only selected web services. If user wants to apply policy conditions to all the web services, execute the below step.

    sh app-service-security-policy-condition-config.sh -u <WebLogic Admin Server URL> -a -e <Enterprise Application Name> -t user -n <user>

  4. Run app-service-security-policy-config.sh -u <WebLogic Admin Server URL> -a -e <Enterprise Application Name> -p PolicyB.

    For example: sh app-service-security-policy-config.sh -u t3:// <host name>:<port> -a -e javaee-service-interface-tester -p PolicyB

  5. Restart admin and manage server.

The usage of the script is displayed when the script is run with the –usage parameter. The script extracts the ear file and uses all the jars from the ear file in classpath. It attaches the Web service policies corresponding to Policy B to the services defined in the ear file.


Note:

  • Verify that user is added in ejb and policies are configured in webservice or open WSDL to see policies embedded in that.

  • If not, configure policies manually in Weblogic.


Configuring Security Policies for Policy B Setup - Manual Method

;

To secure each of the services, perform the following steps in WebLogic Admin Console:

  1. Attach the user, created in the Configuring and Using Authentication section, to the service.

    Click Deployments and then click on the EJB you want to secure. Click Security --> Policies --> Add Conditions --> Predicate List. Pick the user from the dropdown list and click Next --> User Argument Name. Type the username you created and then click Add --> Finish --> Save.

  2. Attach the three policies to the service.

    Navigate to the Configuration tab --> WS-Policy. Click on the service port and pick WebLogic -->Next --> In Service Endpoint Policies. Select the following policies from available policy list:

    policy:Wssp1.2-2007-Wss1.1-UsernameToken-Plain-EncryptedKey-Basic128.xml

    policy:Wssp1.2-2007-EncryptBody.xml

    policy:Wssp1.2-2007-SignBody.xml

    Surrounding text describes image034.png.
  3. Click Finish.

  4. Restart WebLogic servers.

  5. Verify the configuration by checking the WSDL of the service. The WSDL must have the information of all the three policies in it.

Exporting the Certificate

Export the certificate from the application server. Copy the certificate file to the RSB WebLogic server.

Use the following command to export the certificate:

app-service-security-config.sh -export-cert

You will have to provide the key store password. The exported certificate file name can be <hostname>-certificate.der.

rsb-home and OSB Side

The following provide an easy reference to the important steps that you need to take related to Policy B that should be run from rsb-home.

For more information on steps to secure the decorator services with Policy B, see the Oracle Retail Service Backbone Installation Guide.

Before Policy B, it is assumed that RSB Domain is configured.


Note:

Follow rsb-installation guide for RSB Configuration.

  1. Make sure that the endpoint URL is correct in the RSB deployment properties file and run the script to download app service WSDL.

    cd <rsb-home>/service-assembly-home/bin/download-app-service-wsdl.sh

  2. Run the following script to populate rsb-home/service-assembly-home/service-policy-config/output/decorator-service-proxy-security-policy/ service-name-to-policy-id-map.properties file.

    cd <rsb-home>/service-assembly-home/bin

    Run generate-rsb-decorator-security-config.sh

  3. Copy the PKI generation utility shell script from rsb-home to the OSB service server machine's <domain_home>/config folder.

    cd <rsb-home>/integration-lib/rsb-tools/scripts

    Run scp generate-pki-certificate-keystore-for-osb.sh <user>@<host>:<rsb_domain>/config

  4. Login to the OSB service server machine. Change directory to <domain_home>/config and run generate-pki-certificate-keystore-for-osb.sh.

    cd <domain_home>/bin

    . setDomainEnv.sh

    cd ../config

    generate-pki-certificate-keystore-for-osb.sh

  5. Copy <hostname>-certificate.der from AppService server's <domain-home>/config to OSB server's <domain-home>/config folder. Run the following command to import the application service's public key in the OSB key store with alias name <appName>-<AppServiceHostName>-remote-host-public-key-alias.

    cd <rsb-home>/integration-lib/rsb-tools/scripts

    scp import-remote-server-public-key-certificate-into-keystore.sh <user>@<host>:<domain-home>/config

    Login to OSB Server.

    cd <domain-home>/config

    Copy the certificate from the application server to OSB server.

    scp <user>@<host>:<app-server-domain>/config/<host>-certificate.der

    import-remote-server-public-key-certificate-into-keystore.sh <appName> <appServiceHostName>

    For example,

    import-remote-server-public-key-certificate-into-keystore.sh igs <rsbhost>

  6. Restart the OSB Server.

  7. Run the following command which asks for the key store password, password for OSB server key alias, password for remote server's key alias, and username/password for usernametoken authentication for the Web services. The passwords for these aliases must match with the passwords that are used in the key store.

    cd <rsb-home>/service-assembly-home/bin

    setup-message-protection-security-credentials.sh

    Script will prompt for below passwords to store in wallet file.

    • keystore password

    • public private key alias passwordremote host key alias password

    • username and password configured in edge app

    The first alias is the keystore-csf-key where the username is pre-populated with the same name as the alias name. The password for this entry should be the key store password of OSB server.

    The second alias is the <hostname>public-private-key-alias where hostname is the OSB server. The username is pre-populated with the same name as the alias name and password of the private key in the key store.

    The third alias is the <appName>-<AppServiceHostName>-remote-host-public-key-alias. The username is pre-populated with the same name as the alias name and password of the private key in the key store. This step is repeated for all the applications for which services are secured with Policy B.

    The fourth alias is <appName>-user-alias. Here the username and password are prompted. The values must match with the username/password configured in application service's WebLogic server for UsernameToken authentication. This step is repeated for all the applications for which services are secured with Policy B.

  8. Run the following command to create the user in the OSB WebLogic server and also update the domain-level wallet file with aliases of OSB and application service keys.

    cd <rsb-home>/deployment-home/bin

    configure-rsb-app-server-for-security-policy-b.sh

  9. Copy /security-setup-home/service-provider/config/ app-service-security- config.sh from RsbAppServiceSecuritySetupSamplesPak16.0.023ForAll16.0.023Apps_eng_ga.zip to the <domain-home>/config directory of the OSB server where the OSB services would be deployed.

    Export the certificate from the OSB application server. Copy the certificate file to the Consumer side WebLogic server. Use the following command to export the certificate:

    app-service-security-config.sh -export-cert

    You will have to provide the key store password. The exported certificate file name can be <hostname>-certificate.der

  10. Restart the server so that it can load the wallet file and key store contents. It is important to restart the server after this step because WebLogic maintains a cache of these files which get refreshed when you restart the server.

  11. Run the following command to update decorator jars with security policy configurations.

    <rsb-home>/service-assembly-home/bin

    rsb-compiler.sh -setup-security-credential

    It will prompt for sidb-user-alias-name, provide soainfra schema name.

    For example: rsb_soainfra

  12. Prepare instrumentation configurations for WebLogic server.

    cd <rsb-home>/deployment-home/bin

    rsb-deployer.sh -prepare-wls

How to configure OWSM to use KSS Keystore in RSB domain

The keystore contains the entities private keys and the certificates associated with those private keys.

Using the OPSS Keystore Service for Message Protection:

In previous releases of OWSM, the JKS keystore was used by default. As of version 12.1.2.2, the OPSS Keystore Service is used by default for original installations. If you are upgrading from a prior release, your existing JKS keystore is used.

Migrating a JKS Keystore into the KSS Keystore

If you have an existing JKS keystore, you can migrate one or more aliases from the JKS keystore to the KSS keystore. To do this, perform the following steps:

Make sure the aliases you want to import are in the JKS keystore. You can use keytool (or your tool of choice) to do this

Keytool -list -keystore <keystore_name>.jks

For example: Keytool -list -keystore <hostname>-keystore.jks

Use WLST to import one or more aliases from the JKS keystore using the importKeyStore script at the command line.

  1. Navigate to <WLS_HOME>/wlserver/common/bin

  2. Run wlst.sh command, the prompt appears as wls:/offline>

  3. Then connect to weblogic admin server using connect("username", "password", "t3://<hostname>:<port>")

    For example: connect("weblogic<username>", "weblogic1<password>", "t3://rtgdev03.in.oracle.com<host name>:38001<port>")

    Now it will connect to AdminServer as: wls:/<domain_name>/serverConfig>

    The starting point for using the Keystore Service command set is getOpssService, which gets an OPSS service command object that enables you to:

    • execute commands for the service

    • obtain command help

    The general syntax is:

    Variable = getOpssService( name = 'service_name')

    Where

    • the variable stores the command object

    • the service name refers to the service whose command object is to be obtained. The only valid value is 'KeyStoreService'.

  4. svc=getOpssService(name='KeyStoreService')

    • Creates a new keystore on the given application stripe.

  5. svc.createKeyStore(appStripe='owsm', name='keystore', password='<password>', permission=true)

    Surrounding text describes image003_1.jpg.

    • Imports a keystore from a specified file.

    importKeyStore(appStripe='stripe', name='keystore', password='<password>', aliases='comma-separated-aliases', keypasswords='comma-separated-keypasswords', type='keystore-type', permission=true|false, filepath='absolute_file_path')

  6. svc.importKeyStore(appStripe='owsm',name='keystore',password='<password>',aliases='<Hostname>-public-private-key-alias,<appName>-<Hostname>-remote-host-public-key-alias',keypasswords='<password1>,<password2>',type='JKS',permission=true,filepath=' /<domain_home>/config/<Hostname>-keystore.jks')

    Surrounding text describes image004_1.jpg.

    • OWSM uses the Credential Store Framework (CSF) to manage the credentials in a secure form. The CSF provides a way to store, retrieve, and delete credentials for a Web Service and other applications.

    • Create a credential with key "<appName>-<ServiceName>-user-alias" in "oracle.wsm.security" map. The values must match with the username/password configured in application service's WebLogic server for UsernameToken authentication.

  7. createCred(map="oracle.wsm.security", key=" <appName>-<ServiceName>-user-alias", user="<application service user>", password="<application service user pwd>", desc="description")

    createCred(map="oracle.wsm.security", key=" cm-Customer-user-alias", user="<username>", password="<password>", desc="description")

    Surrounding text describes image005_1.jpg.

    • OWSM provides support for KSS, JKS, HSM, and PKCS11 keystores. After creating the keystores, we need to configure OWSM so that it can access and use the keystore. We can configure the OWSM keystore using the configureWSMKeystore command.

    • Sets the configuration properties for the OWSM keystore.

  8. configureWSMKeystore(context, keystoreType,location, keystorePassword, signAlias, signAliasPassword, cryptAlias, cryptAliasPassword)

    configureWSMKeystore('/wls/<domain_name>',keystoreType='KSS',location='kss://owsm/keystore',signAlias='<sign alias>,cryptAlias=<crypt alias>')

    • Run the following command to deploy the decorator:

      cd <rsb-home>/deployment-home/bin

      rsb-deployer.sh -deploy-all-rsb-service-for-app <app>

      (For example: rsb-deployer.sh -deploy-all-rsb-service-for-app sim)

    • Create user manually from admin console.

    • Restart the server/servers.

Configuring Consumer Side (Policy B)

The consumer should be deployed in a JRF domain with the following templates:

  • Oracle EM

  • Oracle WSM Policy Manager

  • Oracle JRF

  • Weblogic Coherence Cluster Extension

    Surrounding text describes image006_1.jpg.

This section provides details on setting up security in the service-consumer side of the RSB application.

Service consumer application must be run inside the WebLogic server. To consume services secured with Policy B, the application accesses the key store from the <DomainHome>/config folder of the WebLogic server where it is deployed. The application must also provide the username and password to authenticate the user with the service. Oracle recommends that you save the user credentials in a wallet file that is accessible from the consumer application. For simplicity purposes, the sample code provided below uses a hard coded username and password.


Note:

For a wallet file, access the CSM package that Oracle provides.


Note:

In the steps where keystore is created, it is important to note that the naming convention for alias and password are followed as provided in the samples below. The naming conventions that you can use are provided below.

  1. The key store name must be <hostname>-keystore.jks.

  2. The alias name for the server's public/private key must be <hostname>-public-private-key-alias.

  3. The alias name of remote RSB/OSB server's when imported in the key store must be <remoteHostname>-remote-host-public-key-alias.

    The same naming convention must be followed in the service consumer code for calling remote OSB services.

Take the following steps to set up the keystore and call the service:

  1. Copy security-setup-home/service-consumer/generate-pki-certificate-keystore.sh and import-remote-osb-server-public-key-certificate-into-keystore.sh from the RsbAppServiceSecuritySetupSamplesPak16.0.023ForAll16.0.023Apps_eng_ga.zip to the <domain-home>/config directory of the WebLogic application server where the service consumer application would be deployed.

    Navigate to <domain-home>/bin and set domain

    . setDomainenv.sh

  2. Generate the certificate and the public/private key for the WebLogic server where the client application is deployed. Run the script located in security-setup-home/service-consumer. Navigate to <domain-home>/config and run.

    generate-pki-certificate-keystore.sh
    
  3. Copy the certificate from the OSB server to the WebLogic server of the client application and run the script located in security-setup-home/service-consumer.

    import-remote-osb-server-public-key-certificate-into-keystore.sh <remoteHostName>
    

    Note down the key store password and private key password. The aliases used for the certificates and keys are fixed in this script. In your client code, you will have to use the following values for the program variables in the sample code mentioned in Appendix B.

    Table 3-1 Configuring Consumer Slide

    Program Variable Value

    clientKeyStore

    <DomainHome>/config/<HostName>-keystore.jks

    clientKeyStorePass

    Keystore password you entered in this step 2

    clientKeyAlias

    <HostName>-public-private-key-alias

    clientKeyPass

    Private key password you entered in this step 2

    remoteHostAlias

    <RemoteHostName>-remote-host-public-key-alias

    userNameTokenProvider

    The username and the password for the Web service provider.


  4. Export the certificate from <Hostname>-keystore.jks to the <domain- home>/config directory. This certificate path need to mention in the consumer side sample code. Copy the script app-service-security-config.sh from /security-setup-home/service-provider/config and run

    app-service-security-config.sh -export-cert

  5. The client also needs to provide a username and password for authentication. Create username and password for the web service provider using WebLogic Admin console. Oracle recommends that you store the username and password in a wallet file and read from there in the client code. In the sample code, the username and password have been hard-coded for simplicity.


    Note:

    For a wallet file, access the CSM package that Oracle provides.

  6. When the OSB services are consumed from an application, the application could be running in a WebLogic server where the OWSM is also installed. Alternatively, it can also be consumed from inside a WebLogic server where it is only a base WebLogic server and there is no OWSM component installed. The approach differs based on the situation.

    In the WebLogic server where the OWSM is not available, the client code uses the WebLogic policies in the client side. A sample program is available in Appendix B.

    When the client application is running on a WebLogic server where the OWSM is available, the OWSM client policy can be used in client code. A sample program is available in Appendix C. The security related code is shown in bold-italics.

How to configure OWSM to use KSS Keystore in Consumer Domain

The keystore contains the entities private keys and the certificates associated with those private keys.

Using the OPSS Keystore Service for Message Protection:

In previous releases of OWSM, the JKS keystore was used by default. As of version 12.1.2, the OPSS Keystore Service is used by default for original installations. If you are upgrading from a prior release, your existing JKS keystore is used.

Migrating a JKS Keystore Into the KSS Keystore

If you have an existing JKS keystore, you can migrate one or more aliases from the JKS keystore to the KSS keystore. To do this, perform the following steps:

Make sure the aliases you want to import are in the JKS keystore. You can use keytool (or your tool of choice) to do this

  1. keytool -list -keystore <keystore_name>.jks

    For example: Keytool -list -keystore <hostname>-keystore.jks

    Use WLST to import one or more aliases from the JKS keystore using the importKeyStore script at the command line.

  2. Go to <WLS_HOME>/wlserver/common/bin

  3. Run wlst.sh command, the prompt appears as wls:/offline>

  4. Then connect to weblogic admin server using connect("username", "password", "t3://<hostname>:<port>")

    Now it will connect to AdminServer as: wls:/<domain_name>/serverConfig>

    The starting point for using the Keystore Service command set is getOpssService, which gets an OPSS service command object that enables you to:

    • execute commands for the service

    • obtain command help

    The general syntax is:

    Variable = getOpssService( name = 'service_name')

    Where

    • the variable stores the command object

    • the service name refers to the service whose command object is to be obtained. The only valid value is 'KeyStoreService'.

  5. svc=getOpssService(name='KeyStoreService')

    • Creates a new keystore on the given application stripe.

  6. svc.createKeyStore(appStripe='owsm', name='keystore', password='<password>', permission=true)

    Surrounding text describes image003_1.jpg.

    • Imports a keystore from a specified file.

      importKeyStore(appStripe='stripe', name='keystore', password='<password>', aliases='comma-separated-aliases', keypasswords='comma-separated-keypasswords', type='keystore-type', permission=true|false, filepath='absolute_file_path')

  7. svc.importKeyStore(appStripe='owsm',name='keystore',password='<password>',aliases='<Hostname>-public-private-key-alias,<Hostname>-remote-host-public-key-alias',keypasswords='<password1>,<password2>',type='JKS',permission=true,filepath=' /<domain_home>/config/<Hostname>-keystore.jks')

    Surrounding text describes image007_1.jpg.

    • Creates a new credential in the domain credential store with a given map name, key name, user name, password and description. A credential store is the repository of security data that certifies the authority of entities used by Java 2, Java EE, and ADF applications. Applications can use the Credential Store, a single, consolidated service provider to store and manage their credentials securely. Use map name and key name as specified.

  8. createCred(map="oracle.wsm.security", key="basic.credentials", user="<application service user>", password="<application service user pwd>", desc="description")

    Surrounding text describes image008_1.jpg.

    • OWSM provides support for KSS keystore. After creating the keystore, we need to configure OWSM so that it can access and use the keystore. We can configure the OWSM keystore using the configureWSMKeystore command.

    • Sets the configuration properties for the OWSM keystore.

      configureWSMKeystore(context, keystoreType,location, keystorePassword, signAlias, signAliasPassword, cryptAlias, cryptAliasPassword)

  9. configureWSMKeystore('/wls/<domain_name>',keystoreType='KSS',location='kss://owsm/keystore',signAlias='<sign alias>,cryptAlias=<crypt alias>')

    For example,

    configureWSMKeystore('/wls/<jrf_domain>',keystoreType='KSS',location='kss://owsm/keystore',signAlias='<Hostname>-public-private-key-alias',cryptAlias='<Hostname>-public-private-key-alias')

    • Restart the server/servers.

Policy B Consumer in WebLogic Server

If the Policy B consumer is running in the WebLogic server, it can use the WebLogic Web service configuration for the policy related processing. The consumer code need not specify the keystore location, aliases etc. In order to utilize the container's security configuration, the WebLogic server must be configured for it. This can be done by running the following command in the <domain-home>/config directory.


Note:

The script must be run after running the setDomainEnv.sh in the current shell.

$JAVA_HOME/bin/java -classpath $CLASSPATH weblogic.WLST configWss.py

The RIB-OMS application is an example of such usage.

Post Installation Steps

After the successful configuration of security, verify it before running the functional tests. You can verify security by invoking a ping operation of a RSB decorator service securely.It can be done in the following two ways:

  1. Using Retail Integration Console (RIC)

  2. Using the OSB Console

Verifying Policy Using the Retail Integration Console

Surrounding text describes image027.png.

Verifying Policy Using the OSB Console

Click on the proxy service and then the Test Launch Console icon to test the service. You can invoke using any method. The ping method is the easiest to test. If the invocation is successful, it shows both the encrypted and decrypted versions of the request and response messages.

Make sure you do not select the Direct Calls check box. To test the proxy service from test page, provide values for following fields which are at the bottom of the test page:

  • keystore.recipient.alias

  • keystore.enc.csf.key

  • csf-key

You can find the values for these fields in the Business Services --> <Business Service> --> Security tab of the same decorator project. You will see these values pre-populated in that page. Copy these values and enter them on the proxy service test page for a successful invocation of the service.

Surrounding text describes image038.png.

Verifying Policy Using the Java Code

A sample Java code is shown in Appendix B that shows how a Java application can call a service secured with Policy B.