Translate lab documentation to English
This commit is contained in:
@@ -1,54 +1,54 @@
|
||||
# 02 - Shared App Account
|
||||
|
||||
## Objetivo
|
||||
## Objective
|
||||
|
||||
Demonstrar o risco de uma conta tecnica de aplicacao usada por muitos usuarios e como o banco deve aplicar autorizacao com base no usuario final.
|
||||
Show the risk of a technical application account used by many users and how the database should enforce authorization based on the end user.
|
||||
|
||||
## O Que Este Lab Mostra
|
||||
## What This Lab Shows
|
||||
|
||||
Antes do Oracle Deep Data Security, uma conta tecnica ou connection pool pode consultar pedidos de todos os vendedores e regioes. Depois dos data grants, o retorno passa a depender da persona propagada pela aplicacao.
|
||||
Before Oracle Deep Data Security, a technical account or connection pool can query orders from every seller and region. After data grants are applied, the result depends on the persona propagated by the application.
|
||||
|
||||
## Personas
|
||||
|
||||
- `alice`: vendedora.
|
||||
- `bruno`: gerente LATAM.
|
||||
- `dds_app`: conta tecnica da aplicacao.
|
||||
- `alice`: sales representative.
|
||||
- `bruno`: LATAM manager.
|
||||
- `dds_app`: technical application account.
|
||||
|
||||
## 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>"
|
||||
```
|
||||
|
||||
Exemplo:
|
||||
Example:
|
||||
|
||||
```text
|
||||
ADMIN/<senha>@ddslab_high
|
||||
ADMIN/<password>@ddslab_high
|
||||
```
|
||||
|
||||
## 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/02-shared-app-account/sql/99_reset.sql
|
||||
```
|
||||
|
||||
3. Crie tabela, dados, usuarios e conta tecnica:
|
||||
3. Create the table, data, users, and technical account:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/00_schema.sql
|
||||
@@ -56,37 +56,37 @@ ADMIN/<senha>@ddslab_high
|
||||
@scenarios/02-shared-app-account/sql/02_identities.sql
|
||||
```
|
||||
|
||||
4. Simule uma aplicacao consultando pedidos com SQL amplo:
|
||||
4. Simulate an application querying orders with broad SQL:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/04_test_queries.sql
|
||||
```
|
||||
|
||||
Resultado esperado antes: pedidos de varias regioes e campos como `MARGIN` podem aparecer para quem nao deveria.
|
||||
Expected result before protection: orders from multiple regions and fields such as `MARGIN` may appear to users who should not see them.
|
||||
|
||||
## Passo A Passo - Depois, Com Deep Data Security
|
||||
## Step By Step - After, With Deep Data Security
|
||||
|
||||
1. Aplique os data grants:
|
||||
1. Apply the data grants:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/03_data_grants.sql
|
||||
```
|
||||
|
||||
2. Execute novamente a consulta:
|
||||
2. Run the query again:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/04_test_queries.sql
|
||||
```
|
||||
|
||||
3. Repita o teste simulando `alice` e `bruno` como usuarios finais.
|
||||
3. Repeat the test by simulating `alice` and `bruno` as end users.
|
||||
|
||||
Resultado esperado depois:
|
||||
Expected result after protection:
|
||||
|
||||
- `alice` ve somente seus pedidos e nao ve `MARGIN`.
|
||||
- `bruno` ve pedidos LATAM com visao gerencial.
|
||||
- A conta tecnica deixa de ser o unico ponto de autorizacao.
|
||||
- `alice` sees only her orders and does not see `MARGIN`.
|
||||
- `bruno` sees LATAM orders with manager visibility.
|
||||
- The technical account is no longer the only authorization boundary.
|
||||
|
||||
## Execucao Automatizada Opcional
|
||||
## Optional Automated Execution
|
||||
|
||||
Windows:
|
||||
|
||||
@@ -100,7 +100,7 @@ Linux/macOS:
|
||||
./scripts/run-scenario.sh 02-shared-app-account "<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).
|
||||
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
# Runbook - 02 Shared App Account
|
||||
|
||||
## Objetivo
|
||||
## Objective
|
||||
|
||||
Demonstrar que uma conta tecnica compartilhada de aplicacao nao deve ser a fronteira real de autorizacao de dados.
|
||||
Show that a shared technical application account should not be the real data authorization boundary.
|
||||
|
||||
## Valor De Seguranca
|
||||
## Security Value
|
||||
|
||||
- Reduz o risco de connection pools com privilegios excessivos.
|
||||
- Permite que o banco avalie o usuario final, e nao apenas a conta tecnica.
|
||||
- Ajuda a proteger aplicacoes web, APIs, BI e agentes que usam contas compartilhadas.
|
||||
- Reduces the risk of overprivileged connection pools.
|
||||
- Lets the database evaluate the end user, not only the technical account.
|
||||
- Helps protect web applications, APIs, BI tools, and agents that use shared accounts.
|
||||
|
||||
## Pre-Requisitos
|
||||
## Prerequisites
|
||||
|
||||
- Banco Oracle AI Database compativel com Oracle Deep Data Security.
|
||||
- SQLcl ou SQL*Plus.
|
||||
- Entendimento de qual identidade final sera propagada pela aplicacao.
|
||||
- Oracle AI Database compatible with Oracle Deep Data Security.
|
||||
- SQLcl or SQL*Plus.
|
||||
- Understanding of which end-user identity the application will propagate.
|
||||
|
||||
## Antes - Ambiente Vulneravel
|
||||
## Before - Vulnerable Environment
|
||||
|
||||
1. Limpe o cenario:
|
||||
1. Reset the scenario:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/99_reset.sql
|
||||
```
|
||||
|
||||
2. Crie a tabela, dados e conta tecnica:
|
||||
2. Create the table, data, and technical account:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/00_schema.sql
|
||||
@@ -32,45 +32,45 @@ Demonstrar que uma conta tecnica compartilhada de aplicacao nao deve ser a front
|
||||
@scenarios/02-shared-app-account/sql/02_identities.sql
|
||||
```
|
||||
|
||||
3. Simule uma aplicacao ou API usando a conta `DDS_APP` para consultar todos os pedidos:
|
||||
3. Simulate an application or API using the `DDS_APP` account to query all orders:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/04_test_queries.sql
|
||||
```
|
||||
|
||||
## Resultado Esperado Antes
|
||||
## Expected Result Before
|
||||
|
||||
- A conta compartilhada consegue enxergar pedidos de todos os vendedores e regioes.
|
||||
- Campos como `MARGIN` podem ficar expostos se a aplicacao gerar SQL incorreto.
|
||||
- Um bug, prompt injection ou endpoint abusado pode consultar mais dados do que o usuario deveria ver.
|
||||
- The shared account can see orders from every seller and region.
|
||||
- Fields such as `MARGIN` may be exposed if the application generates incorrect SQL.
|
||||
- A bug, prompt injection, or abused endpoint may query more data than the user should see.
|
||||
|
||||
## Depois - Aplicando Deep Data Security
|
||||
## After - Applying Deep Data Security
|
||||
|
||||
1. Aplique data grants por papel de negocio:
|
||||
1. Apply data grants by business role:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/03_data_grants.sql
|
||||
```
|
||||
|
||||
2. Execute a mesma query no contexto de `alice` e `bruno`:
|
||||
2. Run the same query in the context of `alice` and `bruno`:
|
||||
|
||||
```sql
|
||||
@scenarios/02-shared-app-account/sql/04_test_queries.sql
|
||||
```
|
||||
|
||||
## Resultado Esperado Depois
|
||||
## Expected Result After
|
||||
|
||||
- `alice` ve somente seus pedidos e nao ve `margin`.
|
||||
- `bruno` ve pedidos LATAM com acesso gerencial.
|
||||
- A conta tecnica deixa de ser a unica fronteira de seguranca.
|
||||
- `alice` sees only her orders and does not see `margin`.
|
||||
- `bruno` sees LATAM orders with full manager visibility.
|
||||
- The technical account is no longer the only security boundary.
|
||||
|
||||
## Evidencias Para Demo
|
||||
## Demo Evidence
|
||||
|
||||
- Comparacao antes/depois do mesmo SQL.
|
||||
- Explicacao do uso de data roles.
|
||||
- Diagrama simples: usuario final -> app -> banco -> data grants.
|
||||
- Before/after comparison of the same SQL.
|
||||
- Explanation of data roles.
|
||||
- Simple flow: end user -> app -> database -> data grants.
|
||||
|
||||
## Referencias Oficiais
|
||||
## Official References
|
||||
|
||||
- Oracle Deep Data Security Guide: https://docs.oracle.com/en/database/oracle/oracle-database/26/ddscg/index.html
|
||||
- Fine-Grained Data Authorization: https://docs.oracle.com/en/database/oracle/oracle-database/26/ddscg/fine-grained-data-authorization.html
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
WHENEVER SQLERROR EXIT SQL.SQLCODE
|
||||
|
||||
INSERT INTO dds_orders (customer_name, region, seller, amount, margin) VALUES ('Acme Brasil', 'LATAM', 'alice', 10000, 2100);
|
||||
INSERT INTO dds_orders (customer_name, region, seller, amount, margin) VALUES ('Acme Brazil', 'LATAM', 'alice', 10000, 2100);
|
||||
INSERT INTO dds_orders (customer_name, region, seller, amount, margin) VALUES ('Andes Retail', 'LATAM', 'alice', 15000, 3200);
|
||||
INSERT INTO dds_orders (customer_name, region, seller, amount, margin) VALUES ('Northwind US', 'NA', 'natalie', 18000, 5000);
|
||||
INSERT INTO dds_orders (customer_name, region, seller, amount, margin) VALUES ('Euro Health', 'EMEA', 'erik', 21000, 6100);
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user