Unit 4.1-2 Database Administration
Unit 4.1-2 Database Administration
These profiles allow database administrators to enforce security policies, manage resource usage,
and customize user sessions. Some common features and settings controlled by user profiles
include:
•Password policies: Enforcing password complexity rules, expiration periods, and locking
mechanisms to enhance security.
•Resource limits: Setting constraints on CPU usage, memory consumption, and other system
resources to prevent abuse or excessive usage by users.
Database administrators can ensure that users adhere to security policies, optimize resource
utilization, and maintain the integrity and availability of the database system by defining and
assigning appropriate user profiles .
In Oracle Database, Non-CDB profiles doesn't begin with C## where as in CDB profiles
name requires following naming convention.
•The name of a common profile must begin with characters that are a case-insensitive
match to the prefix specified by the COMMON_USER_PREFIX initialization parameter. By
default, the prefix is C##.
•The name of a local profile must not begin with characters that are a case-insensitive
match to the prefix specified by the COMMON_USER_PREFIX initialization parameter.
Regardless of the value of COMMON_USER_PREFIX, the name of a local profile can never begin with
C## or c##.
Resource parameters are assign to profile to limit access on database resources by users which are assigned with that
profile.
9. COMPOSIT LIMIT : Specify the total resource cost for a session, expressed in service units.
Oracle Database calculates the total service units as a weighted sum of
CPU_PER_SESSION, CONNECT_TIME, LOGICAL_READS_PER_SESSION, and PRIVATE_SGA.
All the password parameters except FAILED_LOGIN_ATTEMPTS and PASSWORD_REUSE_MAX—are interpreted in number of
days. The maximum value is 24855 days. For FAILED_LOGIN_ATTEMPTS and PASSWORD_REUSE_MAX, you must specify an
integer.
Password parameters are assign to profile to limit access on database by users which are assigned with that profile based on
password parameters clauses as below
Example
SQL> create profile bmcpdb_profile limit
SESSIONS_PER_USER UNLIMITED
PASSWORD_REUSE_MAX 10
CPU_PER_SESSION UNLIMITED
PASSWORD_REUSE_TIME 40
PRIVATE_SGA 15K
PASSWORD_LOCK_TIME 1/24
FAILED_LOGIN_ATTEMPTS 5;
Database Auditing:
• Overview of Database Security,
• Overview of Database Auditing,
• Security Compliance,
• Standard Auditing,
• Unified Audit Trail,
• Separation of Audit Responsibilities with The AUDIT_ADMIN And
AUDIT_VIEWER Roles,
• Configure the Audit Trail,
• Specify Audit Options.
What is
database Security? Why?
Database security refers to controls and measures along with the range of tools, designed to establish and preserve
database confidentiality, integrity and availability. Confidentiality is the element that's compromised in most data breaches.
Database security, in general involves user authentication, access control, monitoring and encryptions. Some of the aspect
taken into consideration while ensuring database security as follows
Database Access Methods like (Oracle data vault, Virtual Private Database (VPD), Oracle Label Security (OLS))
Encryptions (Network Encryption, Transparent Data Encryption eg individual tablespace or table columns (AES)
Data access monitoring. ( Database Auditing by configuring unified audit policy or fine-grained auditing or Oracle
The ora_stig_profile user profile is designed for Security Technical Implementation Guide
compliance.
The ora_stig_profile user profile addresses STIG requirements such as the need for a password
complexity function, maximum failed login attempts, reuse time, and other requirements. The definition
for this profile is as follows:
CREATE PROFILE ora_stig_profile
password_life_time 60
password_grace_time 5
password_reuse_time 365
password_reuse_max 10
failed_login_attempts 3
password_lock_time unlimited
inactive_account_time 35
idle_time 15
password_verify_function ora12c_stig_verify_function;
What is Auditing?
An audit , in oracle database, is a process of investigation or review of various aspects of database activity, along with
monitoring of an accounts by system to ensure security, consistency, reliability and integrity of data in database. It is
done to ascertain activities within database by both database users and application user (Non-database) users.
Users who are recognized in the database using the CLIENT_IDENTIFIER attribute are non-database users.
Image: https://www.oreilly.com/library/view/oracle-plsql-for/0596005873/ch05s06s04.html
Why is Auditing?
Database auditing is generally used to:
Provide proof of monitoring internal controls to auditors
Compliance issues.
Regulations such as the following have common auditing-related requirements:
• Sarbanes-Oxley Act
• Health Insurance Portability and Accountability Act (HIPAA)
• International Convergence of Capital Measurement and Capital Standards: a Revised Framework (Basel
II)
• Japan Privacy Law
• European Union Directive on Privacy and Electronic Communications
Standard Auditing
• Standard auditing provides the ability to audit based on user, privileges, schemas objects, and statements. For
example, it can be based on a specific type of SQL statement (create, alter, update, delete,…).
• You can track the issuance of a specific SQL statement in user sessions or of all SQL statements authorized by a
particular system privilege. Auditing operations on SQL statements apply only to subsequent sessions, not to
current sessions.
• Track operations on a specific schema object. Auditing operations on schema objects apply to current sessions as
well as to subsequent sessions.
• To audit issuances of a SQL statement, you must have the AUDIT SYSTEM system privilege. However, the AUDIT
SYSTEM system privilege is not required when you use the IN SESSION CURRENT clause
• By setting the initialization parameter AUDIT_TRAIL to a value, we can collect auditing results. Oracle Database
does not generate audit records until you enable auditing.
• To audit operations on a schema object, the object you choose for auditing must be in your own schema or you
must have AUDIT ANY system privilege. In addition, if the object you choose for auditing is a directory object,
even if you created it, then you must have AUDIT ANY system privilege.
Standard Auditing
• When you are connected to a multitenant container database (CDB), you must have
the privileges, either granted locally in the current container or granted commonly.
When the database is writeable, audit records are written to the unified audit trail. If the database is not writable, then
audit records are written to new format operating system files in the $ORACLE_BASE/audit/$ORACLE_SID
directory.
Unified Audit Trail
The Unified Audit Trail Key concepts
1. Centralized Audit Repository: The Unified Audit Trail stores audit records from different sources, including
database-level, operating system-level, and Oracle Database Vault audit data, in a single repository.
2. Consistent Format: Audit records in the Unified Audit Trail are stored in a consistent format, making it
easier to query and analyze the data. The audit records contain information such as the user performing the
action, the SQL statement executed, the timestamp of the action, and other relevant details.
3. Enhanced Security: The Unified Audit Trail provides enhanced security features, such as the ability to
encrypt audit records and protect them from unauthorized access.
4. Fine-Grained Auditing: With the Unified Audit Trail, you can enable fine-grained auditing for specific
database objects, operations, or users. This allows you to capture detailed audit information tailored to
your specific auditing requirements.
Unified Audit Trail
The Unified Audit Trail Key concepts
5. Performance: The Unified Audit Trail is designed for improved performance compared to traditional audit
trails. It uses optimized storage structures and indexing mechanisms to efficiently handle large volumes of
audit data.
6. Integration with Enterprise Manager: Oracle Enterprise Manager provides a graphical interface for
managing and monitoring the Unified Audit Trail. You can use Enterprise Manager to configure audit
settings, view audit reports, and perform other audit-related tasks.
7. Compliance and Reporting: The Unified Audit Trail helps organizations meet regulatory compliance
requirements by providing comprehensive audit data for reporting and analysis purposes. It simplifies the
process of auditing database activities and demonstrating compliance to auditors.
Audit Roles
(AUDIT_ADMIN and AUDIT_VIEWER)
Separation of audit responsibilities
1.AUDIT_ADMIN Role:
1. Users assigned the AUDIT_ADMIN role have the privilege to configure and manage audit settings
within the database.
2. Responsibilities of users with AUDIT_ADMIN role may include:
1. Enabling and disabling auditing for specific actions or objects.
2. Managing audit policies and settings.
3. Viewing and managing audit trails and audit data.
3. Users with AUDIT_ADMIN role have full control over auditing functionalities and can make changes to
audit configurations as needed.
Audit Roles
(AUDIT_ADMIN and AUDIT_VIEWER)
Separation of audit responsibilities
2. AUDIT_VIEWER Role:
1. Users assigned the AUDIT_VIEWER role have read-only access to audit information within the database.
2. Responsibilities of users with AUDIT_VIEWER role may include:
1. Viewing audit logs and audit trails.
2. Monitoring audit data for compliance and security purposes.
3. Users with AUDIT_VIEWER role can review audit information but cannot make changes to audit settings or
policies.
By separating responsibilities between AUDIT_ADMIN and AUDIT_VIEWER roles, organizations can enforce a principle of
least privilege, ensuring that users only have access to the audit functionalities they need to perform their job duties. This
separation enhances security and helps in compliance with regulatory requirements.
SQL>GRANT AUDIT_ADMIN TO username; SQL>GRANT AUDIT_VIEWER TO username;
Audit Roles
(AUDIT_ADMIN and AUDIT_VIEWER)
Separation of audit responsibilities
Feature AUDIT_ADMIN AUDIT_VIEWER
Can configure and manage audit
Configuration Cannot configure audit settings
settings
Can view and manage audit trails Can only view audit trails and audit
Audit Trails
and audit data data
To check Logon into database server and connect to PDB or CDB Root.
SQL > SELECT VALUE FROM V$OPTION WHERE PARAMETER = 'Unified Auditing';
Configuring Auditing
• Enable auditing is done by setting audit_trail parameter value. E.g
SQL> alter system set audit_trail=db scope=spfile; OR
SQL> alter system set audit_trail='db_extended' scope=spfile; OR
SQL> alter system set audit_trail=‘db’,’extended' scope=spfile;
• The audit_trail is either database table (data directory) or Operating system files. If parameter is set
to DB or DB_EXTENDED then the audit trail is maintained in the AUD$ system table where as If you
set the parameter to OS, XML, or XML_EXTENDED, then the audit trail is maintained by the operating
system.
1. **Actions to Audit**:
- Specify the actions you want to audit, such as SELECT, INSERT, UPDATE, DELETE, EXECUTE, or schema-level
operations.
AUDIT SELECT TABLE, INSERT TABLE, UPDATE TABLE, DELETE TABLE BY <user>;
2. **Auditing Conditions**:
- Specify when to audit, such as whether the action was successful, unsuccessful, or both.
AUDIT SELECT TABLE BY <user> WHENEVER SUCCESSFUL;
9. Audit by Object:
- Specify auditing for specific database objects.
AUDIT SELECT, INSERT, UPDATE, DELETE ON <object> BY <user>;