OBIEE and Row-Level Security
May 13th, 2007 by Mark Rittman
During the past week I’ve been working on getting row-level security working with Oracle BI Suite Enterprise Edition. Like most OBIEE topics, typing the subject into google brings up zero results and so my first port of call was the online documentation on OTN. I’m not a particularly big fan of the online docs for OBIEE - in my opinion, they seem to tell you a lot of detail without actually telling you what it is you need to do, and unfortunately picking a broad subject like row-level security - setting the system up so that User A gets to see a different set of invoices, say, compared to user B, without actually writing different reports for them - is just a bit too general for the docs as they stand at the moment. So, I metaphorically rolled my sleeves up and did a bit of digging.
Sifting through the docs, and remembering back to the various Siebel Analyics and OBIEE presentations I’ve been to, there are many aspects to security with this suite of products. OBIEE is always presented as being ready to integrate with LDAP servers such as Oracle Internet Directory, and it’s also being positioned as being compatable with Oracle Single Sign-On. When you work with BI Administrator and select Manage > Security from the application menu, you can set up users and groups, and there’s a similar function available in Presentation Services, which is kept separate as it’s possible that users may deploy their own query tools (BO, Cognos etc) on top of the BI Server. Looking through past presentations on Siebel Analytics Server, you can also set up security using things called Initialization Blocks and Variables, which seems to set up table and column access on a dynamic, retrieved-from -a-database basis. So where do I start when I just want to set up simple users and groups, and have them have different filters applied to the core tables in my repository? Where does LDAP come in, can I authenticate using database usernames and passwords, what’s the best way to approach this?
In the end, all of these security features come down to two key aspects: Authentication, and Authorization. Authentication is the process of determining a user’s identity, and in OBIEE can be done by the BI Server, or by using an external authentication method such as an LDAP server, a table of usernames and passwords in a database, or by using a database such as Oracle to check a submitted password against it’s list of usernames and passwords. By default, OBIEE stores its own list of usernames and passwords and checks incoming credentials against this store. As an alternative, you can have an LDAP server such as Oracle Internet Directory or OpenLDAP do the authentication, or have a database do this, but all they’re doing is checking and OK’ing a password - it’s the Authorization process that then determines what resources that user can access.
For my purposes then, to create a row-level security demo, the authentication part is not the key element. For my purposes, I’ll just have BI Server do the authentication, then if I get time later, I’ll tie it in with an LDAP server (the more obvious choice, database authentication against database usernames and passwords, apparently doesn’t play well with Oracle Delivers). Assuming we’ve got authentication covered, then, how do we then go about applying row-level security?
From looking through the docs and online training material, it appears to me that there’s two main ways of placing users in to groups and assigning table filters to those groups. One way, as demonstrated in the OBI EE Oracle By Example exercises, is to have the BI Server perform lookups on database tables that are then placed in to session variables and used to create dynamic filters on tables. A more simpler approach, to my mind though, is to create the groups explicitely using the Security Manager in BI Administrator, add filters to those groups, and assign users to those groups. This has the disadvantage of making you go through another step in setting up these users and groups in OBIEE (when they may already be stored in database tables, or in an LDAP server) but it’s a simple, straightforward method that will probably cover most customers’ initial implementations. Later on, when we’re all comfortable with how things work, I presume it’s fairly straighforward to sync these internal BI Server users and groups with master information in an LDAP server, and also to dynamically generate the table filters - but that’s for another day. For me, I wanted to get simple row-level security set up, and also leave the door open to doing it in a more “enterprise” way later on.
The first step then was to go in to the Security Manager in BI Administrator and set up the groups I wanted to create. As I’m using the migrated Videostore data, I set up Central, Eastern, Western and Management groups, like this:

Then, I created four users, and assigned them to groups in the following ways:
- Mr A West, assigned to the Videostore_Western group only
- Miss B East, assigned to both the Videostore_Eastern and Western groups
- Miss C Central, assigned to the Videostore_Central group
- Mr M Superuser, assigned to the Videostore_Managers group
Then, I created filters on each of the groups. The Videstore_Western group could only see data in the Store folder for stores in the West region, Eastern could only see data for East and so on, like this:

As Miss B East belongs to two regions, hopefully she should see data for these two regions on her reports. The Superuser user should see all data, as the Videostore_Manager group doesn’t have any filters applied to it. Finally, I set up the dashboard so that all users can see the Regional Analysis page, but only Managers can see the Overview page, like this:

OK, so lets go over to Answers, log in as A West who should only see data for West region, and then run a report.

Ok, so far so good. What about for B East, who should see data for both East and West region?

Excellent. Running the same report for C Central (who should only see Central data) and for M Superuser (who should see all) returns the expected results.
Looking at the logical and physical queries in the NQSQUERY.LOG file (I’ve got all users running at logging level 2), I can see the original query issued by the user, with no filters applied, turned in to the physical query against the VIDEO5 schema with the table filters tacked on (and in the case of the B East user, turned in to an IN() clause as more than one filter is applied):
-------------------- SQL Request:
SET VARIABLE QUERY_SRC_CD='Report';
SELECT Store.City saw_0, Store.Region saw_1,
"Sales fact view".Sales saw_2
FROM Videostore ORDER BY saw_0, saw_1
+++b_east:320000:320004:----2007/05/13 15:57:35
-------------------- General Query Info:
Repository: Star, Subject Area: Videostore, Presentation: Videostore
+++b_east:320000:320004:----2007/05/13 15:57:35
-------------------- Sending query to database named
video_ORA10g (id: <<38848>>):
select T8114.CITY as c1,
T8114.REGION as c2,
sum(T8123.SALES) as c3
from
STORE T8114,
SALES_FACT_VIEW T8123
where ( T8114.STORE_KEY = T8123.STORE_KEY
and (T8114.REGION in (’East’, ‘West’)) )
group by T8114.CITY, T8114.REGION
order by c1, c2
In fact, its a process very much like Virtual Private Database in Oracle, where the database this time adds an extra predicate on to the SQL query to enforce row-level security, except in this case it’s the BI Server that adds the extra predicate.
Moving over to the dashboard now, I log in as the Miss C Central user and see what I can view. As expected, they only get to see the Regional Analysis page of the dashboard, and they’re limited to just the Central region for their analysis:

Whereas if I log in as M Superuser, who’s not part of any regional group but is part of the managers group, I can see both pages of the dashboard (the Overview pages is only visible to manager, whilst the regional page is visible to all regional users and managers), and on the regional page, I can see all regions, like this:

Not bad. Now obviously, in reality you’re not going to want to set up a whole new security regime within OBIEE, you’re going to want to bring in users and roles, and ideally filters, from your existing identity management setup, and if you’re a migrating Discoverer user, you’ll want these users, roles and ideally E-Business Suite responsibilities to be picked up from the database and from Oracle Applications respectively. From working through this example and through the docs, the way I’d see this happen is the following:
- Firstly, you’d either create your users in Oracle BI Server either yourself, or you’d use the LDAP import feature in the BI Administrator tool to have these created for you automatically - I’m not sure whether this applies to both groups and users, or just users. Discoverer users who currently use database users and roles will have to create these manually in BI Server (or through the OBIEE API) as there’s no “import users and roles from databases” utility, or not as far as I can see.
- For each of the groups you’ve created, either explicitely add folder filters using the OBIEE Security Manager, or (and this is an area I’m a bit hazy on) create the filters dynamically using initialization blocks and session variables
- From that point onwards, the BI Server applies the filters automatically for you, in a similar way to Oracle VPD, regardless of the query tool used (Oracle Answers/Dashboard, or any other query tool plugged in to the BI Server ODBC interface
For Discoverer users migrating to OBIEE, the only fly in the ointment is if they still want to have the Oracle database authenticate users, but they also want to use Delivers. From reading the docs, there’s an incompatibility between Delivers and database authentication (it’s all to do with something called user impersonation, Delivers “impersonates” the user when talking to the scheduler which won’t work when the database performs the authentication), but given that Discoverer seems to be a bit of a halfway house between database authentication and LDAP authentication anyway (the OID LDAP server performs the SSO authentication, but then data authentication is done by database users and password) this seems as good a time as any to move the whole shooting match over to LDAP and be done with it.
For my next trick, the neat thing now would be to link this in with Oracle Internet Directory (as the LDAP server) and all the new super-sexy Oracle Identity Management tools - the Thor Xcellerate stuff, all the provisioning tools and so on - to make authorization and authentication on my whole Oracle Fusion Middleware setup a “one-stop-shop”. Don’t hold your breath, as I also need to get all the SOA Suite stuff set up, including the Order Bookings demo, in time for a workshop the week after next, but at least I’ve got a clear path set out now - although of course if you’ve done this before, and you’ve got a better or simpler way, make sure you add a comment and let me know.
May 15th, 2007 at 10:25 am
Mark,
Last Friday I finished a wee POC for a client to see how we could integrate the existing LDAP (iPlanet from Sun) with our OBIEE installation. Using Initialization Blocks and system variables I was able to get it running in a very short time. But reading through the documents, as you pointed out, gives a lot of how-to-do and not so much of what-to-do.
I was not able to figure out a smart way to retrieve all possible group memberships from the LDAP since the BI server is expecting a semi column delimited list of group names. I had thought of putting this list in an attribute in the LDAP but that makes any delegate administration of group membership impossible (as well as adding a new attribute would take a lot of hassle as well, with in a large organization). What I came up with in the end was to add a second Init Block that is database dependent and is fired after the first, authentications block. This second block reads the group names for the given user from a database table and populates the GROUP system variable with the expected semi colon delimited list. Worked like a charm. On top of this DB table we could write a small Apex application that could easily allow the required delegate administration that we need.
Borkur
May 15th, 2007 at 10:28 pm
Evening Mark
Don’t forget, you can always ask your friends. it’s quicker than using the OTN or supportweb (I assume you have access to supportweb)
Adrian
May 21st, 2007 at 3:41 pm
[…] on OTN asked me to elaborate on a comment I made on a post that Mark Rittman wrote last week. What I need to achieve here is to use an existing LDAP server to […]
October 11th, 2007 at 2:04 pm
Nice article and a neat way to apply row-level security in OBI-EE, however the user creating the reports in Answers must be aware that if a report is created without a column from the table on which the filter has been placed, the filter is not used. Therefore, if you had a report that displayed the turnover for all the months of 2007, you must remember to always add a column from the filtered table, otherwise the result will be incorrect. This means that the person creating the report gets this extra responsibility to ensure correct data is displayed. Could be dangerous where sensitive information is displayed.
October 11th, 2007 at 2:38 pm
I did some further tests on this issue and found the ultimate solution. When you create the filter for the group, you need to first select the logical table that contains the facts (measures). Once you have selected the facts table, in the last column of the “User/Group Permissions – Filter Tab”, click on the Ellipsis button (button with three dots) to startup the “Expression builder”. In the “Expression builder” add the Region column filter and click OK. What this does is add the filter whenever facts/measures are added in Answers, ensuring that the users of the group will only see values pertaining to their group. On testing this, I only selected a column from the facts column and in the NQQuery log file the select statement displays not only the fact table in the select statement but also the filtered dimension table and the filter it’s self.
October 11th, 2007 at 8:33 pm
Raymond - that’s excellent, thanks for posting the solution here. I’ll give this a test myself, it sounds like the perfect solution. Cheers.
November 8th, 2007 at 11:37 pm
Is it possible to set SSO using MSAD only without usingI=OID?
Our configuration is 10.3.3.1 BIServer (+other stuff) using 10.3.3.1 Oracle AS installed on windows 2003 OS.
November 21st, 2007 at 10:41 pm
Thank you. After many hours of searching/testing/struggling to impliment this, I came across your blog post and got it to work within minutes. I’m am very grateful.
December 3rd, 2007 at 3:08 pm
it would be worthwhile to mention that since database authentication is supported for OBIEE, that the traditional benefits of VPD, and existing VPD row level security can be leveraged seamlessly with OBI EE.
Have you tried out leveraging VPD and hence leveraging database users as OBI EE users? I suspect you’d have to turn off connection pooling as well. so that each user gets their own db connection, application context for vpd based policies.
December 4th, 2007 at 5:55 pm
Mark,
A very informative article. However if we were to use SRMW then for Authentication we have to deal with the Hierarchy tables that store the positions in the org. Depending on who logs in at what position the data that he is authorised to see should be displayed. I need to impelement something on these lines and was looking for a solution. I will try out some ideas that I have and keep you potsted.
December 4th, 2007 at 5:57 pm
I ment Authorization not Authentication.
December 17th, 2007 at 9:10 pm
Vips/Mark,
I have a very similar requirement. Our security model mimics the organization structure and each person in this hierarchy can see the KPI data rolled-up for them and the teams under them.
Please let me know if you have implemented this in OBIEE.
January 3rd, 2008 at 2:48 pm
we have to deal with the Hierarchy tables that store the positions in the org. Depending on who logs in at what position the data that he is authorised to see should be displayed. I need to impelement something on these lines and was looking for a solution.
January 24th, 2008 at 9:32 am
Mark,
We are currently attempting to implement row-level security in the manner you describe, in our case to filter records in a dimension table using attributes that sit in various dimension tables that link from this main table.
We have come across the issue highlighted by Raymond. i.e the group defined filters only work when reports include a column from the table in question.
I have read Raymond’s solution comment, but do not know whether this will work for us given that the tables involved are all Dimension tables.
Please could you let me know whether you think this is possible, and how we should go about it.
Thanks
January 29th, 2008 at 2:59 pm
@David - just need to clarify your question - can you produce an example, say write it out so that we know a bit more detail? Perhaps you can email it to me - mark.rittman@rittmanmead.com - and I’ll take a look? If you can include an RPD file that’d be useful.
regards, Mark
February 28th, 2008 at 11:43 am
Its good. I want very basic information like what is OBIEE what are its advantages ? When did it actually start ?
March 3rd, 2008 at 5:43 pm
Mark,
Very educational, I was wondering if there is any article for Integrating E-Business Suite Security Model with OBIEE.
March 3rd, 2008 at 8:21 pm
@Von - try this article by Gerard Braat, it covers OBIEE and E-Business Suite security well - http://www.beyeblogs.com/eyeonbi/archive/2007/06/oracle_bi_fusion_intelligence.php
@Tezdeepth - you’d best take a look at OTN, try this page for starters - http://www.oracle.com/technology/products/bi/enterprise-edition.html Also you might be interested in these posting I did a while ago on this history of OBIEE/Siebel Analytics - http://www.rittmanmead.com/2006/01/23/siebel-analytics-the-jewel-in-the-project-fusion-crown/ and http://www.rittmanmead.com/2007/09/18/a-potted-history-of-oracle-bi-suite-enterprise-edition/
March 4th, 2008 at 4:35 pm
[…] Comments Chandra on Migrating OBIEE Reports Between Web CatalogsMark Rittman on OBIEE and Row-Level SecurityMark Rittman on OBIEE Hybrid OLAP Reporting using MS Analysis Services & OracleMark Rittman on […]
May 5th, 2008 at 7:50 pm
Mark, thank you for your informative blogs! Since this was published in May 07 has anyone found a way to use OBIEE to retrieve multiple groups per user directly from active directory? It would be nice to avoid populating a database with these groups.
Thanks!