This major beta release introduces new features and refactored transformers, significantly enhancing Greenmask's flexibility to better meet business needs. Help us improve GreenMask and tailor it to meet community needs. We welcome your feedback in the release discussion on GitHub.
Greenmask is a versatile open-source tool for database backup, anonymization, and restoration. Written in pure Go with ported PostgreSQL libraries, it is platform-independent and stateless, requiring no schema modifications. It is customizable and compatible with existing PostgreSQL utilities.
random or hash engine making it universal for any use case.If you want to run a Greenmask playground for the beta version execute:
git checkout tags/v0.2.0b1 -b v0.2.0b1
docker-compose run greenmask-from-source
cast_to. These functions cover frequent operations such as UnixTimestampToDate and IntToBool.Introduced transformation engines
random - generates transformer values based on pseudo-random algorithms.hash - generates transformer values using hash functions. Currently, it utilizes sha3 hash functions, which are secure but perform slowly. In the stable release, there will be an option to choose between sha3 and SipHash.Parametrizer interface, now implemented for both dynamic and static parameters.Driver initialization logic.Driver.Parametrizer interface.TransformationContext, as the first step towards enabling new feature transformation conditions (#34).Documentation has been significantly refactored. New information about features and updates to transformer descriptions have been added.
RandomEmail - Introduces a new transformer that supports both random and deterministic engines. It allows for flexible email value generation; you can use column values in the template and choose to keep the original domain or select any from the domains parameter.
NoiseDate, NoiseFloat, NoiseInt - These transformers support both random and deterministic engines, offering dynamic mode parameters that control the noise thresholds within the min and max range. Unlike previous implementations which used a single ratio parameter, the new release features min_ratio and max_ratio parameters to define noise values more precisely. Utilizing the hash engine in these transformers enhances security by complicating statistical analysis for attackers, especially when the same salt is used consistently over long periods.
NoiseNumeric - A newly implemented transformer, sharing features with NoiseInt and NoiseFloat, but specifically designed for numeric values (large integers or floats). It provides a decimal parameter to handle values with fractions.
RandomChoice - Now supports the hash engine
RandomDate, RandomFloat, RandomInt - Now enhanced with hash engine support. Threshold parameters min and max have been updated to support dynamic mode, allowing for more flexible configurations.
RandomNumeric - A new transformer specifically designed for numeric types (large integers or floats), sharing similar features with RandomInt and RandomFloat, but tailored for handling huge numeric values.
RandomString - Now supports hash engine mode
RandomUnixTimestamp - This new transformer generates Unix timestamps with selectable units (second, millisecond, microsecond, nanosecond). Similar in function to RandomDate, it supports the hash engine and dynamic parameters for min and max thresholds, with the ability to override these units using min_unit and max_unit parameters.
RandomUuid - Added hash engine support
RandomPerson - Implemented a new transformer that replaces RandomName, RandomLastName, RandomFirstName, RandomFirstNameMale, RandomFirstNameFemale, RandomTitleMale, and RandomTitleFemale. This new transformer offers enhanced customizability while providing similar functionalities as the previous versions. It generates personal data such as FirstName, LastName, and Title, based on the provided gender parameter, which now supports dynamic mode. Future minor versions will allow for overriding the default names database.
Added tsModify - a new template function for time.Time objects modification
Introduced a new RandomIp transformer capable of generating a random IP address based on the specified netmask.
Added a new RandomMac transformer for generating random Mac addresses.
Deleted transformers include RandomMacAddress, RandomIPv4, RandomIPv6, RandomUnixTime, RandomTitleMale, RandomTitleFemale, RandomFirstName, RandomFirstNameMale, RandomFirstNameFemale, RandomLastName, and RandomName due to the introduction of more flexible and unified options.