Run a Navigator review and a Terraform lab rehearsal

These are two separate checkouts. Run each block from the root named in its section. Both repositories require authorized source access; no public clone URL is provided. Start offline. A live account cycle needs the additional operator approval gates and client scope agreement.

The examples use bundled synthetic names. They do not name a customer account or prove current live access. Watch the explainer for the workflow and see the architecture for proof boundaries.

1. Generate the Navigator demo

From an existing Navigator checkout, with Python 3.11 or newer. Local fixture analysis has no runtime dependencies and does not need Snowflake credentials.

PYTHONPATH=src python3 -m sf_rbac_navigator analyze \
  --fixture fixtures/synthetic_snowflake_rbac.json \
  --output-dir artifacts/demo

Open artifacts/demo/executive-assessment.html and artifacts/demo/explorer.html in a browser. Read the source model and findings before the proposed target. The output contains 15 review files; the target, impact simulation and validation-projected.md describe a proposal. Nothing was applied.

Investigate the same fixture:

PYTHONPATH=src python3 -m sf_rbac_navigator explain-user BOB \
  --fixture fixtures/synthetic_snowflake_rbac.json
PYTHONPATH=src python3 -m sf_rbac_navigator who-can-read PROD_DB.CUSTOMER.PII_CUSTOMERS \
  --fixture fixtures/synthetic_snowflake_rbac.json
PYTHONPATH=src python3 -m sf_rbac_navigator revoke-impact FINANCE_ANALYST \
  --fixture fixtures/synthetic_snowflake_rbac.json
PYTHONPATH=src python3 -m sf_rbac_navigator simulate \
  --fixture fixtures/synthetic_snowflake_rbac.json
PYTHONPATH=src python3 -m sf_rbac_navigator validate \
  --fixture fixtures/synthetic_snowflake_rbac.json

The first four print JSON; validate prints a Markdown findings comparison. Access paths represent maximum-potential observed grant reach, not a verified runtime session. Review the commented SQL, Terraform import candidates and approval checklist without executing them.

2. Rehearse the native Terraform lab offline

Switch to the lab checkout. Install Python 3.11+ and Terraform >=1.7 separately; bootstrap does not download Terraform. Cold bootstrap needs network access for packages and the provider. If dependencies are already staged, start with the non-installing check.

python3 bootstrap.py --check

If needed, stage the pinned dependencies:

python3 bootstrap.py

Bootstrap verifies the Navigator archive hash, stages connector 4.7.1, Snowflake CLI 3.26.0 and pytest 9.2.0, and mirrors Snowflake provider 2.18.0. No credentials are needed. Then choose a fresh or empty output directory:

python3 lab.py rehearse --prefix COS_RBAC_DEMO --out evidence/demo

--prefix must match COS_RBAC_[A-Z0-9_]{1,24}. --out refuses nonempty destinations. Rehearsal runs Terraform formatting checks, initialization, validation and mock tests on a throwaway module copy. It writes native test events, normalized before/after plan projections, canonical models, actual Navigator report packages and verification.json. The latter is explicitly terraform-mock-offline with live_verified: false.

Re-derive a model from the lab's normalized plan envelope using a new output filename:

python3 lab.py model --plan evidence/demo/before.plan.json \
  --out evidence/demo/rederived-before-model.json

This translator supports the lab's finite create-only forms, not arbitrary Terraform plans or live update/delete transitions. The after mock plan is another from-scratch projection, not proof a remediation was applied.

Inspect these outcomes in verification.json and the reports:

Planted instance Selected after state
PUBLIC SELECT on PAYROLL plus parent USAGE Exposure removed
Orphaned archive role Role removed
Duplicate SALES shadow role Human-selected consolidation removes shadow resources
Future SELECT in an empty schema Grant removed
Analyst MODIFY on REPORTING Grant removed; administrative ownership residuals remain

Analyst SALES and finance SALES/PAYROLL access must survive. Observer PAYROLL should be reachable before and not after. The extended/ package analyzes reference/synthetic.json, not the Terraform estate: its six additional classes remain synthetic-only. Native direct-user grants, privileged system-role assignments, service/human role mismatch cases, managed-access inconsistency and redundant grants are not established by this rehearsal.

3. Replay a supplied recording without Snowflake access

Still in the lab checkout, obtain a recording and its complete matching engagement configuration through an approved private channel. There is no default recording. Keep inputs outside shared/client output. The quoted relative paths below refer to files you supply, not bundled examples:

SF_RBAC_ENGAGEMENT="private input/engagement.json" \
  python3 scripts/capture_replay.py "review output" "private input/recording.json"

Both positional arguments are required: output first, recording second. All paths, including SF_RBAC_ENGAGEMENT, resolve from the caller's working directory, even when calling the script from outside the checkout. Existing empty output directories are allowed; existing files and nonempty directories are refused.

Read replay-provenance.json and unresolved-findings.json alongside the 15 Navigator artifacts. Reports identify offline replay. Capture provenance, scope suitability and inventory completeness still need independent review. Preserve observed owners and unresolved ownership; any service-role migration advisory remains separate from the lab's selected remediation. No generated SQL or Terraform runs during replay.

4. Only with separate authorization: capture and validate

From the Navigator checkout, configure SnowSQL authentication externally and set a complete SF_RBAC_ENGAGEMENT file for the authorized identity and databases. Required configuration fields are account, organization, account_name, user, role and a nonempty databases list. Configure optional warehouse, account locator and SnowSQL profile fields for the intended session too; do not rely on the bundled demo defaults. Never copy the configuration or credential profiles into a public package.

The following commands contact Snowflake only at the explicitly opted-in capture step. Prepare a private working directory first and use paths approved for the engagement:

SF_RBAC_ENGAGEMENT="private input/engagement.json" SF_RBAC_LIVE_TEST=1 \
  python3 scripts/sf014_capture.py --output "private input/before.json"

SF_RBAC_ENGAGEMENT="private input/engagement.json" PYTHONPATH=src \
  python3 -m sf_rbac_navigator analyze \
  --recording "private input/before.json" --output-dir "private review/before"

Capture is read-only, checks observed identity, does not switch roles and has metadata coverage/lag limits. A successful capture does not authorize remediation. After separate risk review, independent review where required, human approval and administrator application, collect a new recording through the same approved capture procedure, then compare:

SF_RBAC_ENGAGEMENT="private input/engagement.json" PYTHONPATH=src \
  python3 -m sf_rbac_navigator validate \
  --recording "private input/before.json" \
  --after-recording "private input/after.json"

This compares captured findings, not runtime query access.

5. Only for an approved lab cycle: native probe and cleanup

A live lab plants deliberate PUBLIC exposure to synthetic objects. A prefix does not isolate PUBLIC inheritance account-wide. Before provisioning, authorize the account, prefix, cost and cleanup; check name collisions; use a private module copy without mock tests. Supply all required Terraform variables from the lab's terraform/variables.tf and external provider authentication. No secrets belong in plans, reports or this documentation.

The human lifecycle is three distinct saved plans: create with remediated=false, remediate against current owned state with remediated=true, then owned-state destroy. Record plan hash and state lineage/serial for independent review and human approval at every gate. Regeneration or changed state/variables invalidates approval. See the lab README's manual lifecycle for exact saved-plan commands; do not use a create-only mock projection to approve a live transition. Neither Navigator nor lab.py has an apply/destroy command.

From the lab checkout, prepare private persona profiles and bindings as described in its README. Keep bindings and probe receipts in the ignored .cache/ directory. Then, at the appropriate approved phases:

python3 lab.py probe --bindings .cache/rbac-lab-private/bindings.json \
  --prefix COS_RBAC_DEMO --phase before \
  --out .cache/rbac-lab-private/probe-before.json

python3 lab.py probe --bindings .cache/rbac-lab-private/bindings.json \
  --prefix COS_RBAC_DEMO --phase after \
  --out .cache/rbac-lab-private/probe-after.json

Do not run these phases back-to-back without the intervening approved change and new metadata capture. The native probe verifies setup and identity in each session; four scoped reads must match expected outcomes. PASS is exit 0; wrong observed access is FAIL (1); uncertain setup, identity, transport or unsupported diagnostics is ERROR (2). An error is not proof of denied access. PUBLIC attribution requires the captured grant graph and the runtime controls together.

After the human applies the separately approved owned-state destroy plan, independently check that prefixed databases, roles, users, warehouses and resource monitors are absent. Hand off actual results and unresolved risks, distinguish projections from live observations, and apply the agreed private-artifact retention/deletion decision.

Audience, source and original lineage

Audience: developer, technical evaluator, Lee, owner/operator · Reading modes: operator, engineer

Original lineage (not approval of later edits): registry-listed (no candidate packet)

Registry source: content/public/rbac-how-to.md