CCN-CERT BP22 Security Recommendations For Oracle Database 19C - 2
CCN-CERT BP22 Security Recommendations For Oracle Database 19C - 2
BP/22
Security
recommendations for
Oracle Database 19C
MAY 2022
Edit:
CENTRO CRIPTOLOGICO NACIONAL
cn=CENTRO CRIPTOLOGICO NACIONAL,
2.5.4.97=VATES-S2800155J, ou=CENTRO
CRIPTOLOGICO NACIONAL, o=CENTRO
CRIPTOLOGICO NACIONAL, c=ES
2022.10.05 13:19:50 +02'00'
LIMITATION OF LIABILITY
This document is provided in accordance with the terms contained herein, expressly rejecting
any type of implicit guarantee that may be related to it. Under no circumstances can the National
Cryptologic Centre be held responsible for direct, indirect, fortuitous or extraordinary damage derived
from the use of the information and software indicated, even when warned of such a possibility.
LEGAL NOTICE
The reproduction of all or part of this document by any means or process, including reprography
and computer processing, and the distribution of copies by public rental or loan, is strictly prohibited
without the written authorisation of the National Cryptologic Centre, subject to the penalties
established by law.
With this series of documents, the National Cryptologic Centre, in compliance with
its tasks and with what is reflected in Royal Decree 3/2010 regulating the National
Scheme in the field of electronic administration, contributes to improving Spanish
cybersecurity and maintaining the infrastructures and information systems of
all public administrations with optimum levels of security. All of this is aimed at
generating trust and guarantees in the use of these technologies, protecting the
confidentiality of data and guaranteeing its authenticity, integrity and availability.
May of 2022
Center, CCN.
Its mission, therefore, is to contribute to the improvement of Spanish
cybersecurity, being the national alert and response centre that
cooperates and helps to respond quickly and efficiently to cyber-
attacks and to actively face cyber-threats, including the coordination at
state public level of the different existing Incident Response Capabilities
or Cybersecurity Operations Centres.
All of this, with the ultimate aim of achieving a more secure and
reliable cyberspace, preserving classified information (as stated in
art. 4. F of Law 11/2002) and sensitive information, defending Spain’s
Technological Heritage, training expert personnel, applying security
policies and procedures and using and developing the most appropriate
technologies for this purpose.
The Oracle 19c product is a generalist relational database manager, Authentication is the
which means that it can be used in multiple environments and
applications, and can be deployed on Unix, Linux and Microsoft
process by which a
Windows servers. system verifies the
identity of a user.
In all cases, it will be important not to lose sight of the security aspects
that are configured at the operating system level, such as users, services,
communications and protocols, as well as those that are configured
in the Oracle 19c environment, such as authorisation processes and
access control to the data residing in the different databases.
Link: https://docs.oracle.com/en/database/oracle/oracle-
database/19/dbseg/configuring-authentication.html
Link: https://docs.oracle.com/en/database/oracle/oracle-
database/19/dbseg/configuring-kerberos-authentication.html
Active Data Guard is a high availability architecture model that enables a high availability
architecture as a data loss prevention model in synchronous or asynchronous mode.
Oracle (Active) Data Guard capabilities in Oracle Database 19c further enhance its
strategic goal of preventing data loss, providing high availability, eliminating risk, and
increasing ROI by enabling highly functional active disaster recovery Active Data Guard
systems that are easy to deploy and manage. It achieves this by providing
the management, monitoring and automation software infrastructure
uses the simplicity of
to create and maintain one or more synchronised standby databases physical replication,
that protect Oracle data from failures, data corruption, human error, and
with its integration with
disasters.
Oracle providing unique
Active Data Guard uses the simplicity of physical replication, with its
isolation between the
integration with Oracle it provides unique isolation between primary and
standby databases to offer the highest level of protection against data primary databases.
loss. Active Data Guard supports both synchronous (zero guaranteed
data loss) and asynchronous (near zero data loss).
One of the big advantages of Active Data Guard 19c is the improved
ability to perform intensive offline reads against standby applications.
It is now also possible to issue occasional DML against the standby
database, making it now a fully functional reporting database. This
leverages the ROI as the primary database is used optimally and the
resources of the disaster recovery system are used optimally.
More information about Oracle Active Data Guard 19c can be obtained
from the following link:
Link: https://www.oracle.com/technetwork/database/availability/dg-
adg-technical-overview-wp-5347548.pdf
In terms of traceability and the sudden growth that each of the Oracle
tables may have depending on the needs of each organisation, hybrid
partitioned tables have been implemented allowing the management
of a table between partitions within the database and also outside the
database, in the external case with read access.
Link: https://oracle-base.com/articles/19c/hybrid-partitioned-tables-
19c
The SYSTEM user in charge of system control has the role of DBA and
must also change his default password. In his schema, tables and
administration views can be created.
The SYSDG user facilitates Data Guard operations. The user can perform
operations with Data Guard Broker or with the DGMGRL command line
interface.
The SYSRAC user facilitates Oracle Real Application Clusters (Oracle RAC)
operations by connecting to the database through the Clusterware agent
against Oracle RAC utilities such as SRVCTL.
Users who have been granted the CREATE USER system privilege can
create user accounts, including user accounts to be used as proxy
users. Because the CREATE USER system privilege is a powerful
privilege, a database administrator or security administrator is usually
the only user who has this system privilege. If you want to create users
that have the create user privilege, you can include the WITH ADMIN
OPTION clause in the GRANT statement.
Link: https://docs.oracle.com/en/database/oracle/oracle-
database/19/dbseg/configuring-privilege-and-role-authorization.html
Independently of these, other roles can be generated with the create role
statement, which can then be assigned specific permissions. Therefore, an
audit of permissions in the database must be dynamic and not restricted
only to the roles and permissions generated in an installation. The vendor
provides at least 30 role management views to facilitate these tasks.
Authorities with grant and revoke privilege permissions can assign and
revoke permissions to users and roles.
Link: https://docs.oracle.com/en/database/oracle/oracle-database/19/
admin/getting-started-with-database-administration.html
To install Oracle 19c you must first install the necessary prerequisites
using the following command:
Once finished, you must download the Oracle installation software and
install it with the following command:
rpm -i oracle-database-ee-19c-1.0-1.x86_64.rpm
Due to the new Oracle release, there are 2 new options when creating
a database during installation. Therefore, the following options should
be taken into consideration depending on the needs of the organisation:
NON-CDB
Database similar to previous versions 9.x, 10.x or 11.x
CDB
Container database for the storage of pluggable
databases.
empty CBD.
By design, you can quickly connect a PDB to a CDB, disconnect the PDB
from the CDB, and then connect this PDB to a different CDB. You can
also clone PDBs as long as they are available.
Link: https://docs.oracle.com/en/database/oracle/oracle-database/18/
rilin/deciding-between-multitenant-container-databases-and-non-cdbs-
in-oracle-rac.html
Link: https://docs.oracle.com/en/database/oracle/oracle-database/19/
multi/introduction-to-the-multitenant-architecture.html
Verify that ORA_DBA user accounts are not root in the operating system.
In case vulnerabilities are published, and have not been fixed by Oracle,
this should be reported to senior security managers.
LOCAL_OS_AUTHENTICATION_ = ON , ADMIN_RESTRICTIONS_
LISTENER=ON
Message
TNS-01169
TNS-01189
TNS-01190
TNS-12508
ORA-12525
ORA-28040
ORA-12170
“SEC_PROTOCOL_ERROR_FURTHER_ACTION” by “DROP,3”.
tcp.validnode_checking = yes
tcp.invited_nodes = (x.x.x.x | name, x.x.x.x | name)
tcp.excluded_nodes=( x.x.x.x | name, x.x.x.x | name)
https://www.integrigy.com/files/Integrigy_Oracle_Listener_TNS_Security.pdf
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/
keeping-your-oracle-database-secure.html
4.2 Audit
Link: https://docs.oracle.com/en/database/oracle/oracle-database/19/
sqlrf/CREATE-AUDIT-POLICY-Unified-Auditing.html
It should be noted that if you want to audit and/or bastion the accesses
to the records of a table, you must verify that all accesses to views,
materialised views, synonyms or possible file outputs via ETLs based
on the records of that table are also audited and/or bastioned.
Once the WASS policies have been configured, WAF rules must be
created with the following parameters as standard recommendations:
Origin. Container key within the Origins defined in the WASS Policy.
Link: https://docs.oracle.com/en/database/oracle/oracle-
database/19/dbseg/configuring-network-data-encryption-and-
integrity.html
SQLNET.ENCRYPTION_TYPES_CLIENT
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT
SQLNET.ENCRYPTION_TYPES_SERVER
SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER
The sql.ora file must be configured on the server with the parameters:
SQLNET.ENCRYPTION_SERVER = REQUIRED
SQLNET.ENCRYPTION_TYPES_SERVER = (AES256)
SQLNET.CRYPTO_CHECKSUM_SERVER = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER = (SHA512)
SQLNET.ALLOW_WEAK_CRYPTO_CLIENTS = FALSE
Each client must be configured in the sql.ora file with the following
entries:
SQLNET.ENCRYPTION_CLIENT = REQUIRED
SQLNET.ENCRYPTION_TYPES_CLIENT = (AES256)
SQLNET.CRYPTO_CHECKSUM_CLIENT = REQUIRED
SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT = (SHA512)
SQLNET.ALLOW_WEAK_CRYPTO = FALSE
https://ittutorial.org/oracle-19c-network-encryption/
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/
release-changes.html
https://docs.oracle.com/en/database/oracle/oracle-database/19/asoag/
configuring-transparent-data-encryption.html
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/
configuring-network-data-encryption-and-integrity.html
Oracle 19c allows you to generate encryption keys and encrypt your
databases. It also allows you to encrypt specific objects such as tables,
table columns or cells. It is the responsibility of the organisation to know
and secure the most sensitive data. This depends on the information
content of the different databases. Not all data has the same criticality
and it is up to the organisation to first categorise the information, and
then secure access to it according to the sensitivity of the data.
View
ALL_ENCRYPTED_COLUMNS
DBA_ENCRYPTED_COLUMNS
USER_ENCRYPTED_COLUMNS
DBA_TABLESPACE_USAGE_METRICS
V$CLIENT_SECRETS
V$DATABASE_KEY_INFO
V$ENCRYPTED_TABLESPACES
V$ENCRYPTION_KEYS
V$ENCRYPTION_WALLET
V$WALLET
and dated.
Oracle allows accesses to other database servers by linking them. The The use of “Global
security of these accesses and their exposed data must be given the
same consideration as that of the Oracle engine’s own data.
Temporary” is
recommended, so that
Often applications generate temporary tables from the code. Therefore,
access to this data is
the use of “Global Temporary” is recommended, so that access to this
data is only possible from the active connection that generates it and only possible from the
the table is destroyed at the end of the execution of the “PLSQL” code.
active connection than
Security should be reviewed for requests to incorporate Java classes or the general one.
other objects other than those incorporated by the manufacturer.
The security of all “PLSQL” code container objects developed for the
operation of applications such as stored procedures, functions and
packages must be reviewed. Particularly sensitive are container objects
(procedures, functions and packages) for dynamic SQL execution such
as execute immediate. If these objects have not been parameterised
correctly, they can be subject to dynamic SQL attacks.
The code of all “PLSQL” code container objects developed for the Default user accounts
operation of applications: stored procedures, functions and packages
must be encrypted. In this way a user editing the object will not be able
are a clear attack vector
to see its contents. The “all_source” and/or “dba_source” views can be on the solution.
used to quickly view the code of these objects.
granted.
≂ Special care must be taken with privileges granted with the “ANY”
This account can perform all administrative functions. All base (underlying)
tables and views of the database data dictionary are stored in the SYS
schema. These base tables and views are critical to the operation of
Oracle Database.
To maintain the integrity of the data dictionary, the SYS schema tables are
only manipulated by the database.
On the other hand, they must never be modified by any user or database
administrator. No tables should be created in the SYS schema. The SYS
user is granted the SYSDBA privilege, which allows the user to perform
high-level administrative tasks, such as backup and recovery.
You can change the password of the SYSTEM user from “SQLPLUS” as
follows:
It is desirable to have a user certificate for each account with access to the
engine.
Application accounts: These are the database accounts that are used
to run your applications, both commercial and homegrown. These
accounts are similar to your regular database user accounts, but
since applications must run 24/7, their passwords are often stored on
multiple middle-tier servers. Compromise on these database accounts
can result in data loss for the entire application, including end-user
data.
Sensitive data can be encrypted at record, column, row and even cell level.
DECLARE
input_string VARCHAR2(16) :=
'tigertigertigert';
raw_input RAW(128) :=
UTL_RAW.CAST_TO_RAW(CONVERT(input_
string,'AL32UTF8','US7ASCII'));
key_string VARCHAR2(8) := 'scottsco';
raw_key RAW(128) :=
UTL_RAW.CAST_TO_RAW(CONVERT(key_
string,'AL32UTF8','US7ASCII'));
encrypted_raw RAW(2048);
encrypted_string VARCHAR2(2048);
decrypted_raw RAW(2048);
decrypted_string VARCHAR2(2048);
-- Begin testing Encryption:
BEGIN
dbms_output.put_line('> Input String
: ' ||
CONVERT(UTL_RAW.CAST_TO_VARCHAR2(raw_
input),'US7ASCII','AL32UTF8'));
dbms_output.put_line('> ========= BEGIN TEST
Encrypt =========');
encrypted_raw := dbms_crypto.Encrypt(
src => raw_input,
typ => DBMS_CRYPTO.DES_CBC_PKCS5,
Signature-based security has been implemented for LOB LOB CLOB, NLOB or
locators. LOB CLOB, NLOB or BLOB data types are used to
store files or large text fields of up to 4GB capacity.
BLOB data types are
used to store files or
Emphasis should be put on how to store the LOB signing
large text fields.
key in encrypted format, the database or PDB must have an
open TDE keystore. From this version onwards, it is allowed
to configure signature-based security for large object locators.
https://docs.oracle.com/en/database/oracle/oracle-database/19/asoag/
configuring-transparent-data-encryption.html
https://docs.oracle.com/en/database/oracle/oracle-database/19/
dvadm/index.html
https://docs.oracle.com/en/database/oracle/oracle-database/19/
dbseg/index.html
https://docs.oracle.com/en/database/oracle/oracle-database/19/
asoag/
https://docs.oracle.com/en/database/oracle/oracle-database/19/
dbseg/
Depending on the data stored in each engine’s database, Oracle 19c has
auto-analysis services based on artificial intelligence and data patterns
associated with the regional configuration of the installation. The tool
searches for data such as names, credit cards, salaries, amounts,
personal addresses, etc. and allows secure access to them.
The objects and utilities for categorising the data are as follows:“
Package Purpose
“Enterprise Manager provides a graphical environment for the discovery and categorisation
of sensitive data.
If data stored in backups are left unprotected, they can be accessed A daily incremental
directly from the backup service.
backup should be
It is recommended to encrypt all backup files and archive images, generated and retained
regardless of the medium on which they are stored.
for seven days.
It is recommended to ensure that the restoration of any backup should
require controlled access to the encryption key and should be audited,
both the access and the restoration itself.
SSH: Secure Shell (SSH) is a protocol for secure remote login and other
secure network services over an insecure network. SSH can be used
as the basis for a number of secure network services as it provides
robust encryption, server authentication and integrity protection. It
also provides data compression. SSH is used during installation to
configure cluster member nodes, and SSH is used after installation by
configuration wizards, Oracle Enterprise Manager, Opatch and other
features.
6. Glossary
On Unix or Linux systems, it is recommended Avoid using default names to plan attacks
1 to specify different user names than those on the database.
created by default.
controls.
It is recommended to revoke the DBA’s data By default, a DBA has access to any table
access privileges if he/she has no real need in his or her database instance. This poses
9
to access the data. a risk, especially if the account has been
breached or if these privileges are abused.
It is recommended to check that PUBLIC Minimise the exposure surface.
10
access has not been granted to any database.
It is recommended to review and protect An unauthorised user can access information
11 important system tables and views such as residing in system tables if they have not
ALL_OBJECTS, ALL_SOURCE. been adequately protected.
It is recommended to assign privileges Improve control and maintenance of access
12 through a role model, avoiding direct privileges.
assignment to users.
It is recommended to use the access controls Prevent operating system administrators
13
of the operating system. from gaining too much access.
It is recommended to assign DBA permissions Allows to restrict access only to connections
14 only through a role, and to control access to originating from trusted computers.
this role through trust contexts.
It is recommended to revoke the privilege Minimise the exposure surface.
15 to create databases for all users except the
DBA.
7. Summary table of security enhancement measures
It is recommended to review the audit event Control the audit information generated,
logging needs and to select only those events avoiding irrelevant data and storage
16 that are important for the organisation or problems that may lead to loss of relevant
those that are related to the security of the evidence.
system.
It is recommended to create an AUDITOR role Control who can access audit information
17 and grant the necessary privileges to read and how.
and manage audit events.
It is recommended to control access to the Allows to restrict access only to connections
18
AUDITOR role through trusted contexts. originating from trusted computers.
It is recommended that the generated Prevent exfiltration of data or access to
audit files should not be copied, modified sensitive audit information by bypassing
19 or deleted directly by the operating system database security mechanisms.
administrator or by any other unauthorised
user of the platform.
It is recommended to make use of a Unification of different audit sources,
20 centralised audit trail service. facilitating log correlation and avoiding loss
AUDIT
or manipulation of evidence.
It is recommended to encrypt the authoring Prevent exfiltration of data or access to
records stored on disk (data at rest), both on sensitive audit information by bypassing
21
the database server and on the log centraliser database security mechanisms.
service, if one is available.
It is recommended to audit all DBA actions. Maintain an audit trail of administrative
22
actions that may compromise the system.
It is recommended to audit user access, in Maintain an audit trail of user actions.
23 particular those who have access to sensitive
data.
It is recommended to audit all accesses to Maintain an audit trail of actions that may
24
important tables. compromise the system.
It is recommended to audit the SYS schema Maintaining an audit trail of these objects will
25 objects. allow you to keep track of changes made to
objects such as tables, views, indexes, etc....
It is recommended to audit all attempts to Maintain an audit trail of administrative
26
create databases. actions that may compromise the system.
7. Summary table of security enhancement measures
It is recommended to make use of encryption Prevent data capture in transit through the
27 with the secure algorithms exposed in the network.
communications layer.
It is recommended not to encrypt with The manufacturer marks the following
algorithms marked as obsolete by the algorithms as obsolete: DES, DES40,
28 manufacturer. 3DES112, 3DES168, RC4_40, RC4_56,
RC4_128 and RC4_256, and they should not
be used.
It is recommended to use robust cipher Prevent exploitation of vulnerabilities in weak
COMMUNICATIONS PROTECTION
It is recommended to use LBAC at the registry Comply with the “need to know” principle.
36 level when handling sensitive or classified
information related to government entities.
It is recommended to use LBAC at registry Comply with the “need to know” principle.
level when the following statements are true:
– The degree of classification of the data is
known.
37 – The classification of the data can be
PROTECTION OF INFORMATION
www.ccn-cert.cni.es
oc.ccn.cni.es