CheckOps
Greenmask
Greenmask is an Apache-2.0 open-source tool for logical database dumping, anonymisation, subsetting, synthetic data generation and restoration, production-ready for PostgreSQL with MySQL in beta.
- Test Data
- Test Data Management
- Data Masking
- Synthetic Data
- Open source
- Free
- Golang
- Command Line
- Integration testing
- Security testing
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
Greenmask describes itself as ‘a powerful open-source utility for logical database dumping, anonymization, synthetic data generation, and restoration’, according to its README. It is designed for PostgreSQL, where it is production-ready, and MySQL, which is a work in progress in beta. It is stateless and creates logical backups compatible with standard tools such as pg_dump and mysqldump.
The core idea is to act as a proxy around logical dumps. Greenmask reads data from the source database, applies transformations defined in a YAML configuration to sensitive columns, and writes a dump that standard restore tools can load. Because transformations happen during the dump, the masked copy never contains raw personal data, and the production database itself is not modified.
Transformations are rich. Built-in transformers replace values with random or realistic data, hash them, mask parts of strings, add noise to numbers and dates, or set values from templates. Deterministic transformation uses hash functions so the same input always gives the same output, which keeps joins and foreign keys consistent across tables and across repeated runs. Dynamic parameters let a transformer depend on other columns, for example keeping created_at earlier than updated_at. Conditions apply transformations only to rows that meet criteria, and transformation inheritance automatically applies rules to partitioned tables and foreign key references. Custom transformers can be written in any language or with templates.
Database subsetting creates smaller, referentially intact databases for development, with support for cyclic and polymorphic references, which is often the hardest part of building realistic test databases from production. Storage is agnostic: dumps can be written to local directories or S3-compatible storage such as AWS S3, MinIO or GCS. Greenmask uses native database drivers for encoding and decoding to preserve type safety, and ships as a single cross-platform binary and Docker image.
The README lists four use cases: sensitive data sanitisation for staging, analytics and testing; backup and restore as a drop-in replacement for pg_dump/pg_restore and mysqldump; local development with lightweight subsets; and synthetic data generation from scratch using the CMD transformer and custom transformations. Release v0.2.26 shipped in October 2026, with commits in November 2026, and the project has about 1,800 GitHub stars.
In the quality loop, Greenmask sits at the integration stage, feeding staging, QA and developer environments with realistic but safe data, and supports security and privacy requirements such as keeping production PII out of test systems.
The source code is at GreenmaskIO/greenmask on GitHub under the Apache-2.0 licence, with about 1,800 stars; the most recent commit was on 6 November 2026.
Masking is only as good as its coverage, so teams adopting Greenmask should add a review step whenever the schema changes: a new column holding phone numbers or free-text notes can leak data if no transformer is assigned.
Features
- Logical dump proxy: Compatible with pg_restore and standard tools.
- Rich transformers: Random, hash, mask, noise and template values.
- Deterministic masking: Consistent output for joins and repeated runs.
- Dynamic parameters: Keep related columns logically consistent.
- Conditional rules: Transform only matching rows.
- Transformation inheritance: Partitions and foreign keys handled.
- Subsetting: Referentially intact smaller databases.
- S3-compatible storage: Local, AWS S3, MinIO, GCS.
- Custom transformers: Any language or templates.
- Single binary: Cross-platform with a Docker image.
Pros
- Open source and free: No licence costs.
- Production stays untouched: Masks during dump.
- Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 6 November 2026.
Cons
- PostgreSQL first: MySQL support is beta.
- Configuration effort: Rules must cover every sensitive column.
- Pre-1.0: Version 0.2.x; check upgrade notes.
Usage and Links (Example)
# greenmask config (excerpt)
dump:
transformation:
- schema: public
name: users
transformers:
- name: Hash
params:
column: email
# see the docs for the full list of transformers
greenmask --config config.yml dump
greenmask --config config.yml restore latest
Practical tips:
- Inventory sensitive columns first and review the config like code.
- Use deterministic transformers for keys that join across tables.
- Combine subsetting with masking to keep developer databases small.
- Try the sandbox:
docker-compose run greenmaskfrom the repository.
Resources:
Pricing
Greenmask is free and open source under the Apache-2.0 licence.
Recommended for?
- PostgreSQL teams needing safe, realistic test databases.
- Platform teams building self-service staging refreshes.
- Not a fit for databases other than PostgreSQL or (beta) MySQL.
Conclusion
Greenmask is a strong open-source option for masking and subsetting PostgreSQL data during dumps, with thoughtful features for consistency and referential integrity.
Plan time to model every sensitive column, and treat the configuration as a reviewed, versioned artefact.
On CheckOps, Greenmask is filed under the Integration testing and Security testing stages. Related tools listed here include PostgreSQL Anonymizer, Tonic Structural, Delphix, DATPROF, K2view Test Data Management and Testcontainers. Before choosing, compare them on licence, supported languages and platforms, hosting model, and how well each fits your existing CI pipeline. Facts on this page were checked against the official website, documentation and repository on 11 November 2026; statements the vendor makes about its own product are marked as vendor claims.
Compare
CheckOps pages that put Greenmask next to related tools. There is no paid placement on these lists.
Roundups
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with Greenmask side by side.
PPostgreSQL AnonymizerPostgreSQL Anonymizer is an extension from Dalibo, released under the PostgreSQL Licence, that masks or replaces personal and sensitive data inside PostgreSQL using declarative rules, with static, dynamic and replica masking and anonymous dumps.Compare with Greenmask
TTonic StructuralTonic Structural is a commercial test data management product from Tonic.ai that de-identifies, subsets and synthesizes structured and semi-structured data from production into safe, production-like test data.Compare with Greenmask
DDelphixDelphix, now part of Perforce, is a commercial DevOps data platform combining data virtualization, automated masking, AI-powered synthetic data generation and test data management for enterprises.Compare with Greenmask
DDATPROFDATPROF is a commercial test data management suite from the Netherlands for data masking, synthetic data generation, subsetting, automation and self-service provisioning, with products Privacy, Subset, Runtime, Analyze and Virtualize.Compare with Greenmask
KK2view Test Data ManagementK2view Test Data Management is a commercial entity-based TDM product that integrates data from many sources, masks PII, subsets, generates synthetic data and provisions test data through a self-service portal, API and agents.Compare with Greenmask
TTestcontainersTestcontainers starts throwaway Docker containers from tests so integration tests can use real databases, brokers, and browsers.Compare with Greenmask