Initial Oracle Deep Data Security lab kit
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 12:08:05 -03:00
commit 5cd8752a90
88 changed files with 2189 additions and 0 deletions

17
scripts/bootstrap.ps1 Normal file
View File

@@ -0,0 +1,17 @@
param()
$ErrorActionPreference = "Stop"
Write-Host "Checking local tools..."
$tools = @("git", "terraform")
foreach ($tool in $tools) {
$cmd = Get-Command $tool -ErrorAction SilentlyContinue
if ($null -eq $cmd) {
Write-Warning "$tool not found in PATH"
} else {
Write-Host "$tool found: $($cmd.Source)"
}
}
Write-Host "Bootstrap check finished."

View File

@@ -0,0 +1,21 @@
param(
[Parameter(Mandatory = $true)]
[string]$Scenario,
[Parameter(Mandatory = $true)]
[string]$ConnectString,
[string]$SqlClient = "sql"
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $PSScriptRoot
$resetScript = Join-Path $repoRoot "scenarios/$Scenario/sql/99_reset.sql"
if (-not (Test-Path $resetScript)) {
throw "Reset script not found: $resetScript"
}
Write-Host "Resetting scenario $Scenario"
& $SqlClient $ConnectString "@$resetScript"

34
scripts/run-scenario.ps1 Normal file
View File

@@ -0,0 +1,34 @@
param(
[Parameter(Mandatory = $true)]
[string]$Scenario,
[string]$ConnectString,
[string]$SqlClient = "sql"
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $PSScriptRoot
$scenarioDir = Join-Path $repoRoot "scenarios/$Scenario"
$sqlDir = Join-Path $scenarioDir "sql"
if (-not (Test-Path $sqlDir)) {
throw "Scenario SQL directory not found: $sqlDir"
}
$scripts = Get-ChildItem -Path $sqlDir -Filter "*.sql" | Where-Object { $_.Name -ne "99_reset.sql" } | Sort-Object Name
Write-Host "Scenario: $Scenario"
Write-Host "Scripts to execute:"
$scripts | ForEach-Object { Write-Host " - $($_.Name)" }
if ([string]::IsNullOrWhiteSpace($ConnectString)) {
Write-Warning "ConnectString not provided. Review the SQL files above and execute them manually with SQLcl or SQL*Plus."
exit 0
}
foreach ($script in $scripts) {
Write-Host "Running $($script.FullName)"
& $SqlClient $ConnectString "@$($script.FullName)"
}

View File

@@ -0,0 +1,27 @@
param(
[string]$Environment = "demo"
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $PSScriptRoot
$tfDir = Join-Path $repoRoot "terraform/envs/$Environment"
if (-not (Test-Path $tfDir)) {
throw "Terraform environment not found: $tfDir"
}
$terraform = Get-Command terraform -ErrorAction SilentlyContinue
if ($null -eq $terraform) {
throw "Terraform is not installed or not in PATH. Install Terraform 1.6+ and rerun this script."
}
Push-Location $tfDir
try {
terraform fmt -recursive -check
terraform init -backend=false
terraform validate
}
finally {
Pop-Location
}