Translate lab documentation to English
Some checks failed
Repo Quality / structure (push) Has been cancelled
Terraform Validate / validate (push) Has been cancelled

This commit is contained in:
Rodrigo Pace
2026-05-08 14:50:52 -03:00
parent cde150b705
commit 52bf971b8b
33 changed files with 939 additions and 702 deletions

View File

@@ -1,47 +1,47 @@
# 04 - View Bypass Mandatory Access Control
## Objetivo
## Objective
Demonstrar que views e caminhos alternativos de acesso nao devem contornar a politica da tabela base.
Show that views and alternate access paths must not bypass the policy on the base table.
## O Que Este Lab Mostra
## What This Lab Shows
Antes do Oracle Deep Data Security, uma view legada pode expor linhas que deveriam estar protegidas. Depois de aplicar data grants e `USE DATA GRANTS ONLY`, tabela e view respeitam a mesma fronteira de acesso.
Before Oracle Deep Data Security, a legacy view can expose rows that should be protected. After data grants and `USE DATA GRANTS ONLY` are applied, both the table and the view respect the same access boundary.
## Personas
- `emma`: dona de conta.
- `marvin`: dono de conta.
- `emma`: account owner.
- `marvin`: account owner.
## Onde Executar Os Comandos
## Where To Run The Commands
Execute os comandos a partir da raiz do repositorio:
Run commands from the repository root:
```powershell
cd C:\Users\rodrigo\Documents\Codex\oracle-deep-data-security-lab
```
Conecte no banco com SQLcl ou SQL*Plus:
Connect to the database with SQLcl or SQL*Plus:
```bash
sql "<connect_string>"
```
## Passo A Passo - Antes, Ambiente Vulneravel
## Step By Step - Before, Vulnerable Environment
1. Acesse o banco:
1. Connect to the database:
```bash
sql "<connect_string>"
```
2. Limpe o cenario:
2. Reset the scenario:
```sql
@scenarios/04-view-bypass-mac/sql/99_reset.sql
```
3. Crie tabela, view, dados e personas:
3. Create the table, view, data, and personas:
```sql
@scenarios/04-view-bypass-mac/sql/00_schema.sql
@@ -49,7 +49,7 @@ sql "<connect_string>"
@scenarios/04-view-bypass-mac/sql/02_identities.sql
```
4. Consulte a view legada:
4. Query the legacy view:
```sql
SELECT account_id, account_name, owner_name, region, balance
@@ -57,31 +57,31 @@ sql "<connect_string>"
ORDER BY account_id;
```
Resultado esperado antes: a view pode mostrar contas de outros donos.
Expected result before protection: the view may show accounts owned by other users.
## Passo A Passo - Depois, Com Deep Data Security
## Step By Step - After, With Deep Data Security
1. Aplique data grants e Mandatory Access Control:
1. Apply data grants and Mandatory Access Control:
```sql
@scenarios/04-view-bypass-mac/sql/03_data_grants.sql
```
2. Execute as consultas na tabela base e na view:
2. Run the base table and view queries:
```sql
@scenarios/04-view-bypass-mac/sql/04_test_queries.sql
```
3. Repita o teste simulando `emma` e `marvin`.
3. Repeat the test by simulating `emma` and `marvin`.
Resultado esperado depois:
Expected result after protection:
- A tabela retorna apenas a conta autorizada.
- A view retorna o mesmo subconjunto.
- O caminho alternativo deixa de funcionar como bypass.
- The table returns only the authorized account.
- The view returns the same authorized subset.
- The alternate access path no longer works as a bypass.
## Execucao Automatizada Opcional
## Optional Automated Execution
Windows:
@@ -95,7 +95,7 @@ Linux/macOS:
./scripts/run-scenario.sh 04-view-bypass-mac "<connect_string>"
```
## Detalhes Da Demo
## Demo Details
Veja o passo a passo completo, evidencias e referencias oficiais em [RUNBOOK.md](RUNBOOK.md).
See the complete walkthrough, evidence, and official references in [RUNBOOK.md](RUNBOOK.md).

View File

@@ -1,29 +1,29 @@
# Runbook - 04 View Bypass MAC
## Objetivo
## Objective
Demonstrar que views e caminhos alternativos de acesso podem contornar controles mal desenhados, e que `USE DATA GRANTS ONLY` aplica Mandatory Access Control no objeto protegido.
Show that views and alternate access paths can bypass poorly designed controls, and that `USE DATA GRANTS ONLY` enforces Mandatory Access Control on the protected object.
## Valor De Seguranca
## Security Value
- Evita bypass por views legadas.
- Aplica politica uniforme em tabela base e views.
- Ajuda clientes com muitos relatorios, synonyms, views e ferramentas BI.
- Prevents bypass through legacy views.
- Enforces a consistent policy across the base table and views.
- Helps customers with many reports, synonyms, views, and BI tools.
## Pre-Requisitos
## Prerequisites
- Banco Oracle AI Database compativel com Oracle Deep Data Security.
- SQLcl ou SQL*Plus.
- Oracle AI Database compatible with Oracle Deep Data Security.
- SQLcl or SQL*Plus.
## Antes - Ambiente Vulneravel
## Before - Vulnerable Environment
1. Limpe o cenario:
1. Reset the scenario:
```sql
@scenarios/04-view-bypass-mac/sql/99_reset.sql
```
2. Crie tabela, view, dados e personas:
2. Create the table, view, data, and personas:
```sql
@scenarios/04-view-bypass-mac/sql/00_schema.sql
@@ -31,7 +31,7 @@ Demonstrar que views e caminhos alternativos de acesso podem contornar controles
@scenarios/04-view-bypass-mac/sql/02_identities.sql
```
3. Simule uma view legada que retorna todos os dados:
3. Simulate a legacy view that returns all data:
```sql
SELECT account_id, account_name, owner_name, region, balance
@@ -39,38 +39,38 @@ Demonstrar que views e caminhos alternativos de acesso podem contornar controles
ORDER BY account_id;
```
## Resultado Esperado Antes
## Expected Result Before
- A view pode expor contas de outros donos.
- O acesso por caminho alternativo nao respeita a mesma intencao da politica da tabela base.
- The view may expose accounts owned by other users.
- The alternate access path does not honor the intended base table policy.
## Depois - Aplicando Deep Data Security
## After - Applying Deep Data Security
1. Aplique data grants e habilite MAC:
1. Apply data grants and enable MAC:
```sql
@scenarios/04-view-bypass-mac/sql/03_data_grants.sql
```
2. Execute a consulta na tabela e na view:
2. Query the table and the view:
```sql
@scenarios/04-view-bypass-mac/sql/04_test_queries.sql
```
## Resultado Esperado Depois
## Expected Result After
- A tabela base retorna somente a conta do usuario final.
- A view retorna o mesmo subconjunto autorizado.
- O data grant amplo na view nao consegue furar a politica da tabela base quando MAC esta habilitado.
- The base table returns only the account owned by the current end user.
- The view returns the same restricted rows.
- The broad view data grant cannot bypass the base table policy when MAC is enabled.
## Evidencias Para Demo
## Demo Evidence
- Resultado da tabela e da view antes/depois.
- SQL `SET USE DATA GRANTS ONLY ON dds_mac_accounts ENABLED`.
- Explicacao de que MAC remove inconsistencias entre caminhos de acesso.
- Table and view results before and after.
- SQL statement `SET USE DATA GRANTS ONLY ON dds_mac_accounts ENABLED`.
- Explanation that MAC removes inconsistencies across access paths.
## Referencias Oficiais
## Official References
- SET USE DATA GRANTS ONLY: https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/set-use-data-grants-only.html
- Fine-Grained Data Authorization - Mandatory Access Control: https://docs.oracle.com/en/database/oracle/oracle-database/26/ddscg/fine-grained-data-authorization.html

View File

@@ -1,8 +1,7 @@
WHENEVER SQLERROR EXIT SQL.SQLCODE
INSERT INTO dds_mac_accounts VALUES (1, 'Conta Alpha', 'emma', 'LATAM', 100000);
INSERT INTO dds_mac_accounts VALUES (2, 'Conta Beta', 'marvin', 'LATAM', 250000);
INSERT INTO dds_mac_accounts VALUES (3, 'Conta Gamma', 'erik', 'EMEA', 900000);
INSERT INTO dds_mac_accounts VALUES (1, 'Account Alpha', 'emma', 'LATAM', 100000);
INSERT INTO dds_mac_accounts VALUES (2, 'Account Beta', 'marvin', 'LATAM', 250000);
INSERT INTO dds_mac_accounts VALUES (3, 'Account Gamma', 'erik', 'EMEA', 900000);
COMMIT;