Showing posts with label multitenancy setup. Show all posts
Showing posts with label multitenancy setup. Show all posts

Monday, 21 April 2014

Integrating Tivoli Directory Server (TDS) with IBM Cognos BI to provide secure & multitenant environment


IBM Cognos Business Intelligence (BI) is a enterprise class, web-based, integrated business intelligence suite by IBM which provides toolset not only traditional BI capabilities like reporting, analysis, scorecarding, monitoring of events and metrics but also expands these capabilities with planning, scenario modeling, real-time monitoring, and predictive analytics. These capabilities deliver an easy-to-use and unified experience that is collaboration and social networking enabled. The IBM Cognos BI has Service-oriented architecture - designed for scalability, availability, and openness.

IBM Tivoli Directory Server (TDS) is a powerful and authoritative enterprise directory infrastructure that is a critical enabler for enterprise security. It is an important part of the IBM Security Integrated Identity Management portfolio. It plays a key role in building the enterprise identity data infrastructure for applications such as identity management, portals, and web services. It provides a server that stores directory information using a DB2 database. It also provides a proxy server for routing LDAP operations to directory servers with database. IBM Security Directory Server provides client utilities and graphical user interfaces (GUI), such as Instance Administration Tool (idsxinst) and Configuration Tool (idsxcfg), to manage servers.

IBM Tivoli Directory Server provides:

  • Industry-standard architecture and broad platform support for a range of operating systems and applications and a variety of heterogeneous environments.
  • Strong scalability and flexibility to support hundreds of millions of entries using IBM DB2 technology and a built-in proxy-server.
  • Availability to support an identity data infrastructure for global online applications such as consumer-driven web services.
  • The ability to help you manage identities in the cloud.
  • Robust auditing and reporting that provides insight with connectivity to IBM QRadar SIEM and greater visibility into repository with sample reports.

You can use IBM TDS to provide a trusted identity data infrastructure for authentication. As we know Cognos BI doesn’t provide its own authentication mechanism but leverage your existing mechanism which you are using across enterprise applications. In this blog article our objective is to leverage existing security features for authentication and data transfer of TDS based LDAP with IBM Cognos BI to order to secure BI assets and setup multi-tenancy environment.

This blog article describes the step by step procedure for –

1)     Setting up TDS 6.2 environment on Windows 7 OS

2)     Integrating IBM Cognos BI 10.2.1 Server with TDS 6.2.

3)     Enable Multitenancy for Cognos BI environment

Also see –





Setting up TDS 6.2 Environment on Windows 7 OS

1)     Installation steps are pretty easy and intuitive for TDS 6.2 by just double clicking install_tds.exe file but if you are using later editions then you need to install it thru IBM Installation Manager. Steps can be found here - http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDS.doc_6.3.1/concept/c_ig_InstallationWithIBMInstallationManager.html

2)     On the completion of installation, you can see ‘IBM Tivoli Directory …’ windows services (Start->Programs->Administrative Tools->Services). The default port used by TDS for LDAP service is 389.




3)     To create and manage directory instances click on “Instance Administration Tool” from “IBM Tivoli Directory Server 6.2” folder in Start Menu - > All Programs as shown in snapshot.




4)     Click on “Manage…” button. It’ll open TDS Configuration Tool. Besides getting info about your setup you can also perform many tasks listed on left side panel as shown in below snapshot. Click of “Manage suffixes” task.




5)     We need to add “dc=example,dc=com” as a new suffix before importing our example LDIF. After successful addition you would see it in “Current suffix DNs” list.


6)     Below given is the glimpse of sample LDIF, you can download the attachment (http://www.megafileupload.com/en/file/521432/IBM-TDS62-ldif.html) and change is as per your requirements. I’ve created 11 users having userid admin, user1 – user10 with password – “password”. Lets click on “Import LDIF data”.


7)     Import sample LDIF file.



8)     On successful restoration start the server instance from “Manage Server State” task on the left side, shown in below snapshot.




Integrating IBM Cognos 10.2.1  BI Server with TDS 6.2

It is assumed that Cognos 10.2 BI server is already installed and is in working condition. Open ‘IBM Cognos Configuration’ from Start -> All Programs -> IBM Cognos 10 – 64.

1)      In the Explorer window, under Security, right-click Authentication, and then click New resource -> Namespace.

In the Name box, type a name for your authentication namespace (we used ‘IBM_TDS62’ here) and in the Type list, select ‘LDAP – Default values for IBM Tivoli’ and click OK.




2)      Select the newly created namespace. In the ‘Resource Properties’ window in right, for the Namespace ID property, specify a unique identifier for the namespace as TivoliLDAP is assigned in the below screenshot. All entries with Red arrows are manually provided to integrate with the TDS environment we created in above section.




 3)     If you want the TDS to bind to the directory server using a specific Bind user DN (Distinguished Name) and password when performing searches, then specify these values.



If no values are specified, the LDAP authentication provider binds as anonymous.

If external identity mapping is enabled, Bind user DN and password are used for all LDAP access. If external identity mapping is not enabled, Bind user DN and password are used only when a search filter is specified for the User lookup property.

4)     You can use user attributes from TDS in namespace configuration. To configure this, you must map these attributes with appropriate property name as shown in below snapshot. ‘Custom properties’ would be available as session parameters through Framework Manager.

 

 5)     From the File menu, click Save. Test connectivity to the namespace by right clicking on the name under Security, Authentication and selecting test. If the test is successful, this message box will appear.



If you want to disable anonymous access, make sure you disable it by setting ‘Allow anonymous access?’ property for ‘Cognos’ namespace as shown below in snapshot. 



6)     Restart Cognos service from toolbar. 


7)     Now anyone who wants to access Cognos (http://localhost/ibmcognos), would be asked for authentication credential. Let us login with LDAP administrator credential.



Directory administrators would have Cognos admin privileges. Go to Cognos administration.


8)     In ‘IBM Cognos Administration’, explore ‘Users, Groups, and Roles’ under ‘Security’ tab. One can see the new namespace (IBM_TDS62). Click on it to view all users belongs to the directory.


Administrator now can assign different privileges and roles to these directory users as per application security requirements by setting relevant properties. Once security permissions are assigned, LDAP users are ready to use Cognos BI. For more information on security, please refer to “IBM Cognos BI Administration and Security Guide”.

Enable Multitenancy for Cognos BI environment

1) We need to set multitenant properties from IBM Cognos Configuration tool to enable this feature.  In IBM Cognos Configuration tool, select Security->Authentication->IBM_TDS62 in Explorer (left pane) window. Now select ‘Advanced Properties’ from right window (Resource properties) and add two new values before pressing OK button -

a)     Name – ‘multitenancy.TenantPattern’ value – ‘~/parameters/tenantID’

b)     Name – ‘AdditionalUserPropertiesToQuery’ value – ‘parameters’



2) Now, select ‘Custom Properties’ from right window (Resource properties) and add a new value –

Name – ‘tenantID’ value – ‘l’




3) From the File menu, click Save. Test connectivity to the namespace by right clicking on the name under Security, Authentication and selecting test. If the test is successful, this message box will appear.


4) Save the configuration and restart Cognos service. Your Cognos multitenancy feature is enabled. 

There are many tasks follows this step to realize benefits of multitenancy in BI project. Please refer to my previous blog article http://vmanoria.blogspot.in/2014/03/ibm-cognos-bi-setting-up-multi-tenancy.html to see how to manage/administrate multi-tenant environment.

Thursday, 6 March 2014

IBM Cognos BI: Setting up multi-tenancy environment using Custom Java Provider



In one of my previous blog, we saw how to set up IBM Cognos BI security using Java based Custom Authentication Provider. We’ll use this work as base and advance it here by enabling multitenancy so it is highly recommended to go thru previous blog before proceeding further.  If you are new to multitenancy concept you may also want to go thru “Setting up multi-tenancy environment in IBM Cognos 10.2 BI using LDAP”. Here we’ll see that how we can set up similar multi-tenancy environment in IBM Cognos 10.2.1 BI using Custom Java Provider.

Multitenant environments

Multitenancy provides the capability to support multiple customers or organizations, called tenants, by using a single deployment of an application while ensuring that each tenant users can access only the data that they are authorized to use. Such applications are called multitenant applications. Multitenant applications minimize the extra costs associated with these environments.

IBM Cognos BI provides built-in multitenancy capabilities. It does not require you to perform additional administration tasks to manage tenants because it reuses your existing authentication infrastructure. That means even when multitenancy is enabled you continue manage your users and groups in similar way.

Enabling Multitenancy

Determine whether you must apply the multitenancy settings to all configured namespaces or to individual namespaces. Multitenancy properties for a specific namespace override any multitenancy properties that are set globally. If a namespace is not configured to use multitenancy, then policies and permissions for objects are used to determine who can access the objects. If multitenancy is applied to multiple namespaces, the tenant IDs in all namespaces must be unique.

In our case we created two tables “USERS” & “GROUPS” in DB2 database to be used by MyJavaAuthProvider class. I’ve added few records as shown below.

 


Lets follow the steps to enable multitenancy with “MyJavaAuthProvider” -
  1. Open IBM Cognos Configuration.
  2. Choose if you want to configure multitenancy settings globally for all namespaces, or for a specific namespace.
    • To configure multitenancy for all namespaces, in the Explorer window, for the Security category, click Authentication.

    • To configure multitenancy for one namespace like in our case its “MyJavaAuthProvider”, click the namespace that you want to configure.
  1. Under Multitenancy, click the edit button for the “Tenant ID Mapping” property. Specify one of the following properties:
Pattern - To use specific object attributes from your authentication provider, such as a TenantID, you could specify the following value for this property:
“~/parameters/tenant” in our case.
Provider class - To use a custom Java class, you only need to specify the name of the Java class that you created.

  1. In the Explorer window, right-click Authentication, and click Test. If multitenancy is properly configured, your tenant ID is displayed in the details. If multitenancy is not properly configured, the tenant ID is not displayed. If the latter is true, ensure that the multitenancy property values are correct and test again.
  1. I’ve also stopped anonymous access from Cognos Namespace property. From the File menu, click Save.
  2. Restart the IBM Cognos service for the changes to take effect. You can observer message “Multi-tenancy is enabled” in Details>> as shown below.

On success service start you can see Login screen before entering Welcome page.

Tenant administration

Tenant administration tasks are performed by members of the System Administrators role. System administrators can view and manage all objects in the content store. By default, objects created by a system administrator are tagged with his or her tenant ID. Because users who belong to the System Administrators role have their own tenant IDs, impersonation (Impersonate Tenant) must be used when performing tasks on behalf of a specific tenant. Here in our case let ‘admin’ user and ‘administrators’ group join System Administrators role. Here are the steps.
1.      Login as admin user and open Security tab from Cognos Administration screen.
2.      Click on Cognos Namespace.

3.      Last entry would be “System Administrators”. Open its ‘properties’, go to ‘members’ tab and add ‘admin’ user and ‘administrators’ group from ‘MyJavaAuthProvider’. Click OK.


System administrators must create a tenant in Cognos Administration before the tenant users can access Cognos server. The Multitenancy tab in IBM Cognos Administration is the central area for tenant administration. On this tab, the administrator can view and manage all tenants registered in the current Cognos environment. Lets register our tenants –

1.      In IBM Cognos Administration, click the Multitenancy tab. On the toolbar, click the New Tenant icon.
2.      Specify the Name and Tenant ID parameters as shown below. Name can be anything but Tenant IDs should be same if you are using the same data shown in above tables.
Name: Customer – A           Tenant ID: CustomerA
Name: Customer – B           Tenant ID: CustomerB

If you want to update the tenant settings later, from the tenant Actions drop-down menu, click Set properties and change the settings on the General tab. For example, you can change the tenant name.

Assigning tentant IDs to existing content

After multitenancy is enabled and the tenant object is created in Cognos Administration, the system administrator assigns tenant IDs to the existing BI objects. All objects belonging to a tenant have the same tenant ID. The tenant IDs are created when a user from a specific tenant logs on to Cognos or the system administrator impersonates the tenant. Tenant IDs can also be created using the software development kit.

In a multitenant environment, all objects in the content store are either public or belong to a single tenant. As a system administrator, you must ensure that the existing objects have a proper tenant ID or are meant to remain public. For example, you can assign tenant IDs to data source connections, but leave the data source itself public.

If the tenant content is not organized into separate folders, you can create a root folder in Cognos Connection for each tenant. This helps to preserve the uniqueness of names in the Cognos BI environment. The Tenant ID is displayed on the General tab in the object properties page. The tenant name associated with each object is shown in the Tenant column in Cognos Connection and Cognos Administration.



Tenant content Deployment


You can export and import the tenant content. You can export:

  • Content that belongs to the selected tenants and public content
  • Content that belongs to the selected tenants only.
  • Public content only
Later, you can import the archive into the target environment. The tenant content can be imported from the deployment archive into the target environment.

When public content is excluded from the tenant export, and a tenant object has public ancestors, the public ancestors are included in the export so that the content references can be preserved in the target system. For example, in a situation where a data source connection belongs to a tenant, but the data source itself is public, the data source is exported.

In Cognos BI version 10.2.0 there was no option to exclude user account information when public content was deployed. This option exists in the product starting with version 10.2.1.

Export operation can be performed from Multitenancy tab In IBM Cognos Administration from the tenant Actions drop-down menu.

Disabling or Deleting tenants

You can disable a tenant when you want to prevent the tenant users from accessing Cognos BI and modifying the tenant content. This should typically be done before deploying a tenant and all of the tenant content. As a best practice, you should disable the tenant before terminating its active user sessions.

You can delete a tenant from Cognos BI environment. This might be needed if the tenant was permanently moved to a different or no longer required. Before deleting a tenant, you must terminate the tenant active user sessions. Otherwise, you will not be able to delete the tenant.

When you delete a tenant, you also delete all content associated with the tenant, such as reports, user profiles, or content store utilization tasks.

Both the operations can be performed from Multitenancy tab In IBM Cognos Administration from the tenant Actions drop-down menu.
 
References - 
IBM Cognos Business Intelligence 10.2.1 Administration and Security Guide 
Hint: On Windows Cognos server you'll find it here - C:/Program Files/IBM/cognos/c10_64/webcontent/documentation/en/ug_cra.pdf



Thursday, 21 February 2013

Setting up multi-tenancy environment in IBM Cognos 10.2 BI using LDAP


Multi-Tenancy has always been supported in IBM Cognos BI either by authentication source or with distributed installation & configuration. Cognos 10.2 BI has greatly enhanced it by newly provided built-in multi-tenancy capability which is incredibly valuable to IBM Cognos ISVs and business partners. It is particularly very useful to the organizations those have deployed Cognos BI in a federated manner and are looking to segment different sub-organizations within their shared IBM Cognos platform architecture more easily.

Multitenancy provides the capability to support multiple customers or organizations (tenants) by using a single deployment of an application, while ensuring that the users belonging to each tenant can access only the data that they are authorized to use. Such applications are called multi-tenant applications. IBM Cognos Business Intelligence (BI) provides capabilities that make it easier to administer and secure multi-tenant applications at the same time minimize the extra costs associated with these environments.

The following diagram shows how the Cognos BI multitenancy capabilities isolate access to objects in your content store. Users can access only the objects that they are authorized to access within each tenant grouping.















Figure. Content store configured to use the Cognos BI multitenancy capabilities

The system administrator can access all objects in the content store. In this example, the users would have access to the following objects:
  • Users belonging to Tenant 1 can access object_1, object_2 exclusively.
  • Users belonging to Tenant 2 can exclusively access object_4, object_5, and object_6.
  • object_3 is shared between users from both tenants but based on tenant properties they can access permitted data thru object_3.
This newly introduced multi-tenancy feature does not require performing additional administration tasks to manage tenants because it reuses your existing authentication infrastructure. When multi-tenancy is enabled, it does not affect how you currently manage your users and groups. It allows the administrator to create a TenantID and use the TenantID session parameter in Cognos modeling tool (Framework Manager) to restrict the access to the different components on Cognos Connection, using security features in the Cognos Namespace.  It also provides the ability to audit by Tenant and makes it much easier to administer and maintain the environment.

This article describes the step by step procedure to
1)     Configuring multi-tenancy feature in IBM Cognos 10.2 BI environment.
2)     Implementing multi-tenancy for sample tenants (exclusive & shared access)

Configuring Multi-tenancy in Cognos BI

1) First of all, identify how tenancy information (grouping) is determined in technical environment for the individual users. Then, the tenancy information can be associated to specific multi-tenancy properties. You can use any LDAP authentication provider here but for illustration we are using ApacheDS to determine tenancy information. 

If you are new to LDAP and need help in creating Apache Directory Server (ApacheDS) based LDAP environment to secure IBM Cognos 10.2 BI please refer my blog –
Using ApacheDS based LDAP to secure IBM Cognos 10.2 BI environment
It would take you thru steps of installation, configuration of ApacheDS along with Cognos LDAP integration. It’ll also help you manage ApacheDS environment using Apache Directory Studio.



Users
Attribute value for ‘l’
admin (domain administrator)
0
user1
1
user2
2
user3
3
user4
4


2) It is assumed that Cognos 10.2 BI server is already installed & configured and LDAP integration is completed. LDAP setting can be verified with ‘IBM Cognos Configuration’ (Start -> All Programs -> IBM Cognos 10 (‘IBM Cognos 10 – 64’ in case of 64-bit installation) in the Explorer window, under Security-> Authentication. For example, ‘ADS’ namespace shown with its properties.



3) Select ‘Advanced Properties’ from right window (Resource properties) and add two new values -

a)     Name – ‘multitenancy.TenantPattern’ value – ‘~/parameters/tenantID’
b)     Name – ‘AdditionalUserPropertiesToQuery’ value – ‘parameters’


4) Now, select ‘Custom Properties’ from right window (Resource properties) and add a new value –
Name – ‘tenantID’ value – ‘l’


5) From the File menu, click Save. Test connectivity to the namespace by right clicking on the name under Security, Authentication and selecting test. If the test is successful, this message box will appear.


Save the new configuration and restart Cognos service from toolbar.  
 

Implementing Multi-tenancy for sample tenants (exclusive access)

After multi-tenancy is enabled, the system administrator assigns tenant IDs to the existing content store objects. All objects belonging to a tenant have the same tenant ID. The tenant IDs are created when a user from a specific tenant logs on to IBM Cognos Business Intelligence, or the system administrator impersonates the tenant. Tenant IDs can also be created using the software development kit.
In our case we have 5 tenants with Tenant IDs assigned as shown in below chart -

Tenants
Tenant ID assigned
admin (domain administrator)
0
user1
1
user2
2
user3
3
user4
4

1) Now we’ll make ‘admin’ as a system administrator so login as ‘admin’ and launch IBM Cognos Administration.


Click on ‘Users, Groups, and Roles’ under ‘Security’ tab and select Cognos Namespace.


Scroll to bottom and select ‘set properties’ for the ‘System Administrators’ Group





From the ‘Members’ tab, we need to add some valid administrators (‘admin’ in our case) by selecting ‘Add’. Check ‘Select Users in the List’



Now we can remove the ‘Everyone’ group from the ‘System Administrators’ by selecting the checkbox next to everyone and selecting ‘Remove’. Select OK.

2) In a multitenant environment, all objects in the content store are either public or belong to a single tenant. As a system administrator, you must ensure that the existing objects have a proper tenant ID or are meant to remain public. For example, you can assign tenant IDs to data source connections, but leave the data source itself public.

If the tenant content is not organized into separate folders, you can create a root folder in Cognos Connection for each tenant exclusively. Having separate folders for each tenant helps to preserve the uniqueness of names in the Cognos BI environment.

Every object (folder, package, report, connection etc) in the content store has a tenant ID value that indicates which tenant the object belongs to. This value is based on the tenant ID associated with the session of the user who created the object. Here we’ll provide exclusive access of folders to respective tenants.

As shown below, 5 folders are created having same name as users. Click on ‘Set properties’ icon.


On the General tab, click Set next to the Tenant ID. Choose a tenant ID from the list of available IDs, and click OK. Choose ‘1’ for user1. Similarly set respective tenant ID on folder for all tenants (users). The LDAP administrator can add the ‘l’ attribute to those users who do not have this property set now, without having to reconfigure IBM Cognos BI v10.2.


3) Now for testing purpose, logoff as ‘admin’ and login as ‘user1’. Notice that user1 can only see folder ‘user1’.


If you try to set properties for ‘user1’ folder, notice that ‘TenantID’ property does not exist because user1 is not system administrator.



Implementing Multi-tenancy for sample tenants (shared access)

Now, we’ll see how to provide the shared access to an object which behaves differently for different tenant based on their tenant ID value. There are two ways.
  • No tenant ID assigned to publicly available objects hence they are available to all tenants without any change in behavior.
  • Using the TenantID session parameter in Cognos modeling tool (Framework Manager) to restrict the access at runtime. Multitenancy would be implemented to all the objects (reports, queries, analysis etc.) that are based on such metadata model/packages. Even if you don’t set tenantID property for these objects from Cognos Connection, objects would be available to all tenants but behave differently for different tenants.

Here we’ll quickly filter the metadata model using tenant ID session parameter and export the package to create a demo report to be used by all tenants.

1) Open ‘IBM Cognos Framework Manager’ (Start -> All Programs -> IBM Cognos 10). If it is not available then first install, configure and make sure its working. 

Here’s we are using two tables ‘ORDER_HEADER’ and ‘ORDER_DETAILS’ from ‘GOSALES’ schema of ‘great_outdoors_sales’ datasource connection (GS_DB). Tenant_ID is added in ORDER_HEADER, as you can see in below snapshot. We created a copy of ORDER_HEADER in GS_DB database and renamed its ORDER_METHOD_CODE column with TENANT_ID.


2) Test the results for TENANT_ID, RETAILER_NAME, QUANTITY and UNIT_SALE_PRICE with Auto Sum box checked. Notice that all the values for TENANT_ID would be from 1 to 7. Click on ‘Close’ button.


3) Double click on ‘ORDER_HEADER’ query subject and add a filter in ‘filters’ tab with “[great_outdoors_sales].[ORDER_HEADER].[TENANT_ID] = #sq($tenantID)#” expression.


Save project and publish the package (‘multitenancy_pack’ in our case).

4) Launch Report Studio from Cognos Connection using ‘multitenancy_pack’ package. Create a report to demonstrate multitenancy feature, as shown in below snapshot.

In a 1x2 table, two objects are placed – one bar chart and one list using RETAILER_NAME, QUANTITY and UNIT_SALE_PRICE query items. REVENUE is the calculated field –

REVENUE = QUANTITY * UNIT_SALE_PRICE

TENANT_ID is placed in title as a ‘Singleton’ object with ‘Aggregate function’ property set to ‘none’.

Save the report as ‘Demo Report’ and close Report Studio.


5) Logoff and login as ‘user3’ and run the ‘demo report’ created in above step. Notice that data values are filtered for respective tenant ID value which is ‘3’ for user3. Report title shows the tenant ID as area code.

Now logoff again and login as ‘user4’ to run the same report. You can notice the change in data values for user4. Similarly many such reports can be created using package multitenancy_pack. 







Besides the capabilities shown above, you can export and import the tenant content using the Cognos deployment capabilities. The deployment archive includes all tenant content and all public content associated with the tenant.
After multi-tenancy is enabled, you can also record tenant activities using an audit logging database. Cognos provides sample audit reports that show how to use the tenancy information to monitor certain user activities. For more information about how to use Cognos configuration to set up a logging database, see the IBM Cognos Business Intelligence Installation Guide and Configuration Guide.