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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grantaxis_cli-0.1.4.tar.gz.
File metadata
- Download URL: grantaxis_cli-0.1.4.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.6 CPython/3.11.10 Linux/6.2.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11679aff00c43500666d6ee5478c8720ddcd9d90950d1cae4919512c34ed4ca3
|
|
| MD5 |
9fb1f74c96f120b7fa1b7a874edf5d43
|
|
| BLAKE2b-256 |
5171ff2684d30d123a74241900ac4835ff564b1a277d0945ed08c832e70a2d66
|
File details
Details for the file grantaxis_cli-0.1.4-py3-none-any.whl.
File metadata
- Download URL: grantaxis_cli-0.1.4-py3-none-any.whl
- Upload date:
- Size: 30.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b52271d1521fd654477ebb25189421f994378e2c223bfaaed0f70d9201b4c1a
|
|
| MD5 |
bfa3bc2f5865ddc0a8536b12b39c1edd
|
|
| BLAKE2b-256 |
4216c05c5193d4adc98c977b6bf8b81784a6b4be863f87cc7f213e55133a1191
|