rowstile

v0.1.0-beta.5
io.github.rowstile/rowstile Checked 3 hours ago Published 12 days ago

Check, test, prove and review a rowstile policy: access rules for Postgres row-level security

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

check rowstile check

Compile the policy without a database and report its first mistake, with the file, line and code.

ParameterTypeDescription
policystringthe policy file (default: rowstile.toml's `policy`)

prove rowstile prove

Check every invariant of the policy in many small worlds (no database): the smallest counterexample, or that none was found.

ParameterTypeDescription
policystringthe policy file (default: rowstile.toml's `policy`)
worldsintegerhow many worlds to try (default 400)

review rowstile review

What the policy change since a git ref does: meaning, access, risk, tests and deploy (the pull request comment, as markdown). Needs git.

ParameterTypeDescription
basestringthe ref to compare with (default: main)
policystringthe policy file (default: rowstile.toml's `policy`)

test rowstile test

Run the policy's tests, the test files rowstile.toml names (or these), and the invariants, on the database; nothing stays. With coverage, the branches of each permission no test makes true.

ParameterTypeDescription
coverageboolean
filesarraytest files (default: rowstile.toml's `tests`)

why rowstile why

Whether someone holds a permission on an object, and why; if not, why not, and the smallest changes to the data that would grant it (each tried on the database and undone).

ParameterTypeDescription
as *stringwho asks: user:42, bot:7 (a principal type and id), or anyone
id *string
perm *stringa permission of the type, e.g. view
type *stringthe policy's type, e.g. folder

lint rowstile lint

The ways around row-level security the database leaves open (authz.lint()): the app role owning a table, bypassing RLS, tables without rules, grants on masked columns, ...

push rowstile push

Bring the development database to the policy, with the migration production would get. Only a database marked as a development database (a person marks one with rowstile push --development; the first push to one with no policy marks it): production takes migrations (rowstile migrate).

ParameterTypeDescription
policystringthe policy file (default: rowstile.toml's `policy`)