Access control for DuckLake lakehouses
Project description
ducklake-guard
Experimental — ducklake-guard is under active development. It works, but has not been audited. Review carefully before using in sensitive or production environments.
Per-table access control for DuckLake lakehouses on Hetzner Cloud. A single CLI manages S3 bucket policies, Postgres catalog visibility (RLS), and catalog roles, with an audit log.
[!NOTE] I'll add AWS and Scaleway, make sure to follow the repo for any updates.
Installation
pip install ducklake-guard
Or with uv:
uv pip install ducklake-guard
From source:
pip install git+https://github.com/berndsen-io/ducklake-guard.git
System overview
graph LR
DGA["dga CLI"]
PG_GUARD["ducklake_guard DB<br/>(source of truth)"]
PG_CATALOG["ducklake_catalog DB<br/>(RLS + roles)"]
S3["Hetzner S3<br/>(bucket policy)"]
DGA -->|manages grants| PG_GUARD
DGA -->|pushes RLS + roles| PG_CATALOG
DGA -->|pushes bucket policy| S3
Prerequisites
- Hetzner server, PostgreSQL, Object Storage bucket. Recommendation, auto deploy with
ducklake-hetzner. - S3 credentials for each user, created manually in the Hetzner Console (no API exists for credential lifecycle)
- SSH access to the PostgreSQL server (for
dga init)
Quick start
dga env > .env
# Fill in credentials
dga init # create guard DB, schema, enable RLS
dga user create tim \
--access-key <KEY> \
--project-id <PID> # register user, create catalog role
dga allow tim --table customer --read-only
dga allow tim --table orders --read-write
duckdb -init init-tim.sql # verify: SHOW TABLES, SELECT, INSERT
dga deny tim --table orders # revoke access
dga user delete tim # remove user, scrub policies, drop role
CLI quick reference
| Command | Description |
|---|---|
dga init |
Create guard DB, schema, pg_hba, enable RLS |
dga user create <name> |
Register user + S3 creds, create catalog role |
dga user delete <name> |
Remove user, scrub policies, drop role |
dga allow <user> --table T |
Grant read-only or read-write access |
dga deny <user> --table T |
Revoke table access |
dga sync |
Converge S3 + RLS to match grant state |
Documentation
- Architecture: enforcement layers, transaction flow, sync convergence, module dependencies
- Usage: setup, user management, granting and revoking access, DuckDB verification
- Schema: database tables, generated columns, composite keys
- Design decisions: why separate Hetzner projects, RLS limitations, policy size bundling
- Development: running tests, linting, pre-commit checklist
Project details
Release history Release notifications | RSS feed
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 ducklake_guard-0.1.0.tar.gz.
File metadata
- Download URL: ducklake_guard-0.1.0.tar.gz
- Upload date:
- Size: 47.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f63378318902d1986429cee9f1cd590bf5c2f7f459352fc4ad1cbf007b1f11ca
|
|
| MD5 |
cff6e2436a63862673e78dde5db3c2f0
|
|
| BLAKE2b-256 |
f40f2a04221855ebaf6f6c4be48a261fa994f2dc1e998625cb9bdddc6115ee5f
|
Provenance
The following attestation bundles were made for ducklake_guard-0.1.0.tar.gz:
Publisher:
publish.yml on berndsen-io/ducklake-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_guard-0.1.0.tar.gz -
Subject digest:
f63378318902d1986429cee9f1cd590bf5c2f7f459352fc4ad1cbf007b1f11ca - Sigstore transparency entry: 1164503357
- Sigstore integration time:
-
Permalink:
berndsen-io/ducklake-guard@cedb27a7a9e4ab2859bbb7ec3b52c50b994afb69 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/berndsen-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cedb27a7a9e4ab2859bbb7ec3b52c50b994afb69 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ducklake_guard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ducklake_guard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca65ff1e204cdf698f28c478fbc530b441902b74422bc81e5a17183d835a973f
|
|
| MD5 |
de9fe27483bf2c849df4becbf44cf51d
|
|
| BLAKE2b-256 |
d32dec830ce337630a49fffb37bd3c4521a9d6f370c155bc8c4c9252c8d3de56
|
Provenance
The following attestation bundles were made for ducklake_guard-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on berndsen-io/ducklake-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_guard-0.1.0-py3-none-any.whl -
Subject digest:
ca65ff1e204cdf698f28c478fbc530b441902b74422bc81e5a17183d835a973f - Sigstore transparency entry: 1164503448
- Sigstore integration time:
-
Permalink:
berndsen-io/ducklake-guard@cedb27a7a9e4ab2859bbb7ec3b52c50b994afb69 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/berndsen-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cedb27a7a9e4ab2859bbb7ec3b52c50b994afb69 -
Trigger Event:
push
-
Statement type: