dbrekelmans / gdpr-tools
Tools to help with GDPR compliance.
Installs: 2 778
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- doctrine/dbal: ^2.7
- fzaninotto/faker: ^1.7
- gajus/paggern: dev-master
- symfony/console: ^3.4
- symfony/yaml: ^3.4
This package is not auto-updated.
Last update: 2022-02-01 13:13:54 UTC
README
TODO
- Support presets and custom for truncate configuration
- Check if unique generated value already exists in current database (otherwise get duplicate constraint on UPDATE because we update row by row)
- Polish README
- Document yaml configuration specifications on github wiki
- Support table name prefix for configuration presets
Installation
composer require dbrekelmans/gdpr-tools
Usage
php vendor/dbrekelmans/gdpr-tools/console.php <command>
Commands
Command | Description | Arguments |
---|---|---|
db:anonymise |
Anonymises database based on a yaml configuration. | file - A yaml configuration file, must end with .yml . See Configuration for details. |
db:truncate |
Truncates database tables based on a yaml configuration. | file - A yaml configuration file, must end with .yml . See Configuration for details. |
Configuration
Types
Type | Options | Description |
---|---|---|
string |
minlength , maxlength |
Random string of a-z characters with length between minlength and maxlength . |
int |
min , max |
A random integer between min and max (inclusive). |
email |
Valid email address. | |
ip |
Valid IPv4 address. | |
regex |
pattern |
Random string based on regex pattern . |
null |
A NULL value. | |
password |
encryption |
Password with a certain encryption . |
Example
database: scheme: pdo_mysql host: 127.0.0.1 port: 3306 name: dbname user: dbuser password: dbpass truncate: - webform_submissions - webform_submissions_data anonymise: presets: - drupal8 custom: anonymise_example: email: type: name: email unique: true password: type: name: password options: encryption: sha512 name: type: name: string|null ip: type: name: ip number: type: name: int|null options: min: 0 max: 100 exclude: drupal8: users_field_data: uid: - 0 - 1 - 46 custom: anonymise_example: id: - 2 - 5 email: - example@example.com