RBAC Navigator and Terraform lab architecture

Navigator analyzes a canonical RBAC model and emits review artifacts. The Terraform lab supplies a separate, finite synthetic estate. Human change control sits outside both analysis paths. Snowflake Offer #1 — Access Review & Remediation uses these tools within an agreed consulting engagement; it does not turn their proposals into execution authority.

flowchart TB
    Fixture["Synthetic canonical fixture"] --> Model["Canonical RBAC model"]
    Account["Authorized Snowflake account"] --> Capture["Read-only capture: identity and allowlist checks"]
    Capture --> Recording["Recording: metadata with scope and timing limits"]
    Recording --> Mapper["Validate recording and map observed metadata"]
    Mapper --> Model
    TF["Native Terraform module: five planted cases"] --> Mock["Offline mock provider plans"]
    Mock --> Translate["Finite create-only plan projection"]
    Translate --> Model
    Model --> Analyze["Deterministic graph and findings"]
    Analyze --> Package["Reports, target, impact and commented SQL / Terraform"]
    Package --> Review["Risk review and human approval"]
    Review --> Human["Human administrator: external change process"]
    Human --> Account
    Account --> After["New capture comparison and authorized native probes"]
    After --> Handoff["Results, residuals and handoff"]

Input boundaries

Canonical fixture. Local analysis accepts model JSON containing users, roles, assignments, objects, grants, future grants and ownership. The bundled synthetic fixture demonstrates all eleven analyzer classes. Fixture behavior says nothing about a real account's present state.

Recording. The live capture script uses externally configured SnowSQL authentication and explicit opt-in. It checks observed identity before issuing allowlisted read-only queries. The recording loader validates the schema, contract, configured identity and supplied query ID/SQL pairs; the mapper filters rows to the configured scope. These checks do not prove all inventory queries are present or that the scope covers the recorded estate. An accepted incomplete or overly narrow recording can still produce empty counts. ACCOUNT_USAGE inventory can lag.

Terraform projection. The lab stages its immutable Navigator archive after hash verification. rehearse runs Terraform mock tests in a throwaway module copy, extracts before/after resource changes and writes normalized plan envelopes and canonical models. These are not raw terraform show -json dumps and the after mock is not a saved live update/delete plan. lab.py model only translates the lab's supported create-only resource forms; unresolved values and unsupported forms are errors.

The accepted archive is Navigator 11b7f116 with SHA-256 1639cbe81ece75b7e4cbd47d766d5581ac6821d558096a406cdb8f8bc6fe4c23. The lab pins Snowflake provider 2.18.0. Documentation-only Navigator updates do not repin this dependency.

Graph semantics and owner fidelity

The graph follows observed role inheritance, implicit PUBLIC, direct-user grants and ownership. Its access answers represent maximum-potential grant reach. It does not evaluate current-session role activation, warehouse access, parent database/schema prerequisites, masking or row-access policies, or runtime object state.

The recording mapper retains observed ownership and system roles. Current scoped SHOW schema ownership takes precedence over lagging ACCOUNT_USAGE schema-owner data. Without either observed owner, mapping fails; it does not default ownership to an administrator. Observed system roles remain system roles, not Terraform-managed role resources. Removing the capture identity from client-user analysis must not discard its ownership edges.

Outputs remain proposals

The standard 15-artifact package includes source and target models, executive Markdown/HTML, Explorer, findings, proposed target, remediation plan, impact simulation, projected validation, approval checklist and commented SQL/Terraform review material. Projected validation compares models. validate --after-recording compares captured findings, which still does not prove runtime query access.

The lab replay wrapper consumes an explicit recording and engagement configuration without contacting Snowflake. It preserves Navigator-derived findings and proposals while identifying the principal reports as supplied-recording replay. It adds replay-provenance.json and unresolved-findings.json, making 17 files. Residual ownership and the service-persona/orphaned-role advisory remain visible and unapplied. Replaying recorded comments or diagnostics does not establish a new live session.

Native lab and runtime checks

Five native instances are planted: PUBLIC PAYROLL exposure, an orphaned archive role, duplicate SALES grants, a future SELECT grant without a current peer, and analyst schema MODIFY. The selected remediation removes those instances, not every instance of every finding class. Administrative ownership remains a residual.

The other six classes are synthetic-only here: direct-user grants, excessive system roles, the two service/human role mismatches, managed-access inconsistency and redundant grants. Their native extensions require explicit backlog admission conditions. No ownership transfer, privileged persona system-role assignment or direct-user grant is added by this documentation.

The native probe uses Snowflake Connector for Python 4.7.1. For each bounded read it establishes role, warehouse and inactive secondary roles, verifies observed identity, then queries a fully qualified lab table. It records fresh query IDs and separate native diagnostics, not terminal styling or data rows. Unknown diagnostics are ERROR rather than proof of denial. The finance PAYROLL success is the legitimate same-table control before observer denial can be certified.

An authorized live lifecycle needs separate reviewed saved plans for create, remediation and owned-state cleanup, each bound to the plan hash and state lineage/serial. Only a human applies them. Runtime outcomes plus the captured grant graph support PUBLIC attribution; a mock plan or denial alone does not.

Follow the how-to, operator gates or client workflow. Watch the explainer for a narrated walkthrough.

Audience, source and original lineage

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

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

Registry source: content/public/rbac-architecture.md