Vous êtes sur la page 1sur 3

UIR Travaux pratiques/DATASECURITY AND AUDITING 2023/2024

Pr. Kamal EL GUEMMAT

Big Data & AI

TP 5 : ORACLE (Chiffrement, Data Redaction)

Chiffrement
1. Activer et vérifier le chiffrement transparent de données.
Définir WALLET_ROOT
alter system set wallet_root='C:\encryption_wallet' scope=spfile sid='*';
Redémarrer la base de données
Shutdown, startup
Définir TDE_CONFIGURATION
alter system set tde_configuration="KEYSTORE_CONFIGURATION=FILE" scope=both sid='*';
Créer keystore de clés protégé par mot de passe
administer key management create keystore identified by sec;
Créer Auto-Login Keystore
administer key management create auto_login keystore from keystore identified by sec;
Définir la clé principale TDE
administer key management set keystore open force keystore identified by sec container=all;
Vérifier l'état actuel de portefeuille
select con_id, wallet_type, status from v$encryption_wallet;
Définir la clé
administer key management set key force keystore identified by sec with backup container=all;
Fermer Keystore
administer key management set keystore close identified by sec container=all;
Testez la configuration
Crée deux tablespaces un sans cryptage et un avec cryptage, Si vous ne spécifiez aucun algorithme de
chiffrement, AES128 est utilisé par défaut.
CREATE TABLESPACE enc_test
DATAFILE 'C:\encryption_wallet\enc_test_ts01.dbf' SIZE 128K
AUTOEXTEND ON NEXT 64K
ENCRYPTION USING 'AES256'
DEFAULT STORAGE(ENCRYPT);

CREATE TABLESPACE nor_test


DATAFILE 'C:\encryption_wallet\nor_test_ts01.dbf' SIZE 128K
AUTOEXTEND ON NEXT 64K;

1
UIR Travaux pratiques/DATASECURITY AND AUDITING 2023/2024
Pr. Kamal EL GUEMMAT
Vérification de cryptage
SELECT tablespace_name, encrypted FROM dba_tablespaces where tablespace_name='NOR_TEST';
SELECT tablespace_name, encrypted FROM dba_tablespaces where tablespace_name='ENC_TEST';
2. Activer et vérifier le chiffrement réseau.
Activation du cryptage sur Oracle Net Manager.

Activation du cryptage sur le fichier sqlnet.ora coté serveur et client.


SQLNET.ENCRYPTION_SERVER = [accepted | rejected | requested | required]
SQLNET.ENCRYPTION_TYPES_SERVER=(valid_encryption_algorithm[,valid_encryption_algorit
hm])
SQLNET.ENCRYPTION_CLIENT = [accepted | rejected | requested | required]
SQLNET.ENCRYPTION_TYPES_CLIENT=(valid_encryption_algorithm[,valid_encryption_algorit
hm])
Data Redaction
3. Créer un nouvel utilisateur TP5 et leur accorder toutes les privilèges.
CREATE USER TP5 IDENTIFIED BY TP5;
GRANT ALL PRIVILEGES TO TP5;
4. Créer une nouvelle table par l’utilisateur TP5, remplir la table avec quelques lignes,
afficher les données de la table.
CREATE TABLE TEST ( id int, name varchar(200), password int );
INSERT INTO TEST VALUES (1,'test1',12345); ………………..
SELECT * FROM TP5 ;
5. Activer la rédaction totale sur les données de la table TEST.
BEGIN
DBMS_REDACT.ADD_POLICY(
object_schema => 'TP5',

2
UIR Travaux pratiques/DATASECURITY AND AUDITING 2023/2024
Pr. Kamal EL GUEMMAT
object_name => 'TEST',
column_name => ‘password’,
policy_name => ‘REDACT_PASS’,
function_type => DBMS_REDACT.FULL,
expression => ‘1=1’);
END;/
6. Activer la rédaction de données partielle, appliquer une requête qui affiche que
l’année de la date d’embauche de la table employé pour l’utilisateur HR (par exemple
--/--/1970). Effectuer cette manipulation selon le EM via l’onglet sécurité.
@?/rdbms/admin/execemx emx
Restaurer l’affichage JET @?/rdbms/admin/execemx omx

Ressources :
https://docs.oracle.com/en/database/oracle/oracle-database/19/asoag/configuring-transparent-
data-encryption.html#GUID-C5D20EAE-3369-411F-9A7E-13AB14139F1D
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-network-data-
encryption-and-integrity.html#GUID-258AB895-1DFA-4A14-9D66-1645F9D5D824
https://docs.oracle.com/en/database/oracle/oracle-database/19/asoag/using-oracle-data-redaction-
in-oracle-enterprise-manager.html#GUID-8267183A-1778-428E-9B6E-AB06D8CC7EAB

Vous aimerez peut-être aussi