Skip to content
Quickstart

.env.brume variables

Brume reads configuration from a .env.brume file in the current working directory (or from the process environment if .env.brume is absent). Two categories: secrets (mandatory) and connections (one source, one target).

Generate a template with brume init dump (SQL file sink) or brume init jdbc (PostgreSQL sink). The legacy .env filename is no longer read as of Brume 1.5.

These two values are the “additional information” of GDPR Art. 4.5 — protect them at the same level as the source data.

VariableRequiredDescription
BRUME_HMAC_SECRETyesSeeds FAKE, HASH, DATE_SHIFT, linked_columns. High-entropy string, at least 16 characters (32+ recommended).
BRUME_FPE_KEYyesKeys the FF1 cipher used by FPE_ID / FPE_UUID. Exactly 16, 24 or 32 characters.

The database Brume reads from. Use a read-only account.

VariableRequiredDescription
BRUME_SOURCE_HOSTyesHostname or IP
BRUME_SOURCE_PORTnoPort. Default 5432.
BRUME_SOURCE_DByesDatabase name
BRUME_SOURCE_USERyesUsername (read-only recommended)
BRUME_SOURCE_PASSWORDyesPassword
BRUME_SOURCE_SSLMODEnodisable · prefer · require · verify-ca · verify-full. Default prefer.
BRUME_SCHEMAyesThe schema to pseudonymize, written exactly as stored (case, accents and spaces included, no quotes). The same schema name is used on the target.

Brume supports two sink types, selected by BRUME_SINK_TYPE — brume init jdbc and brume init dump set it for you:

  • JDBC (default) — write to a live PostgreSQL target.
  • DUMP — write a .sql file, restorable with psql.
VariableRequiredDescription
BRUME_TARGET_HOSTyesHostname or IP
BRUME_TARGET_PORTnoPort. Default 5460.
BRUME_TARGET_DByesDatabase name
BRUME_TARGET_USERyesUsername (must be able to CREATE and INSERT)
BRUME_TARGET_PASSWORDyesPassword
BRUME_TARGET_SSLMODEnoSame values as source.
VariableRequiredDescription
BRUME_SINK_TYPEyesDUMP
BRUME_SINK_OUTPUT_PATHyesPath of the .sql file Brume writes (e.g. ./dumps/dump.sql.gz)
BRUME_SINK_COMPRESSIONnoNONE · GZIP · ZSTD. Default GZIP.

With the DUMP sink, the target variables are ignored and no target connection is opened. The file contains the schema (from pg_dump) and the pseudonymized rows; it never contains a row that would break a unique index, so it always restores with psql.

VariableRequiredDefaultDescription
BRUME_PARALLELISMno20Size of the connection pool.
BRUME_LOCALEnoenDatafaker locale (en, fr, de, …) — the language and formats of FAKE values.
BRUME_PIPELINE_MODEnoSTREAMINGSTREAMING (chunk by chunk, bounded memory) or BATCH (everything in memory).
BRUME_DATE_SHIFT_MAX_DAYSno30Window of DATE_SHIFT, in days.
BRUME_PGDUMP_PATHnopg_dumpThe pg_dump command to run (may be a full path).
BRUME_CONFIG_PATHnobrume.ymlPath of the rules file.
Terminal window
# --- Secrets (protect at the level of the source data) ---
BRUME_HMAC_SECRET=8aZb4...kpR9 # ≥ 16 chars (32+ recommended), high entropy
BRUME_FPE_KEY=AnotherSecret16c # 16, 24 or 32 chars
# --- Source (read-only) ---
BRUME_SOURCE_HOST=db.prod.internal
BRUME_SOURCE_DB=app_production
BRUME_SOURCE_USER=brume_reader
BRUME_SOURCE_PASSWORD=...
BRUME_SOURCE_SSLMODE=require
BRUME_SCHEMA=public
# --- Sink = JDBC (local Postgres) ---
BRUME_SINK_TYPE=JDBC
BRUME_TARGET_HOST=localhost
BRUME_TARGET_DB=app_dev
BRUME_TARGET_USER=app
BRUME_TARGET_PASSWORD=...
# --- Options ---
BRUME_PARALLELISM=8
BRUME_LOCALE=fr

Creating a read-only account on the source

Section titled “Creating a read-only account on the source”

Suggested minimal grants:

CREATE ROLE brume_reader WITH LOGIN PASSWORD '...';
GRANT CONNECT ON DATABASE app_production TO brume_reader;
GRANT USAGE ON SCHEMA public TO brume_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO brume_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO brume_reader;

Adjust the schema name if your tables live outside public.