Put a mask on production.
A safe, realistic stand-in for your production data, in whichever database you need it. Bauta masks what it copies, copies only the slice you need with every relationship intact, and runs from the cron you already have, with nothing to host.
pip install "bauta[postgresql,native]"From example/masking, as it ran
Customers and orders, before and after
| idkey · customer | emailemail | full_namefakeName | phonedigits | birth_datedateShift ±30d | regionkeep | notesnull |
|---|
| idkeep | customer_idkey · customer | amountnumber ±10% | full_namejoined on customer_id | regionjoined on customer_id |
|---|
customer domain: keep joins intact.
What it does
A copy of production that's safe to hand to anyone
Mask
Masks are consistent across tables and runs, and keys map one to one, with NIST FF1 where policy requires it. Values are masked before anything reaches the target, and every column must be covered.
Subset
Copy a referentially complete slice of production, such as every EU customer and everything their rows point at, loaded parents first.
Generate
Fill the tables that may not be copied at all with generated rows, and create the copy's tables in the target's own dialect.
Move
Jobs form a dependency graph and run concurrently where they can, each in its own process. They load incrementally, stream in flat memory and alert a webhook when something fails.
Fails closed
A column nobody covered stops the run
Someone adds ssn to production. The policy doesn't mention it, so the job refuses to run and staging keeps its last safe copy.
bauta discover then proposes a strategy for every column from the live schema, with its reason, for a person to review. See cover every column.
$ bauta run maskCustomers failed: MaskingError: column(s) returned by sourceQuery but not in the masking policy: ssn. staging still has 5 customers, and no ssn values $ bauta discover --connection prod --table customers id keep # numeric key (domain customers) email email # name suggests an email address full_name fakeName # name suggests a person's name phone digits # name suggests a phone number birth_date dateShift # name suggests a date of birth region keep # no sign of personal data -- review notes null # free text can hold PII anywhere ssn key # government identifier; stays unique
Where
Seven databases, in any combination
Any of them can be the source or the target. Drivers are extras, loaded only when a connection uses them, and none needs a client installed besides pip. See connections.
Databases
- Oracle
- SQL Server
- PostgreSQL
- MySQL
- MariaDB
- SQLite
- DuckDB
Files
- Parquet
- CSV
- JSON Lines
In a directory, S3, Google Cloud Storage or Azure, for Athena, Snowflake or Databricks to read. Nothing is visible until a run succeeds.
Iceberg
- Glue
- REST
- SQL catalog
Each run is one commit, and upserts merge by key. Old snapshots' files are deleted with them.
Speed
A million rows in under eight seconds
That's six masked columns, two of them one-to-one keys, on one core. The optional Rust masker produces exactly the same masks as pure Python. See make it faster.