OracleDB12c New Feature: Capture Privilege Usage

One of the top features of the Oracle Database 12c that attracted me is capturing the privileges used (and unused). This feature is introduced to strengthen the security of the database to enforce the principle of least privilege. Many application users today have excessive privileges assigned, and believe me, have seen many applications connect to the database using an account with “DBA” role or “DBA like” role… Using the “Privilege Capture” feature of the Oracle Database 12c, we can now clearly and exactly know which privileges are used by the application or user and which privileges can be revoked.

New PLSQL API DBMS_PRIVILEGE_CAPTURE is added to 12c. The procedures available in this package are:

  • CREATE_CAPTURE
  • ENABLE_CAPTURE
  • DISABLE_CAPTURE
  • GENERATE_RESULT
  • DROP_CAPTURE

The new default role in 12c database CAPTURE_ADMIN has execute privilege on this new package. CAPTURE_ADMIN role is granted to DBA role as well.

As the subprograms or procedure names indicate, you must first define a policy using the CREATE_CAPTURE procedure. The policy can be at the database level analysis, or role level or based on a context.

Once policy is created, it is not enabled by default. Use the ENABLE_CAPTURE program to enable the policy.

After the analysis period, you disable the policy using the DISABLE_CAPTURE program.

Once the policy is disabled, you are ready to generate the results using the GENERATE_RESULT program.  Once the policy is created by giving a name, that name is the parameter to all the other programs.

By running the GENERATE_RESULT, the following new data dictionary views are populated…

  • DBA_USED_xxx
  • DBA_USED_xxx_PATH
  • DBA_UNUSED_xxx
  • DBA_UNUSED_xxx_PATH

The DBA_USED_ views show the privileges used by the user for the policy. The DBA_UNUSED_ views show the privileges that are assigned to the user, but are not used. The _PATH views show the privilege path (how the privileged was given to the user, through which role).

Reference to the views:

Once you have documented all the information required, you can use the DROP_CAPTURE program to delete the policy and all the usage data collected.

Update on 01-May-2014

Published an article on this subject in OTech Magazine. Download the article from http://www.slideshare.net/slideshow/embed_code/34193245

Read the article and other articles in OTech Magazine at http://www.otechmag.com/2014/otech-magazine-winter-2014/

Oracle Database 12c is now GA… (Finally!!)

Oracle Database 12c is released today [June 25]… there is a wealth of new features in 12c database, most major ones were discussed by Oracle speakers in conferences since OOW 2012… The major feature is the introduction of container databases and pluggable databases.

Database 12c software is available for download at OTN. Documentation is also available on OTN.

Documentaion link:
http://www.oracle.com/pls/db121/portal.portal_db?selected=1&frame=#new_to_oracle_database_12c

Software download link:
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

I was lucky to be part of the Oracle12c Database beta program… In the coming weeks I will be sharing new feature information in this blog [after making sure they are the same in the GA release as well 🙂 ]. Stay tuned…

A good place to start knowing Oracle Database 12c features and changes is Oracle Documentation… Start with the  new features guide at
http://docs.oracle.com/cd/E16655_01/server.121/e17906/chapter1.htm#NEWFTCH1

Enjoy DB12C…