Frank Lyons


Published on

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Frank Lyons

  1. 2. Agenda <ul><li>Database Overview </li></ul><ul><li>Oracle Audit/Security/Control </li></ul>
  2. 3. Objectives <ul><li>Your objectives </li></ul><ul><li>Magic Disk </li></ul><ul><ul><li>Database Control Objectives </li></ul></ul><ul><ul><li>Frank W. Lyons </li></ul></ul><ul><ul><li>[email_address] </li></ul></ul><ul><ul><li>407-774-8397 </li></ul></ul>
  3. 4. Terminology <ul><li>Database </li></ul><ul><ul><li>A set of data </li></ul></ul><ul><li>Tablespaces </li></ul><ul><ul><li>Logical division of a database </li></ul></ul><ul><li>Files </li></ul><ul><ul><li>datafile </li></ul></ul><ul><li>Instances </li></ul><ul><ul><li>Also known as a server </li></ul></ul><ul><li>Table, columns and datatypes </li></ul>
  4. 5. Columns <ul><li>The characteristics of a column are made up of two parts: its datatype and its length. </li></ul><ul><li>For columns using the NUMBER datatype, the additional characteristics of precision and scale can be specified. Precision determines the number of significant digits and Scale determines the placement of the decimal point </li></ul>
  5. 6. <ul><li>Structure Query Language (SQL) </li></ul><ul><ul><ul><li>Data Definition Language </li></ul></ul></ul><ul><ul><ul><ul><li>DDL </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Create, Drop, Alter </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Data Manipulation Language </li></ul></ul></ul><ul><ul><ul><ul><li>DML </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Select, Insert, Update, Delete </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Data Control Language </li></ul></ul></ul><ul><ul><ul><ul><li>DCL </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Grant, Revoke </li></ul></ul></ul></ul></ul>The Database Language
  6. 7. <ul><li>Obtain the Data Structure Diagram </li></ul>Customer Table Warehouse Table Order Table The data structure diagram provides all the tables and columns Database Structure
  7. 8. Tables <ul><li>Tables owned by the user SYS are called the data dictionary tables </li></ul><ul><li>Dictionary tables provide a system catalog that the database uses to manage itself </li></ul><ul><li>The database maintains the relationship between table by using referential integrity </li></ul>
  8. 9. <ul><li>Object Dependencies </li></ul>Database Tablespace Table Index Synonym View Synonym This is the file name under the operating system Database Structure
  9. 10. Databases <ul><li>A database is a set of data. </li></ul><ul><li>Oracle provides the ability to store and access data in a manner consistent with a defined model known as the Relational Model. </li></ul>
  10. 11. Tablespaces <ul><li>A tablespace is a logical division of a database </li></ul><ul><li>Each tablespace is constituted of one or more files, called datafiles, on a disk. A datafile can belong to one and only one tablespace </li></ul>
  11. 12. <ul><li>To prevent users from creating objects in the SYSTEM tablespace, any quotas on SYSTEM, which could give a user the ability to create objects in the SYSTEM tablespace, must be revoked: </li></ul><ul><ul><li>alter user Frank quota 0 on SYSTEM </li></ul></ul><ul><li>When you create a new user via the create user command, you can specify a default tablespace: </li></ul><ul><ul><li>create user Frank identified by excellence </li></ul></ul><ul><ul><li>default tablespace Human_Resources </li></ul></ul>Tablespaces
  12. 13. <ul><li>SYSTEM Data Dictionary </li></ul><ul><li>DATA Standard-operation tables </li></ul><ul><li>DATA_2 Static tables used during standard operation </li></ul><ul><li>INDEXES Indexes for the standard operation tables </li></ul><ul><li>INDEXES_2 Indexes for the static tables </li></ul><ul><li>RBS Standard operation rollback segment </li></ul><ul><li>RBS_2 Specialty rollback segments used for data loads </li></ul><ul><li>TEMP Standard operation temporary segments </li></ul><ul><li>TEMP_USER Temporary segments created by a user </li></ul><ul><li>TOOLS RDBMS tools tables </li></ul><ul><li>TOOLS_1 Indexes for RDBMS tools tables </li></ul><ul><li>USERS User objects, in development databases </li></ul>Tablespaces
  13. 14. Instance <ul><li>In order to access the data in the database, Oracle uses a set of background processes that are shared by all users. </li></ul><ul><li>A database instance (also known as a server) is a set of memory structures and background processes that access a set of database files. </li></ul>
  14. 15. Views <ul><li>Views appear to be a table containing columns and is queried in the same manner that a table is queried </li></ul><ul><li>Views do not use physical storage to store data </li></ul><ul><li>Views can not be indexed. </li></ul>
  15. 16. Typical Authentication Pyramid <ul><li>Application Logon </li></ul>Reporting Tool Database Data Accountability lessens as you move down the pyramid
  16. 17. Where Are the Application Controls? <ul><li>Direct access usually by-passes application controls </li></ul><ul><ul><li>User profiling is normally only used within the application </li></ul></ul><ul><ul><li>Views of reporting data could be incorporated </li></ul></ul><ul><ul><li>Summarized data could be used to reduce sensitivity </li></ul></ul>
  17. 18. Relational Data Storage Employee Table
  18. 19. Views Based on User Profile View of the Commercial Division Security is based on data value
  19. 20. Reduced Data Sensitivity Employee Locator View Security is based on columns selected
  20. 21. Summarized Views View Summarized by Division
  21. 22. Access Type Difference <ul><li>Id and Passwords </li></ul><ul><li>User Profiles </li></ul><ul><li>Accountability and audit ability </li></ul>
  22. 23. Data Access <ul><li>Application interfaces </li></ul><ul><li>Reporting Tools </li></ul><ul><li>Direct access </li></ul>
  23. 24. ID and Password Controls <ul><li>Where is the ID and Password Stored for verification? </li></ul><ul><li>How is the password stored? </li></ul><ul><li>Is the same user ID used for multiple applications? </li></ul><ul><li>Is the password stored in multiple locations? </li></ul>
  24. 25. User Profiles <ul><li>Profiles allow access according to job responsibilities </li></ul><ul><ul><li>Division </li></ul></ul><ul><ul><li>Position </li></ul></ul><ul><ul><li>Security Clearance </li></ul></ul>
  25. 26. User Profiles Controls <ul><li>Who creates and modifies the user profile? </li></ul><ul><li>What audit trails are in place for profile changes? </li></ul><ul><li>What approvals are required for changes to the user profile? </li></ul><ul><li>What is the notification process for job responsibility changes? </li></ul>
  26. 27. Accountability and Auditability <ul><li>Is the user id translated to a high powered id during application access to the data? </li></ul><ul><li>Does the application record read access? </li></ul><ul><li>When data is inserted, modified, or deleted is the change logged? </li></ul><ul><ul><li>If there is a log who is reviewing the log? </li></ul></ul>
  27. 28. ID Translation <ul><li>Used to prevent users from accessing data directly </li></ul><ul><li>Prevents authentication by the database management system </li></ul><ul><li>Creates tuning and monitoring challenges </li></ul>
  28. 29. Reporting Tools and Direct Access <ul><li>Ad-hoc reporting </li></ul><ul><ul><li>User flexibility </li></ul></ul><ul><ul><li>Less labor to support user reporting requirements </li></ul></ul><ul><ul><li>Checks and balance to insure information accuracy </li></ul></ul>
  29. 30. Separate Reporting Database On-line Database Reporting Database Synchronization can be done real time or on intervals
  30. 31. Advantages of Separate Reporting Databases <ul><li>Design for reporting efficiencies </li></ul><ul><li>On-line environment not impacted by the reporting workload </li></ul><ul><li>Data can be summarized to reduce data sensitivity </li></ul><ul><li>Multiple reporting databases can be defined to limit access to sensitive information </li></ul>
  31. 32. Disadvantages of Separate Reporting Databases <ul><li>Extra storage and processor resources are required </li></ul><ul><li>Extra labor resources are required to support replication process </li></ul><ul><li>Special controls needed for direct access authority </li></ul><ul><li>Read activity needs to be logged for audit ability </li></ul>
  32. 33. Reporting Tools Reporting Database Reporting Tool View of Data Reporting tools can limit access by column, data value, or through summarization.
  33. 34. Web Access <ul><li>Reporting Tools can push static or dynamic information </li></ul><ul><li>Design should balance performance differences with flexibility </li></ul><ul><li>Security at the data level needs to be well understood so that access is based on data sensitivity and job responsibilities </li></ul>
  34. 35. Application Recovery <ul><li>Code is normally static </li></ul><ul><li>Code changes should be installed on well defined intervals </li></ul><ul><li>Recovery usually requires reboot of application server </li></ul><ul><li>Corrupted application files can be restored from the last copy </li></ul>
  35. 36. Database Recovery <ul><li>Data is a constantly changing resource </li></ul><ul><li>Rebooting the database server causes the database system to recovery any in-flight units of work </li></ul><ul><li>Restoring data from backup requires the database logs to be applied to the data in order to restore data consistency </li></ul>
  36. 37. Database Logs Data Identification (Record Header) Before Image of Data After Image of Data
  37. 38. Log Contains All Data Modifications Database Log Database User Activity
  38. 39. Backout Due to Abort or Abend Database Log Database User Activity Aborted Unit of Work Log Records are read to backout the changes to the data
  39. 40. Protecting Database Log <ul><li>Critical Recovery Resource </li></ul><ul><li>Contains Sensitive Information </li></ul><ul><li>Needed for on-site and off-site recovery </li></ul><ul><li>Log shipping often done for off-site recovery </li></ul>
  40. 41. Log Shipping Database Log Copy Off-site Database Log Database On-site
  41. 42. Criteria for Server Selection in the Database Environment <ul><li>Stability </li></ul><ul><li>Security </li></ul><ul><li>Recoverability </li></ul><ul><li>Performance </li></ul>
  42. 43. Key Points <ul><li>Application access controls are by-passed through most reporting interfaces </li></ul><ul><li>Security design MUST be centered on the data and incorporated in each interface </li></ul><ul><li>Data and application recovery have key differences and need special considerations </li></ul>
  43. 44. Key Points <ul><li>Security should be designed around the DATA </li></ul><ul><li>All interface points must be reviewed </li></ul><ul><li>Data recoverability needs differ between application and data </li></ul><ul><li>Database logs contain sensitive information </li></ul>
  44. 45. Oracle
  45. 46. Identify Risks <ul><li>Default Users </li></ul><ul><li>Operating System configuration </li></ul><ul><li>Database server configuration </li></ul><ul><li>Listener process </li></ul><ul><li>Privileges </li></ul><ul><li>Database links </li></ul><ul><li>Patches </li></ul>
  46. 47. Init.ora <ul><li>Database startup file </li></ul><ul><li>This file is read during the instance startup and may be modified by the DBA. Any modifications to this file will not take affect until the next startup that uses this file </li></ul>
  47. 48. <ul><li>In the default directory configuration, the init.ora file is stored in a directory named </li></ul><ul><ul><li>/orasw/app/oracle/admin/instance_name/pfile </li></ul></ul><ul><li>The init.ora file does not list the names of the datafiles or online redo log files for the database as these are stored in the data dictionary. </li></ul><ul><li>Init.ora does list the names of the control files for the database </li></ul>Init.ora
  48. 49. Config.ora <ul><li>A second configuration file is typically used to store the settings of variables that do not change after database creation </li></ul><ul><li>Such as the database block size </li></ul><ul><li>In order for the config.ora settings to be used, the file must be listed as an include file via the IFILE parameter in the instance’s init.ora file </li></ul>
  49. 50. Procedures <ul><li>A procedure is a block of PL/SQL statements that is stored in the data dictionary and is called by applications </li></ul><ul><li>Stored procedures help to enforce data security </li></ul>
  50. 51. Functions <ul><li>Functions, like procedures are blocks of code that are stored in the database. </li></ul><ul><li>Function are capable of returning values to the calling program </li></ul>
  51. 52. Packages <ul><li>Packages are used to arrange procedures and functions into logical groupings </li></ul><ul><li>Packages have a public and private elements </li></ul><ul><li>Private elements may include procedures called by other procedures within the package </li></ul><ul><li>Source code for the functions, procedures, and packages are stored in the data dictionary tables </li></ul>
  52. 53. Triggers <ul><li>Triggers are procedures that are executed when a specified database event takes place against a specified table </li></ul><ul><li>Used as part of referential integrity </li></ul><ul><li>Used to enforce additional security </li></ul><ul><li>Used to enhance the available auditing options </li></ul>
  53. 54. <ul><li>Two types of triggers </li></ul><ul><ul><li>Statement triggers </li></ul></ul><ul><ul><ul><li>Fire once for each triggering statement </li></ul></ul></ul><ul><ul><li>Row triggers </li></ul></ul><ul><ul><ul><li>Fire once for each row in a table affected by the statement </li></ul></ul></ul><ul><li>For each type a BEFORE trigger and AFTER trigger can be created </li></ul><ul><li>Triggering events include inserts, updates, and deletes </li></ul>Triggers
  54. 55. Synonyms <ul><li>To completely identify a database object such as a table or a view, the host machine name, the server instance name, the object’s owner, and the object’s name must be specified </li></ul><ul><li>Synonyms reduce this effort </li></ul><ul><li>Public synonyms are shared by all users </li></ul><ul><li>Synonyms can provide pointers for tables, views, procedures, functions, packages, and sequences </li></ul>
  55. 56. Database Life Cycles <ul><li>Planning </li></ul><ul><li>Creating </li></ul><ul><li>Monitoring </li></ul><ul><li>Tuning </li></ul><ul><li>Securing </li></ul><ul><li>Auditing </li></ul>
  56. 57. Operating system configuration <ul><li>Use file system security to protect the DBMS software and data files (Only allow the Oracle user and Oracle group access to the files) </li></ul><ul><li>Turn off all operating system functionality/services that are not required by the DATABASE SERVER (mail,ftp,telnet) </li></ul><ul><li>Turn on O/S level auditing and review the audit log daily </li></ul><ul><li>Secure the backup of the database </li></ul><ul><li>Audit regularly </li></ul>
  57. 58. Database System Configuration Remove non-essential users and enforce password management (see appendix) Change the default passwords on accounts Do not allow development in a production database/server Secure the development database (may contain production data) Keep the software up to date and patched
  58. 59. Database System Configuration Oracle Database - Physical Structures <ul><li>When a backup of a database occurs, the backup software is making copies of the physical structures of an Oracle instance. </li></ul><ul><li>Physical Structures stored in the operating system </li></ul><ul><ul><li>Control File </li></ul></ul><ul><ul><li>Online Redo Log </li></ul></ul><ul><ul><li>Data File </li></ul></ul><ul><ul><li>INIT.ORA </li></ul></ul><ul><ul><li>SPFILE (Oracle9i) </li></ul></ul><ul><ul><li>ORACLE_HOME (Oracle software) </li></ul></ul><ul><ul><li>Backup destination </li></ul></ul>
  59. 60. Database System Configuration Oracle Database/Physical Structures <ul><li>Control File </li></ul><ul><ul><li>Contains information about the instance and all of it’s external files. </li></ul></ul><ul><ul><li>Used by Oracle to know if a data file needs recovery. </li></ul></ul><ul><ul><li>Audit view: V$CONTROLFILE </li></ul></ul><ul><li>Online Redo Log </li></ul><ul><ul><li>Keeps track of all the transactional activity that makes changes to the database. </li></ul></ul><ul><ul><li>Audit view: V$LOGFILE </li></ul></ul>
  60. 61. Database System Configuration Oracle Database/Physical Structures <ul><li>Data File </li></ul><ul><ul><li>Associated with a single tablespace. </li></ul></ul><ul><ul><li>Oracle server creates a data file for a tablespace by allocating the specified amount of disk storage + a small overhead. </li></ul></ul><ul><ul><li>Can contain data segment (table), index segment (primary keys, unique constraints or tuning indexes), rollback and temporary segments. </li></ul></ul><ul><ul><li>Audit view DBA_DATA_FILES </li></ul></ul><ul><li>INIT.ORA </li></ul><ul><ul><li>Used by the Oracle instance to configure how much of the OS resources will be used by the instance. </li></ul></ul><ul><ul><li>Parameters can be placed here for optional processes </li></ul></ul><ul><ul><li>Audit view V$PARAMETER </li></ul></ul>
  61. 62. Database System Configuration Oracle Database/Physical Structures <ul><li>Data File </li></ul><ul><ul><li>Audit view DBA_DATA_FILES </li></ul></ul><ul><ul><li>SQL> select file_name from dba_data_files </li></ul></ul><ul><ul><li> order by file_name </li></ul></ul><ul><li>Control File </li></ul><ul><ul><li>Audit view: V$CONTROLFILE </li></ul></ul><ul><ul><li>SQL> select * from v$controlfile; </li></ul></ul><ul><li>Online Redo Log </li></ul><ul><ul><li>Audit view: V$LOGFILE </li></ul></ul><ul><ul><li>SQL> select * from v$logfile </li></ul></ul><ul><ul><li>order by group# </li></ul></ul>
  62. 63. Database System Configuration Oracle Database/Physical Structures <ul><li>INIT.ORA </li></ul><ul><ul><li>Audit view V$PARAMETER </li></ul></ul><ul><ul><li>SQL> select name,value from v$parameter </li></ul></ul><ul><ul><li>License/version </li></ul></ul><ul><ul><li>Audit view v$version </li></ul></ul><ul><ul><li>SQL> select * from v$version </li></ul></ul>
  63. 64. Privileges Third party application owner will typically have the ‘DBA’ role granted to them This is needed for installs/upgrades of software, but typically can be removed for day to day activities SELECT ANY TABLE privilege should not be allowed on any ‘end user’
  64. 65. Privileges <ul><li>SELECT ANY TABLE privilege gives users the ability to select from ANY table </li></ul><ul><ul><li>including SYS.USER$ and SYS.LINK$ </li></ul></ul><ul><ul><li>These tables will show passwords </li></ul></ul>
  65. 66. Privileges Audit Checklist SQL> select privilege privilege_granted, grantee,admin_option from sys.dba_sys_privs where not exists (select 'x' from sys.dba_users where username = grantee) order by privilege_granted,admin_option;
  67. 68. Database Link <ul><li>Used to connect one database to another </li></ul><ul><li>The Database link contains: </li></ul><ul><li>  </li></ul><ul><ul><li>USER ACCOUNT TO CONNECT TO THE TARGET DATABASE </li></ul></ul><ul><li>LOCAL USERNAME AND PASSWORD </li></ul><ul><li>(HARD CODED) or pass through authentication </li></ul><ul><li>CONNECT STRING (Oracle / SQLNET/ NET8) </li></ul><ul><li>Audit view: dba_db_links </li></ul>
  68. 69. Oracle NET / NET8 /SQL*NET LISTENER Configuration Client Server 1 listener.ora Listener On port sqlplus user/pw@DB1 User DB1 tnsnames.ora/sqlnet.ora 2 3 4 Server
  69. 70. Oracle NET / NET8 /SQL*Net LISTENER <ul><li>Oracle NET enables communications between partners in a distributed transaction </li></ul><ul><li>Applies to client/server or server/server environment. </li></ul><ul><li>During the life of a connection, resolves all differences between the internal data representations and/or character sets of the computer. </li></ul><ul><li>Net8 has been renamed to Oracle NET for 9i </li></ul>
  70. 71. Harden the Listener Process <ul><li>The configuration file for the listener is LISTENER.ORA. </li></ul><ul><li>LISTENER.ORA resides on the server and defines… </li></ul><ul><ul><li>Listener name, a database can have multiple listeners </li></ul></ul><ul><ul><li>The network listener address </li></ul></ul><ul><ul><li>The SID of the database for which it listens </li></ul></ul><ul><ul><li>Parameters that influence the network listener’s behavior, including tracing, timeout and logging and password </li></ul></ul>
  71. 72. Harden the Listener Process <ul><ul><li>Prevent unauthorized administration of the Oracle Listener by: </li></ul></ul><ul><ul><li>ADMIN_RESTRICTIONS_listener_name=ON </li></ul></ul><ul><ul><ul><li>Use a password on all listeners </li></ul></ul></ul><ul><ul><ul><ul><li>At the lsnrctl prompt enter change_password </li></ul></ul></ul></ul>
  72. 73. Oracle NET / Net8 /SQL*NET Configuration <ul><li>Oracle Names </li></ul><ul><ul><li>Network service that provides centralized name resolution to Oracle clients and servers. </li></ul></ul><ul><ul><li>Consists of one or more administrative regions, each having a single installation of the Oracle Network Manager tool. </li></ul></ul><ul><ul><li>Oracle Network Manager enables the administrator to administer the following in it’s administrative region… </li></ul></ul><ul><ul><ul><li>All database listeners </li></ul></ul></ul><ul><ul><ul><li>Global database links </li></ul></ul></ul><ul><ul><ul><li>Clients, interchanges and Names Servers. </li></ul></ul></ul>
  73. 74. Oracle NET/ NET8 / SQL*Net Configuration <ul><li>Oracle Names (continued) </li></ul><ul><ul><li>Clients do not need a TNSNAMES.ORA file if an Oracle Names Server is used. </li></ul></ul><ul><ul><li>If a TNSNAMES.ORA file is created, the client may use it to resolve the service name before resolving it through the Names Server. </li></ul></ul><ul><ul><li>Clients have a SQLNET.ORA file that identifies Oracle Names Server. This file can reference a file on a server so that it doesn’t have to change if the Names Server changes. </li></ul></ul>
  74. 75. Oracle NET / NET8 /SQL*NET Configuration Names Server 3 Server 1 2 4 Client
  75. 76. Oracle NET/ NET8 /SQL*Net Audit checklist <ul><li>Listener password protected </li></ul><ul><li>Is ADMIN_RESTRICTION turned on </li></ul><ul><li>Is a protocol.ora in place for node checking </li></ul><ul><li>How is tnsnames protected </li></ul><ul><li>ONAMES is used, this adds an additional server to be audited </li></ul>
  76. 77. Oracle listener Audit checklist <ul><li>Set up the listener with password </li></ul><ul><li>Set up a strong password </li></ul><ul><li>Protect the listener .ora file (this is where the password is kept) </li></ul>
  77. 78. Patches Audit checklist Verify patches using the V$VERSION view Keep informed on the latest security patches Have a policy on how quickly a critical security patch should be applied Oracle rates severity of patches one is most severe
  78. 79. Patches Alerts ( Subscribe to security alerts  ) PDF Buffer Overflows in EXTPROC of Oracle Database Server Alert #57, Rev 2, 07August 2003 PDF Buffer Overflow Vulnerability in Oracle E-Business Suite Alert #56, Rev 1, 23 July 2003 PDF Unauthorized Disclosure of Information in Oracle E-Business Suite Alert #55, Rev 1, 23 July 2003 PDF Buffer Overflow in Net Services for Oracle Database Server Alert #54, Rev 2, 30 April 2003 PDF Report Review Agent Vulnerability in Oracle E-Business Suite Alert #53, Rev 1, 10 April 2003 PDF Two Security Vulnerabilities in Oracle9 i Application Server Alert #52, Rev 3, Updated 03 March 2003 PDF Buffer Overflow in ORACLE executable of Oracle9 i Database Server Alert #51, Rev 6, Updated 18 April 2003 PDF Buffer Overflow in Oracle9 i Database Server Alert #50, Rev 6, Updated 18 April 2003
  79. 80. Oracle's built-in tools USERS / SCHEMAS Security Domain Defines the security settings that Apply to the user Authentication Mechanism Database Operating system Network Privileges—Direct/Indirect (via roles)
  80. 81. Oracle's built-in tools USERS / Database SCHEMAS Authentication Mechanism Database – passwords are kept internally in a database table encrypted Operating system —Passwords are kept in the operating system
  81. 82. Oracle's tools to purchase <ul><li>Authentication Mechanism using </li></ul><ul><li>Oracle Advanced Security option </li></ul><ul><li>Network – Uses third party network authentication services (like Kerberos and SESAME) </li></ul><ul><li>Token Devices , one time passwords are used to authenticate </li></ul><ul><li>Biometrics Devices , use physical features of users to authenticate </li></ul><ul><li>Advanced Encryption Standard (AES) </li></ul><ul><ul><ul><ul><li>AES is symmetric block cipher </li></ul></ul></ul></ul><ul><ul><ul><ul><li>AES-128,AES-192 and AES-256 </li></ul></ul></ul></ul>
  82. 83. Oracle's built-in tools USERS / Database SCHEMAS Predefined users Sys/change_on_install (super user in Oracle,schema for Oracle dictionary tables) System/manager (Owner of internal tables used by Oracle tools) Scott/tiger (created by demo files, sometimes left in production) Note: 9i passwords are custom, unless you create the Database using the Database creation assistant in batch mode Additional users defined later in the Oracle9i section
  83. 84. Oracle's built-in tools Password File to authenticate DBAs A password file for DBAs is optional and can be setup using the ORAPWD password utility. The password file will restrict administration privilege to only the users who know the password and have been granted a special role. The roles are SYSDBA and SYSOPER.
  84. 85. Oracle's built-in tools Two special roles SYSOPER/SYSDBA SYSOPER Permits you to perform STARTUP, SHUTDOWN, ALTER DATABASE OPEN/MOUNT, ALTER DATABASE BACKUP, ARCHIVE LOG, and RECOVER, and includes the RESTRICTED SESSION privilege.  
  85. 86. Oracle's built-in tools SYSDBA Contains all system privileges with ADMIN OPTION, and the SYSOPER system privilege; CREATE DATABASE and time-based recovery. Listing Password File Members Audit view: V$PWFILE_USERS will show all users that have been granted SYSDBA and SYSOPER system privileges for a database.
  86. 87. Oracle's built-in tools ADMINISTERING PRIVILEGES Two types of privileges: System– Enables users to perform ADMIN type activities in the database OBJECT– Enables users to access and manipulate objects
  87. 88. Oracle's built-in tools SYSTEM PRIVILEGES Administering privileges System– 80 system privileges The ANY keyword means that the user has the privilege for any schema. The GRANT command is used to add a privilege to a user or group of users GRANT CREATE SESSION to smith; GRANT CREATE SESSION to smith with ADMIN OPTION; The REVOKE command deletes the privilege REVOKE CREATE SESSION to smith;
  88. 89. Oracle's built-in tools SYSTEM PRIVILEGES Administering privileges—Displaying System Privileges DATABASE LEVEL SESSION LEVEL DBA_SYS_PRIVS SESSION_PRIVS Grantee Privilege Privilege Admin option
  89. 90. Oracle's built-in tools OBJECT PRIVILEGES OBJECT SQL STATEMENT Allowed ALTER   ALTER object (table or sequence)   DELETE DELETE FROM object (table or view)   EXECUTE EXECUTE object (procedure or function). References to public package variables   INDEX CREATE INDEX ON object (tables only)   INSERT INSERT INTO object (table or view)   REFERENCES CREATE or ALTER TABLE statement defining a FOREIGN KEY integrity constraint on object (tables only)   SELECT   SELECT...FROM object (table, view, or snapshot). SQL statements using a sequence  
  90. 91. Oracle's built-in tools DISPLAYING OBJECT PRIVILEGES DBA_TAB_PRIVS DBA_COL_PRIVS Grantee Grantee Owner Owner Table_name Table_name Grantor Column_name Privilege Grantor grantable  Privilege Grantable
  91. 92. Oracle's built-in tools USERS / Database SCHEMAS Restriction privilege system by enabling O7_DICTIONARY_ACCESSIBILITY=FALSE This prevents users with the system ‘ANY’ from being able to execute against the SYS schema The default is TRUE This allows the user with the ‘ANY’ privilege to execute against the SYS schema
  92. 93. Oracle's built-in tools Administering privileges A role is a database entity that is a named group of privileges. It is unique within the database and not owned by a user. A role can be authenticated by a password. Special role SELECT_CATALOG_ROLE , which enable access to the data dictionary
  93. 94. Oracle's built-in tools Predefined roles ROLENAME DESCRIPTION ============================================== CONNECT Provided for backward RESOURCE compatibility DBA All systems privileges w/admin EXP_FULL_DATABASE Privileges to export the DB IMP_FULL_DATABASE Privileges to Import the DB DELETE_CATALOG_ROLE Delete privileges on dictionary EXECUTE_CATALOG_ROLE Execute privilege on dictionary SELECT_CATALOG_ROLE Select privilege dictionary tables PUBLIC Role that all users have
  94. 95. Oracle's built-in tools Displaying information on roles DATABASE ROLE VIEW DESCRIPTION DBA_ROLES All roles which exist in the DB DBA_ROLE_PRIVS Roles granted to users and roles ROLE_ROLE_PRIVS Roles which are granted to roles DBA_SYS_PRIVS System privileges grated to users and roles ROLE_SYS_PRIVS System privileges granted to roles ROLE_TAB_PRIVS Table privileges granted to roles SESSION_ROLES Roles which the user currently has enabled
  95. 96. Oracle's built-in tools PROFILES used for password management <ul><li>A PROFILE is a named set of limits for passwords and system resources </li></ul><ul><li>Are assigned to users </li></ul><ul><li>Can become the default for all users </li></ul><ul><li>Can be enabled or disabled </li></ul>
  96. 97. Oracle's built-in tools PROFILES <ul><li>A PROFILE is a named set of limits for passwords </li></ul><ul><li>And system resources </li></ul><ul><li>CPU time </li></ul><ul><li>I/O operations </li></ul><ul><li>IDLE time (inactive time measured in minutes) </li></ul><ul><li>Connect time (measured in minutes) </li></ul><ul><li>Memory space </li></ul><ul><li>Concurrent sessions </li></ul><ul><li>Passwords aging and expiration </li></ul><ul><li>Password history </li></ul><ul><li>Password complexity verification </li></ul><ul><li>Account locking </li></ul>
  97. 98. Oracle's built-in tools PROFILES management Create a profile CREATE PROFILE end_user_prof LIMIT SESSIONS_PER_USER 1 IDLE_TIME 60 CONNECT TIME 600; Modify a profile ALTER PROFILE end_user_prof limit IDLE_TIME 10; Remove a profile DROP PROFILE end_user_prof; DROP PROFILE end_user_prof CASCADE;
  98. 99. Oracle's built-in tools PROFILES management <ul><li>Associate a user to a profile </li></ul><ul><li>ALTER USER smith </li></ul><ul><li>PROFILE end_user_prof; </li></ul><ul><li>Resource limits must be enable to enforce profile limits, </li></ul><ul><li>This does not include password management. </li></ul><ul><li>Two ways to enable : </li></ul><ul><li>ALTER SYSTEM SET RESOURCE_LIMIT=TRUE </li></ul><ul><li>1. Modify the init.ora file and set RESOURCE_LIMIT=TRUE, </li></ul><ul><li>2. Restart the instance </li></ul>
  99. 100. Oracle's built-in tools PROFILES displaying resource limits DBA_USERS Profile username DBA_PROFILES Profile Resource_name Resource_type Limit Join the views DBA_USERS and DBA_PROFILES To display the resource limits
  100. 101. Oracle's built-in tools PASSWORD MANAGEMENT PARAMETER DESCRIPTION FAILED_LOGIN_ATTEMPTS Number of failed login attempts before lockout PASSWORD_LOCK_TIME Number of days password will remain locked upon password expiring PASSWORD_LIFE_TIME Lifetime of password measured in days PASSWORD_GRACE_TIME Grace period in days for changing the password, after it has expired
  101. 102. Oracle's built-in tools PASSWORD MANAGEMENT PARAMETER DESCRIPTION PASSWORD_REUSE_TIME Number of days before a password can be reused PASSWORD_REUSE_MAX Maximum number of times a password can be reused PASSWORD_VERIFY_FUNCTION PL/SQL package that makes a complexity check before a password is assigned Note: The script utlpwdmg.sql must be run in the SYS schema to enable
  102. 103. Oracle's built-in tools PASSWORD MANAGEMENT <ul><li>VERIFY_FUNCTION </li></ul><ul><li>Minimum length of four characters </li></ul><ul><li>Password not equal to user name </li></ul><ul><li>Password must have at least one alpha, numeric,special character </li></ul><ul><li>Password must differ from the last password by three characters </li></ul>
  104. 105. Oracle's built-in tools Displaying PROFILES information DBA_PROFILES Profile Resource_name Resource_type =PASSWORD limit
  105. 106. Auditing the Database <ul><li>Audit a specific user </li></ul><ul><li>Audit for a specific statement </li></ul><ul><li>Audit for a specific statement on a schema user </li></ul><ul><li>Audit to know what happens on your database </li></ul><ul><li>Audit failed logon attempts </li></ul><ul><li>Audit to know who changed what and when </li></ul>
  106. 107. Auditing the Database <ul><li>Audit by session or access </li></ul><ul><li>Audit by successful or not successful status </li></ul><ul><li>Audit with discretion </li></ul><ul><li>Audit actions: </li></ul><ul><li>Alter, audit,comment,create,delete,execute, grant,index,insert,lock,read,reference,rename,select,update,write </li></ul>
  107. 108. Auditing the Database syntax <ul><li>AUDIT { statement|system_priv} </li></ul><ul><ul><li>BY user </li></ul></ul><ul><ul><li>BY SESSION|ACCESS </li></ul></ul><ul><ul><li>WHENEVER {NOT} SUCCESSFUL; </li></ul></ul><ul><ul><li>NOTE: </li></ul></ul><ul><ul><li>BY SESSION will create only one audit record </li></ul></ul><ul><ul><li>Per session </li></ul></ul><ul><ul><li>BY ACCESS will create a record for each auditable activity </li></ul></ul>
  108. 109. Auditing the Database(cont) <ul><li>Audit to know what happens on your database </li></ul><ul><ul><li>High level of unsuccessful logins </li></ul></ul><ul><ul><li>Audit through the middle tier </li></ul></ul><ul><ul><li>Audit the user statement </li></ul></ul><ul><ul><li>Audit the audit table </li></ul></ul>
  109. 110. Auditing the Database connect internal (Oracle8i) <ul><ul><li>NT Systems :  On NT Systems you can see auditing for INTERNAL in the event viewer. The INTERNAL connections are written to the operating system audit trail . </li></ul></ul><ul><ul><li>  Unix Systems :  On Unix Systems the INTERNAL connections are logged to special log files stored in the $Oracle_HOME/rdbms/audit directory. </li></ul></ul>
  110. 111. Auditing the Database SYSDBA/SYSOPER <ul><ul><li>Initialization parameter </li></ul></ul><ul><ul><li>AUDIT_SYS_OPERATIONS=TRUE </li></ul></ul><ul><ul><li>Will write all activities to an O/S audit log </li></ul></ul>
  111. 112. Auditing the Database(cont) <ul><li>TIPS on auditing </li></ul><ul><ul><li>Run reports on a daily basis </li></ul></ul><ul><ul><li>Truncate the audit table on a daily basis </li></ul></ul><ul><ul><li>Use whenever not successful option (whenever you can) </li></ul></ul><ul><ul><li>Use the by session clause </li></ul></ul><ul><ul><li>Auditing is now optimized (statements are parsed once for execution and audit </li></ul></ul><ul><ul><li>Set default audit options </li></ul></ul><ul><ul><li>May need to create an alarm facility </li></ul></ul>
  112. 113. Auditing the Database(cont) <ul><li>TIPS on auditing </li></ul><ul><ul><li>Oracle preserves the identify of the user on the middle tier and can capture the user id of who logged into the database via the TP monitor </li></ul></ul><ul><ul><ul><li>This means that oracle can audit the true user who initiated the transaction and the user who logged into the database (TP monitor) </li></ul></ul></ul><ul><ul><ul><li>Protect the audit trail </li></ul></ul></ul><ul><ul><ul><li>AUDIT delete ON sys.aud$ BY ACCESS </li></ul></ul></ul><ul><ul><ul><li>Only the DBA or SECURITY personnel should </li></ul></ul></ul><ul><ul><ul><li>Have the DELETE_CATALOG_ROLE </li></ul></ul></ul>
  113. 114. Auditing the Database Views to the AUDIT Table <ul><li>ALL_DEF_AUDIT_OPTS </li></ul><ul><li>AUDIT_ACTIONS </li></ul><ul><li>DBA_AUDIT_EXISTS </li></ul><ul><li>DBA_AUDIT_OBJECT </li></ul><ul><li>DBA_AUDIT_SESSION </li></ul><ul><li>DBA_AUDIT_STATEMENT </li></ul><ul><li>DBA_AUDIT_TRAIL </li></ul><ul><li>DBA_OBJ_AUDIT_OPTS </li></ul><ul><li>DBA_PRIV_AUDIT_OPTS </li></ul><ul><li>DBA_STMT_AUDIT_OPTS </li></ul>
  114. 115. Audit/Security Approach <ul><li>Account Security </li></ul><ul><li>Object Privileges </li></ul><ul><li>System Level Roles and Privileges </li></ul>
  115. 116. <ul><li>Create User </li></ul><ul><ul><li>Username </li></ul></ul><ul><ul><li>Password </li></ul></ul><ul><ul><li>Default Tablespace </li></ul></ul><ul><ul><li>Temporary Tablespace </li></ul></ul><ul><ul><li>Quota (on Tablespaces) </li></ul></ul><ul><ul><li>Profile </li></ul></ul><ul><ul><li>Assigns a profile to the user, if none is specified, then the default profile is used. Profiles are used to restrict the usage of system resources and to enforce password management rules. The default is set to UNLIMITED resource consumption </li></ul></ul>Audit/Security Approach
  116. 117. Audit/Security Approach <ul><li>System Level Privileges </li></ul><ul><ul><li>ANY and PUBLIC are not synonymous. A PUBLIC object is accessible to all users in a database; all other objects are privately owned. The ANY option allows you to create private objects in other users’ schemas </li></ul></ul><ul><ul><li>There are eight system level roles provided with Oracle </li></ul></ul><ul><ul><ul><li>Connect EXP_FULL_DATABASE </li></ul></ul></ul><ul><ul><ul><li>Resource Select_Catalog_Role </li></ul></ul></ul><ul><ul><ul><li>DBA Execute_Catalog_Role </li></ul></ul></ul><ul><ul><ul><li>IMP_FULL_DATABASE Delete_Catalog_Role </li></ul></ul></ul>
  117. 118. Audit/Security Approach <ul><li>User Profile </li></ul><ul><ul><li>SESSION_PER_USER </li></ul></ul><ul><ul><li>CPU_PER_SESSION </li></ul></ul><ul><ul><li>CPU_PER_CALL </li></ul></ul><ul><ul><li>CONNECT_TIME </li></ul></ul><ul><ul><li>IDLE_TIME </li></ul></ul><ul><ul><li>LOGICAL_READS_PER_SESSION </li></ul></ul><ul><ul><li>LOGICAL_READS_PER_CALL </li></ul></ul><ul><ul><li>PRIVATE_SGA </li></ul></ul><ul><ul><li>COMPOSITE_LIMIT </li></ul></ul><ul><ul><li>FAILED_LOGIN_ATTEMPTS </li></ul></ul><ul><ul><li>PASSWORD_LIFE_TIME </li></ul></ul><ul><ul><li>PASSWORD_REUSE_TIME </li></ul></ul><ul><ul><li>PASSWORD_REUSE_MAX </li></ul></ul><ul><ul><li>PASSWORD_LOCK-TIME </li></ul></ul><ul><ul><li>PASSWORD_GRACE_TIME </li></ul></ul><ul><ul><li>PASSWORD_VERIFY_FUNCTION </li></ul></ul>
  118. 119. Audit/Security Approach <ul><li>Object Level Privileges </li></ul><ul><ul><li>Grants </li></ul></ul><ul><ul><li>Grant with grant option </li></ul></ul><ul><ul><li>Privileges </li></ul></ul><ul><ul><ul><li>SELECT </li></ul></ul></ul><ul><ul><ul><li>INSERT </li></ul></ul></ul><ul><ul><ul><li>UPDATE </li></ul></ul></ul><ul><ul><ul><li>DELETE </li></ul></ul></ul><ul><ul><ul><li>ALTER </li></ul></ul></ul><ul><ul><ul><li>INDEX </li></ul></ul></ul><ul><ul><ul><li>REFERENCES </li></ul></ul></ul><ul><ul><ul><li>EXECUTE </li></ul></ul></ul><ul><ul><ul><li>READ </li></ul></ul></ul>
  119. 120. Audit/Security Approach <ul><li>Dictionary Views </li></ul><ul><ul><li>DBA_ROLES Names of roles and their password status </li></ul></ul><ul><ul><li>DBA_ROLE_PRIVS Users who have been granted roles </li></ul></ul><ul><ul><li>DBA_SYS_PRIVS Users who have been granted system privileges </li></ul></ul><ul><ul><li>DBA_TAB_PRIVS Users who have been granted privileges on tables </li></ul></ul><ul><ul><li>DBA_COL_PRIVS Users who have been granted privileges on columns </li></ul></ul><ul><ul><li>ROLE_ROLE_PRIVS Roles that have been granted to other roles </li></ul></ul><ul><ul><li>ROLE_SYS_PRIVS System privileges that have been granted to roles </li></ul></ul><ul><ul><li>ROLE_TAB_PRIVS Table privileges that have been granted to roles </li></ul></ul>
  120. 121. Audit/Security Approach <ul><li>Password Security During Logins </li></ul><ul><ul><li>When you connect to a database server from a client machine, or from one database to another via a database link, Oracle transmits the password you enter in an unencrypted format unless you specify otherwise. As of Oracle8, you can set parameters that forces Oracle to encrypt the password values prior to transmitting them. </li></ul></ul><ul><ul><li>To enable password encryption, set the following parameters: </li></ul></ul><ul><ul><ul><li>On the client set the ORA_ENCRYPT_LOGIN parameter in your sqlnet.ora file to TRUE </li></ul></ul></ul><ul><ul><ul><li>On the server set the DBLINK_ENCRYPT_LOGIN parameter in your init.ora file to TRUE </li></ul></ul></ul><ul><ul><ul><li>Shut down and restart the database </li></ul></ul></ul>
  121. 122. <ul><li>Password </li></ul><ul><ul><li>Password specified for a user account or a role are stored in an encrypted version in the data dictionary </li></ul></ul><ul><ul><li>Setting the same password for two different accounts will result in different encryption </li></ul></ul><ul><ul><li>For all passwords, the encrypted value is 16 characters long and contains numbers and capital letters. </li></ul></ul><ul><ul><li>When a password is entered during a user validation, that password is encrypted, and the encryption that is generated is compared to the one in the data dictionary for that account, if they match, then the password is correct and the authorization succeeds. </li></ul></ul>Audit/Security Approach
  122. 123. Audit/Security Approach <ul><li>Passwords </li></ul><ul><ul><li>Knowing how the database stores passwords is important because it adds new options to account security. </li></ul></ul><ul><ul><li>To query the Username and Password fields from DBA_USERS </li></ul></ul><ul><ul><ul><li>select </li></ul></ul></ul><ul><ul><ul><ul><li>Username, /*Username*/ </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Password */Encrypted password*/ </li></ul></ul></ul></ul><ul><ul><ul><ul><li>from DBA_USERS </li></ul></ul></ul></ul><ul><ul><ul><ul><li>where Username is (‘Lyons’) </li></ul></ul></ul></ul>
  123. 124. Audit/Security Approach <ul><li>Becoming Another User </li></ul><ul><ul><li>Since the encrypted password can be set, you can temporarily take over any account and then set it back to its original password without ever knowing the account’s password. This capability allows you to become another user </li></ul></ul><ul><ul><li>Query DBA_USERS to determine the current encrypted password to the account </li></ul></ul><ul><ul><li>Generate the alter user command that will be needed to reset the encrypted password to its current value after you are done </li></ul></ul><ul><ul><li>Spool the alter user command to a file </li></ul></ul><ul><ul><li>Change the user’s password </li></ul></ul><ul><ul><li>Access the user’s account </li></ul></ul><ul><ul><li>Run the file containing the alter user command to reset the user’s encrypted password to its original value. </li></ul></ul>
  124. 125. Database <ul><li>Determine Permission Levels </li></ul><ul><ul><li>Do not give direct table level permissions to an end user </li></ul></ul><ul><ul><ul><li>No - Select (Query from “Hell”), Update, Insert, Delete </li></ul></ul></ul><ul><ul><li>Instead, use stored procedures </li></ul></ul><ul><ul><li>Better yet, do not let user know how to sign on to the database application </li></ul></ul><ul><ul><ul><li>Authenticate the user and then supply a new password that they do not even know about. In this way the user must first authenticate to the application and cannot go around this authentication process to access the database </li></ul></ul></ul>
  125. 126. Privileges and Roles <ul><li>Access to an object owned by another account </li></ul><ul><li>Privilege must have been granted </li></ul><ul><li>Privileges such as insert, select, update, and delete </li></ul><ul><li>Privileges can be granted to users, groups, roles, or to Public </li></ul><ul><li>Roles are groups of privileges </li></ul><ul><li>Use roles to grant system level privileges such as create table </li></ul>
  126. 127. Role Definitions <ul><li>System Level Roles </li></ul><ul><ul><li>Connect </li></ul></ul><ul><ul><li>Resource </li></ul></ul><ul><ul><li>DBA </li></ul></ul><ul><li>User Defined System Level Roles </li></ul>
  127. 128. Role Definitions <ul><li>Connect Role </li></ul><ul><ul><li>Gives users privileges beyond just creating sessions in the database. In addition to the Create Session system privilege, the Connect role gives the users the following system privileges </li></ul></ul><ul><ul><ul><li>Alter Session </li></ul></ul></ul><ul><ul><ul><li>Create Cluster </li></ul></ul></ul><ul><ul><ul><li>Create Database Link </li></ul></ul></ul><ul><ul><ul><li>Create Sequence </li></ul></ul></ul><ul><ul><ul><li>Create Synonym </li></ul></ul></ul><ul><ul><ul><li>Create Table </li></ul></ul></ul><ul><ul><ul><li>Create View </li></ul></ul></ul>
  128. 129. Role Definitions <ul><li>Resource Role </li></ul><ul><ul><li>The resource role has the following system privileges </li></ul></ul><ul><ul><ul><li>Create Cluster </li></ul></ul></ul><ul><ul><ul><li>Create Index </li></ul></ul></ul><ul><ul><ul><li>Create Procedure </li></ul></ul></ul><ul><ul><ul><li>Create Sequence </li></ul></ul></ul><ul><ul><ul><li>Create Table </li></ul></ul></ul><ul><ul><ul><li>Create Trigger </li></ul></ul></ul><ul><ul><ul><li>Create Type </li></ul></ul></ul>
  129. 130. Role Definitions <ul><li>DBA Role </li></ul><ul><ul><li>The DBA role has all system privileges with admin option, which means that the DBA can grant the system privileges to any other user </li></ul></ul>
  130. 131. Auditing <ul><li>The database has the ability to audit all actions that take place within it. Audit records may be written to either the SYS.AUD$ or the operating system’s audit trail. The ability to use the operating system’s audit trail is operating system-dependent </li></ul><ul><li>Three different types of actions may be audited: </li></ul><ul><li>Login attempts, Object accesses and Database actions </li></ul><ul><li>The database’s default functionality is to record both successful and unsuccessful commands </li></ul><ul><li>To enable auditing in a database, the init.ora file for the database must contain an entry for the AUDIT_TRAIL parameter. </li></ul>
  131. 132. Auditing <ul><li>The AUDIT_TRAIL values are: </li></ul><ul><ul><ul><li>NONE - Disable auditing </li></ul></ul></ul><ul><ul><ul><li>DB - Enables auditing, writing to the SYS.AUD$ table </li></ul></ul></ul><ul><ul><ul><li>OS - Enables auditing, writing to the operating system’s audit trails </li></ul></ul></ul>
  132. 133. Auditing <ul><li>Audit command </li></ul><ul><ul><li>Can be issued regardless of the setting of the AUDIT_TRAIL parameter. They will not be activated unless the database is started using an init.ora AUDIT_TRAIL value that enables auditing </li></ul></ul><ul><ul><li>If you elect to store the audit records in the SYS.AUD$ table, then that table’s records should be periodically archived and the table should then be truncated. Since it is the data dictionary, this table is in the SYSTEM tablespace and may cause space problems if its records are not periodically cleaned out. You can grant DELETE_CATLOG_ROLE to a user to give the user the ability to delete from the SYS.AUD$ table. </li></ul></ul><ul><ul><li>Every attempt to connect to the database can be audited. The command to begin auditing of login attempts is: </li></ul></ul><ul><ul><ul><li>audit session </li></ul></ul></ul><ul><ul><ul><li>audit session whenever successful </li></ul></ul></ul><ul><ul><ul><li>audit session whenever not successful </li></ul></ul></ul>
  133. 134. <ul><li>Establish minimum audit standards </li></ul><ul><ul><li>Login/Logoffs </li></ul></ul><ul><ul><ul><li>Adding of New Users </li></ul></ul></ul><ul><ul><ul><li>Adding Users to Groups </li></ul></ul></ul><ul><ul><ul><li>All Grants and Revokes </li></ul></ul></ul><ul><li>Remember that auditing takes up much storage and processing time </li></ul><ul><li>Audit Features </li></ul>
  134. 135. Trace Files <ul><li>Each of the background processes running in an instance has a trace file associated with it. </li></ul><ul><li>The trace file will contain information about significant events encountered by the background process </li></ul><ul><li>In addition, Oracle maintains a file called the alert log </li></ul><ul><li>The alert log records the commands and command results of major events. This includes, tablespace creations, redo log switches, recovery operations, and database startups </li></ul>
  135. 136. Alert Log <ul><li>The alert log is a vital source of information for day-to-day operations </li></ul><ul><li>Trace files are most useful when attempting to discover the cause of a major failure. </li></ul>
  136. 137. Database Constraints <ul><li>A table can have constraints placed upon it </li></ul><ul><li>A constraint is applied to a table and every row in the table must satisfy the conditions specified in the constraint definition </li></ul>
  137. 138. Database <ul><li>DBMS Journal Redo Logs </li></ul><ul><li>SVRMGR program for Database Administration tasks </li></ul><ul><ul><ul><li>Performs backup of the redo logs </li></ul></ul></ul><ul><li>SQL COMMIT statements </li></ul><ul><ul><ul><li>Used by application programs </li></ul></ul></ul><ul><li>Backup is on-line </li></ul>
  138. 139. Backup/Recovery <ul><li>Backup and Recovery Options </li></ul><ul><li>Export/Import </li></ul><ul><li>Offline Backups </li></ul><ul><li>Online Backups </li></ul>
  139. 140. Users <ul><li>A user account is not a physical structure in the database </li></ul><ul><li>Users own the database objects </li></ul><ul><li>The user SYS owns the data dictionary tables </li></ul><ul><li>The user SYSTEM owns views that access the data dictionary tables for use by the rest of the users in the database </li></ul>
  140. 141. Users <ul><li>User accounts can be connected to an operating system </li></ul><ul><li>This allows the user to enter only one password to obtain access to the operating system and the database </li></ul>
  141. 142. Database <ul><li>Responsibility for the Security Officer </li></ul><ul><ul><li>Should Perform: </li></ul></ul><ul><ul><ul><li>All Grants and Revokes </li></ul></ul></ul><ul><ul><ul><li>Review Security and Audit Logs </li></ul></ul></ul><ul><ul><ul><li>Maintain a copy of Audit Logs for the Auditors </li></ul></ul></ul>
  142. 143. Exposures <ul><li>Clear text transmission over the network </li></ul><ul><li>Connect ID and Access ID for application </li></ul><ul><li>Direct connection to the database from the desktop </li></ul>
  143. 144. Securing the SQL* Plus Tool <ul><li>PRODUCT_PROFILE table to provide product-level </li></ul><ul><li>  </li></ul><ul><li>Security for oracle products and augment user-level  Security </li></ul><ul><li>With this table, you can enforce security on a per-user basis and restrict certain SQL and SQL*plus commands. </li></ul>
  144. 145. Securing the SQL* Plus Tool <ul><li>  SQL*plus commands: </li></ul><ul><li>EDIT EXECUTE EXIT GET HOST (or your operating system’s alias for HOST, such as $ on VMS and ! on UNIX) </li></ul><ul><li>QUIT RUN SAVE SET (Spool start </li></ul><ul><li>  </li></ul><ul><li>SQL commands: </li></ul><ul><li>Alter analyze audit connect create delete </li></ul><ul><li>Drop grant insert lock NOAUDIT rename revoke </li></ul><ul><li>Select set role set transaction truncate update </li></ul><ul><li>  </li></ul>
  145. 146. Securing the SQL* Plus Tool Recommended commands to restrict <ul><li>C ommands reason </li></ul><ul><li>  </li></ul><ul><li>HOST allows user access to a operating-system prompt </li></ul><ul><li>  </li></ul><ul><li>SET ROLE allows a user to set a new security role </li></ul><ul><li>  </li></ul><ul><li>GRANT allows a user to grant privileges </li></ul><ul><li>  </li></ul><ul><li>NOAUDIT allows a user to turn off auditing </li></ul><ul><li>  </li></ul><ul><li>You should restrict access to the PRODUCT_PROFILE </li></ul>
  146. 147. Oracle Security Checklist <ul><ul><li>Revoke unnecessary privileges from PUBLIC ROLE </li></ul></ul><ul><ul><ul><li>Revoke all unnecessary privileges and roles from the database server </li></ul></ul></ul><ul><ul><ul><li>PUBLIC is the default role granted to every user </li></ul></ul></ul><ul><ul><li>Privileges include EXECUTE on various powerful packages that may potentially be misused include: </li></ul></ul><ul><ul><li> UTL_SMTP </li></ul></ul><ul><ul><ul><li>This package permits arbitrary mail messages to be sent from one arbitrary user to another arbitrary user. </li></ul></ul></ul>
  147. 148. Oracle Security Checklist <ul><ul><li>Revoke unnecessary privileges from PUBLIC ROLE </li></ul></ul><ul><ul><ul><li>UTL_TCP </li></ul></ul></ul><ul><ul><ul><li>This package permits outgoing network connections to be established by the database server to any receiving (or waiting) network service. </li></ul></ul></ul><ul><ul><ul><li>UTL_HTTP </li></ul></ul></ul><ul><ul><ul><li>This package allows the database server to request and retrieve data via HTTP. Granting this package to PUBLIC may permit data to be sent via HTML forms to a malicious web site. </li></ul></ul></ul>
  148. 149. Oracle Security Checklist <ul><ul><li>Revoke unnecessary privileges from PUBLIC ROLE </li></ul></ul><ul><ul><ul><li>UTL_FILE </li></ul></ul></ul><ul><ul><ul><li>If configured improperly, this package allows text level access to any file on the host operating system. Even when properly configured, this package does not distinguish between its calling applications with the result that one application with access to UTL_FILE may write arbitrary data into the same location that is written to by another application. </li></ul></ul></ul>
  149. 150. Oracle Security Checklist <ul><ul><li>Revoke unnecessary privileges from PUBLIC ROLE </li></ul></ul><ul><ul><li>DBMS_RANDOM </li></ul></ul><ul><ul><ul><li>Is used to encrypt stored data. </li></ul></ul></ul><ul><ul><ul><li>encrypted data may be non-recoverable if the keys are not securely generated </li></ul></ul></ul><ul><ul><ul><li>Do not assign “all permissions” to any database server run-time facility </li></ul></ul></ul><ul><ul><ul><li>Oracle Java Virtual Machine (OJVM) </li></ul></ul></ul><ul><ul><ul><li>Grant specific permissions to the explicit document root file paths for such facilities that may execute files and packages outside the database server. </li></ul></ul></ul><ul><ul><ul><ul><li>call dbms_java.grant_permission('SCOTT', '','<<ALL FILES>>','read'); </li></ul></ul></ul></ul>
  150. 151. Oracle Security Checklist <ul><ul><li>Authenticate clients properly </li></ul></ul><ul><ul><ul><li>Remote authentication is a security feature provided by Oracle 9i such that if turned on (TRUE), it defers authentication of users to the remote client connecting to an Oracle database. </li></ul></ul></ul><ul><ul><ul><li>configuration parameter in the following manner: REMOTE_OS_AUTHENT = FALSE will be more secure </li></ul></ul></ul><ul><ul><ul><li>RESTRICT NETWORK ACCESS </li></ul></ul></ul><ul><ul><ul><ul><li>Utilize a firewall </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Keep the database server behind a firewall. Oracle 9 i’ s network infrastructure, Oracle Net (formerly known as Net8 and </li></ul></ul></ul></ul><ul><ul><ul><ul><li>SQL*Net), offers support for a variety of firewalls from various vendors. Supported proxy-enabled firewalls </li></ul></ul></ul></ul>
  151. 152. Oracle Tools <ul><li>Virtual Private Database/label security </li></ul><ul><ul><li>Attach security policies at the Table or View level, allows for easy integration to existing systems. </li></ul></ul><ul><ul><li>One to many policies per Table. </li></ul></ul><ul><ul><li>Different policies for different type of accesses (SELECT,UPDATE..). </li></ul></ul>
  152. 153. Oracle Security Checklist <ul><li>Virtual Private Database using application contexts. </li></ul><ul><ul><li>User-definable can allow security based on categories (Employee number, Cost Center). These contexts are used in the security policy function. </li></ul></ul><ul><ul><li>Access to session primitives (information about a user session) using USERENV application context </li></ul></ul>
  153. 154. Oracle Tools <ul><ul><li>Oracle Enterprise Manger </li></ul></ul><ul><ul><ul><li>Security Manager </li></ul></ul></ul><ul><ul><ul><li>Application Security, Inc </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><ul><li>APPLICATION VULNERABILITY ASSESSMENT </li></ul></ul></ul><ul><ul><ul><li>AppDetective ™ Network-based vulnerability assessment tool that rates the security strength of applications within your network. Armed with a revolutionary security methodology together with an extensive knowledgebase of application vulnerabilities, AppDetective™ will locate, examine, report, and help fix your security holes and miss-configurations at your command . </li></ul></ul></ul>
  154. 155. Oracle Tools <ul><ul><li>DATABASE ENCRYPTION </li></ul></ul><ul><ul><ul><li>DbEncrypt ™ Easy-to-use, affordable, and effective security solution for encrypting column and row data within the database. Provided with DbEncrypt™ are encryption algorithms, templates, and an intuitive point-and-click interface. </li></ul></ul></ul><ul><ul><ul><li>APPLICATION INTRUSION DETECTION </li></ul></ul></ul><ul><ul><ul><li>AppRadar ™ Intrusion detection solution strictly for application-specific attacks and malicious behavior. As a complementary solution to existing intrusion detection systems, AppRadar™ empowers organizations with a real-time security solution able to thwart attacks and malicious behavior against all of your mission-critical enterprise applications. </li></ul></ul></ul>
  155. 156. Oracle Security checklist <ul><li>Important web sites </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul>
  156. 157. Summary <ul><ul><li>Oracle was built to be secure </li></ul></ul><ul><ul><li>Audit at the database, network, and server level </li></ul></ul><ul><ul><li>Takes time and is complex </li></ul></ul><ul><ul><li>Limited tools available </li></ul></ul><ul><ul><li>Requires outages for patches </li></ul></ul>
  157. 158. Checklist Predefined Users <ul><li>USERNAME ACCOUNT_STATUS </li></ul><ul><li>JONES EXPIRED & LOCKED </li></ul><ul><li>LBACSYS EXPIRED & LOCKED </li></ul><ul><li>MDSYS EXPIRED & LOCKED </li></ul><ul><li>OE EXPIRED & LOCKED </li></ul>
  158. 159. Checklist Predefined Users <ul><li>USERNAME ACCOUNT_STATUS </li></ul><ul><li>OLAPDBA EXPIRED & LOCKED </li></ul><ul><li>OLAPSVR EXPIRED & LOCKED </li></ul><ul><li>OLAPSYS EXPIRED & LOCKED </li></ul><ul><li>ORDPLUGINS EXPIRED & LOCKED </li></ul><ul><li>ORDSYS EXPIRED & LOCKED </li></ul><ul><li>OSE$HTTP$ADMIN OPEN </li></ul><ul><li>OUTLN OPEN </li></ul>
  159. 160. Checklist Predefined Users <ul><li>USERNAME ACCOUNT_STATUS </li></ul><ul><li>PM EXPIRED & LOCKED </li></ul><ul><li>QS EXPIRED & LOCKED </li></ul><ul><li>QS_ADM EXPIRED & LOCKED </li></ul><ul><li>QS_CB EXPIRED & LOCKED </li></ul><ul><li>QS_CBADM EXPIRED & LOCKED </li></ul><ul><li>QS_CS EXPIRED & LOCKED </li></ul><ul><li>QS_ES EXPIRED & LOCKED </li></ul><ul><li>QS_OS EXPIRED & LOCKED </li></ul><ul><li>QS_WS EXPIRED & LOCKED </li></ul><ul><li>SCOTT OPEN </li></ul><ul><li>SH EXPIRED & LOCKED </li></ul><ul><li>SYS OPEN </li></ul><ul><li>SYSTEM OPEN </li></ul>
  160. 161. Checklist Predefined Users <ul><li>USERNAME ACCOUNT_STATUS </li></ul><ul><li>ADAMS EXPIRED & LOCKED </li></ul><ul><li>AURORA$JIS$UTILITY$ OPEN </li></ul><ul><li>AURORA$ORB$UNAUTHENTICATED OPEN </li></ul><ul><li>BLAKE EXPIRED & LOCKED </li></ul><ul><li>CLARK EXPIRED & LOCKED </li></ul><ul><li>CTXSYS EXPIRED & LOCKED </li></ul><ul><li>DBSNMP OPEN </li></ul><ul><li>HR EXPIRED & LOCKED </li></ul>