Skip to main content

Snowflake access drift scanner

Project description

✨ GrantAxis — “git init” for Snowflake RBAC

GrantAxis is a minimal, purpose-built CLI that snapshots the real grants in your Snowflake account and flags anything that drifts from that baseline.

What it does today (MVP)

✅ Captures a deterministic baseline.yml of every meaningful grant (system noise auto-filtered)

✅ Runs an instant diff (locally or in CI) to surface added, removed, changed, or transferred privileges

✅ Fails your pipeline with exit-code 2 when drift is detected

✅ Outputs a clean Markdown report (drift.md) you can read in any code review

Perfect for teams who…

use Terraform/Permifrost but still get “just-this-once” manual GRANTs

haven’t automated RBAC yet and want quick guard-rails without a full platform migration

need a tiny tool they can run anywhere (local, CI, Docker) with zero backend


🚀 Quick Start — Git-Style Drift Detection for Snowflake RBAC

pip install grantaxis-cli            #  ⏱ <10 s
export SNOWFLAKE_USER= SNOWFLAKE_ACCOUNT= SNOWFLAKE_PASSWORD=…
grantaxis init -o baseline.yml       #  snapshot prod
grantaxis diff -b baseline.yml       #  detect drift any time

1. Install the CLI

# one-liner install from PyPI
pip install grantaxis-cli

(No root? use pipx install grantaxis-cli or a venv.)


2. Set minimal Snowflake credentials

export SNOWFLAKE_USER=myservice
export SNOWFLAKE_ACCOUNT=acme-prod
export SNOWFLAKE_PASSWORD=********
export SNOWFLAKE_WAREHOUSE=MONITORING_WH   # optional

(OAuth or key-pair auth? set SNOWFLAKE_AUTHENTICATOR / SNOWFLAKE_PRIVATE_KEY_PATH instead.) (If you omit env-vars, GrantAxis will prompt for user / password interactively)


3. git init your RBAC baseline

# inside your repo
grantaxis init -o baseline.yml
git add baseline.yml
git commit -m "snapshot: initial Snowflake RBAC baseline"

baseline.yml is a deterministic, human-readable record of every grant that matters (system noise automatically excluded).


4. (Optional) Detect drift in CI

Add .github/workflows/grantaxis.yml:

name: Snowflake RBAC drift

on: [push, pull_request]

jobs:
  diff:
    runs-on: ubuntu-latest
    env:
      SNOWFLAKE_USER:      ${{ secrets.SNOWFLAKE_USER }}
      SNOWFLAKE_ACCOUNT:   ${{ secrets.SNOWFLAKE_ACCOUNT }}
      SNOWFLAKE_PASSWORD:  ${{ secrets.SNOWFLAKE_PASSWORD }}
      SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}

    steps:
      - uses: actions/checkout@v4

      - name: Install GrantAxis
        run: pip install grantaxis-cli

      - name: Capture live snapshot
        run: grantaxis init -o live.yml --quiet

      - name: Diff vs. baseline
        run: |
          grantaxis diff -b baseline.yml -s live.yml --report drift.md
          cat drift.md

🚨 If any new, removed, or modified grants are found, the job fails (exit 2). Review drift.md, commit intentional changes, or revoke rogue privileges.


5. What a drift report looks like

# Grant Drift Report

Summary: 3 changes detected (➕1 ➖1 🔄1)

| Type | Grantee               | Object                 | Priv | GrantOpt |
|------|-----------------------|------------------------|------|----------|
| ➕ Added   | dev_order_protected | SALES_DB.STAGING (SCHEMA) | USAGE | ❌ |
| ➖ Removed | dev_order_protected | ROLE data_engineer        | USAGE | ❌ |
| 🔄 Transfer| dev_order_protected | ROLE data_analyst         | USAGE | ❌ |

Push the fix or merge the PR to keep prod and Git in perfect sync.


That's it.

From now on any "just-this-once" manual GRANT shows up in the diff before it becomes tomorrow's incident. Enjoy the peace of mind.


🔒 Security

✅ No data leaves your environment ✅ CLI runs locally, no backend

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grantaxis_cli-0.1.1.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grantaxis_cli-0.1.1-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file grantaxis_cli-0.1.1.tar.gz.

File metadata

  • Download URL: grantaxis_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.6 CPython/3.11.10 Linux/6.2.16

File hashes

Hashes for grantaxis_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c3a77a279cf4a0a324b8f39455a60e211e3d959f65710bb89acb4b3543d7df72
MD5 5f36c79b56117528cfb5ba61f34fd22c
BLAKE2b-256 452be5030394db1248986c39a315c797f06a1ebd547a3dae070c3347a6101574

See more details on using hashes here.

File details

Details for the file grantaxis_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: grantaxis_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.6 CPython/3.11.10 Linux/6.2.16

File hashes

Hashes for grantaxis_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 061aab5e60d9daadbee5eed8168b34e0a59a4b77e903028cc688880aa6694b92
MD5 ab43518860e4a8222972918e22fc57f4
BLAKE2b-256 da0f0e6458edcc49e6f35942679e4b83059ec6ab633ee75d6fc3f6dc651f20ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page