Solved

need to understand different ways of restricting data access, to meet government guidelines

Posted on 2016-08-02
12
106 Views
Last Modified: 2016-08-03
In our government agency, we are required to "harden" databases, e.g., database access, prevent Personally Identifiable Information from unauthorized access, etc.

The chosen solution is leave current data in the ERP d.b. (~5 years) and delete everything else. The data warehouse then contains all data back to the beginning of time, and it's refreshed weekly. So historical reporting that previously was done from the main ERP database will have to be re-directed to the DW.

My question is this - isn't it reasonable (from a security perspective) to restrict data to current (~5 years)  via security profiles ?

For example
- implement VPN policies (this is a non-programmatic solution)
- simply implement views and restrict data (Oracle views or BusinessObjects "views")

- could partitions be a way of restricting data access ?

My perspective on this is that we currently do all reporting out of the ERP database. But creating the DW means that now we have TWO very big databases to maintain. So all kinds of views, functions, procedures, etc. now have to be maintained in the DW in addition to the main ERP system. Why not let the computer do the work, instead of two physical databases ?

I also have recently come to learn about in-memory computing, and Professor Plattner of SAP (1st 5 minutes) says in-memory computing (via Hana of course) REDUCES code footprint, data footprint, etc., so much so that the DW isn't even necessary !

So my main question again is - is it really necessary to physically segregate the data to "harden" access ? Couldn't the power of the computer meet this "hardening" criteria ?
0
Comment
Question by:Gadsden Consulting
  • 6
  • 5
12 Comments
 
LVL 15

Expert Comment

by:Walter Ritzel
ID: 41739140
So, if you want to protect the PIM information, credit card information, etc, maybe you should look to encrypt your sensitive field through TDE:

http://www.oracle.com/technetwork/database/options/advanced-security/index-099011.html

From what I can understand, it provides the much needed data at rest protection, when people can try to bypass the database and, based on the use I did, based on roles, protect the use through the normal database usage as well.

This will prevent to make changes related to fields encryption.

Now, about how long should you have information stored, this needs to keep up with your company policies for data retention. Usually, this would go around keep at a maximum of 7 years of information for the most cases.

Now, if you want to prevent users to see that not related to them, then you need to think a row level security, which could be implemented via security profiles. So for example, a manager can see his data and of everyone under him, but an Individual Contributor can only see his own information. On the data warehouse I work with, we use that + a security predicate function to filter each and every query at database level, without changing OBIEE or SAP BO models.
0
 

Author Comment

by:Gadsden Consulting
ID: 41739288
Walter,

very good, thank you.

I hadn't thought about the encryption, but that's a good point, the link is helpful.

Our focus is on rogue users who run reports, download to Excel, and then send to the Huffington Post.  But the encryption for data at rest is a good point that I'll put forward.

Our data retention for the key components is forever, but it's not a big d.b., so storage and performance is not much of an issue.

Row level security sounds good - how do you implement that ?

Is the security predicate VPN logic ? I've done that before and it's a bit tricky but slick.
0
 
LVL 15

Accepted Solution

by:
Walter Ritzel earned 250 total points
ID: 41739695
The idea is to create a table that specify the hierarchical relation of the employees and which roles each employee is part of. Then, create a hierarchical query that, based on the employee_id and role of the logged user, the query will result in a list of allowed employee_ids that user can see the information.
This query will be the security predicate added to each query involving the employee table, limiting the information that can be seen.

For example, to enable a policy on top of employee dimension:
BEGIN
  SYS.DBMS_RLS.DROP_POLICY (
    object_schema    => 'schema name'
    ,object_name     => 'employee table'
    ,policy_name     => 'EMP_SEC');
END;
/

BEGIN
  SYS.DBMS_RLS.ADD_POLICY     (
    object_schema          => 'schema name'
    ,object_name           => 'Employee table'
    ,policy_name           => 'EMP_SEC'
    ,function_schema       => 'schema name'
    ,policy_function       => 'secure employee function'
    ,statement_types       => 'SELECT'
    ,policy_type           => dbms_rls.dynamic
    ,long_predicate        => FALSE
    ,update_check          => FALSE
    ,static_policy         => FALSE
    ,enable                => TRUE );
END;
/

BEGIN
dbms_rls.enable_policy(object_schema => 'schema name',
object_name => 'employee table',
policy_name => 'EMP_SEC',
enable => TRUE );
END; 
/

Open in new window



Then, it is just a matter of having a function that will add the predicate:
CREATE OR REPLACE FUNCTION schema name.function name(obj_schema VARCHAR2,
                                               obj_name   VARCHAR2) RETURN VARCHAR2 IS
      d_predicate   VARCHAR2(20000);
   
   PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
   IF dbms_mview.i_am_a_refresh THEN
      RETURN NULL;
   END IF;
  -- implement logic to return the predicate

  d_predicate := '1=1';   -- standard predicate

   RETURN d_predicate;
EXCEPTION
   WHEN OTHERS THEN
      RETURN '1=0'; -- when an exception occurs, prevent to see any data
END function name;
/

Open in new window

1
 

Author Comment

by:Gadsden Consulting
ID: 41739722
Excellent,  thank you.

Does this fall under the heading of row level security.? Are there other means to implement row level secu5?
0
 
LVL 15

Expert Comment

by:Walter Ritzel
ID: 41740012
Yes, it is for row level security.
The only other way I know would be use this same table as part of the model and declaratively make it part of the queries.
I prefer this predicate implementation as it is more transparent to the rest of the layers of the application.
1
 
LVL 36

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 250 total points
ID: 41740456
you could use VPD > Virtual Private Database
https://docs.oracle.com/cd/B28359_01/network.111/b28531/vpd.htm

with those policies you could restrict in time

it's an extra option for the enterprise edition
1
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Gadsden Consulting
ID: 41740498
Geert,

thank you, very helpful.

what exactly do you mean "you could restrict in time" ?
0
 
LVL 15

Expert Comment

by:Walter Ritzel
ID: 41740634
Gadsden,
just a clarification: my solution for row level security uses Oracle VPD.
1
 

Author Closing Comment

by:Gadsden Consulting
ID: 41740644
very good, just what I was looking for, thanks !
0
 

Author Comment

by:Gadsden Consulting
ID: 41740653
oops, I didn't study the code before closing the question.

I understand the setup part, have done that before.

But I have no clue what the function is doing :-(
- where's the sql ? I was expecting some sql logic that restricted access to the employee table based on hierarchy.
0
 
LVL 15

Expert Comment

by:Walter Ritzel
ID: 41740851
The routine needs to return a string that will be what we call the predicate, which is a piece of SQL that will be appended to the query being executed an filter.
So, basically, you need to write the logic that will add the predicate to the query.

Example: You have create the policy on top of the employee_table and the business rule implemented is this: if the today is a weekend day, the query should not return any data.

CREATE OR REPLACE FUNCTION schema name.function name(obj_schema VARCHAR2,
                                               obj_name   VARCHAR2) RETURN VARCHAR2 IS
      d_predicate   VARCHAR2(20000);
      cnt_weekend INTEGER;
   PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
   IF dbms_mview.i_am_a_refresh THEN
      RETURN NULL;
   END IF;
  
  d_predicate := '1=1';   -- standard predicate

   select count(1) into cnt_weekend 
   from dual 
   where MOD(TO_CHAR(sysdate, 'J'), 7) + 1 IN (6, 7);

  if cnt_weekend = 1 then
      d_predicate := '1=0';
  end if;

   RETURN d_predicate;
EXCEPTION
   WHEN OTHERS THEN
      RETURN '1=0'; -- when an exception occurs, prevent to see any data
END function name;
/

Open in new window


So, when you do that and in TOAD, SQL Developer or any SQL tool, you query the table employee, what will happen is this:

QUERY you wrote: SELECT * FROM employee_table;
QUERY Oracle executes on week day: SELECT * FROM employee_table WHERE 1=1;
QUERY Oracle executes on weekend: SELECT * FROM employee_table WHERE 1=0;
0
 

Author Comment

by:Gadsden Consulting
ID: 41740970
ah, much better, thanks !
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now