Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tiagostutz/anonymazing

Deadly simple SQL generation based data anonymization command-line utility
https://github.com/tiagostutz/anonymazing

Last synced: 22 days ago
JSON representation

Deadly simple SQL generation based data anonymization command-line utility

Awesome Lists containing this project

README

        

# Anonymazing

Deadly simple SQL generation based data anonymization command-line utility

## Overview

For example, given the following data on a Postgres table:

| Name | Email |
| ----------------------------- | --------------------------- |
| Abner Fiorelli Lyara | [email protected] |
| Abner Krystine Tramm Ariadna | [email protected] |
| Abraão Cássio Tallis Ruas | [email protected] |
| Abraão Sthefanny Delmondes | [email protected] |
| Acácia Claudiva Kauane | [email protected] |
| Acácia Craveiro Cecília Silva | [email protected] |
| Acácia Farmácia Victoria | [email protected] |
| Acácia Mickaelle Maboni | [email protected] |
| Acácia Rogéria | [email protected] |
| Acácia Vasco Panuce Fraporti | [email protected] |

After running:

```sh
$ ./anonymazing --postgres-connection-string=postgresql://postgres:123456@localhost:5432/my_database?sslmode=disable --database-table=pessoa --database-columns=name,email --output=./anonymizer_script.sql
```

The following SQL will be generated at the `anonymizer_script.sql` file.

```sql
UPDATE pessoa SET nome='Tandara Padilha' WHERE nome='Abner Fiorelli Lyara';
UPDATE pessoa SET email='[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET nome='Gaspar Edfisica3 Roberta' WHERE nome='Abner Krystine Tramm Ariadna';
UPDATE pessoa SET email='[email protected]' WHERE email='jayda.o"[email protected]';
UPDATE pessoa SET nome='Claudinei Luna Tozi' WHERE nome='Abraão Cássio Tallis Ruas';
UPDATE pessoa SET email='[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET nome='Raiane Aquino Roque' WHERE nome='Abraão Sthefanny Delmondes';
UPDATE pessoa SET email='[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET email='[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET nome='Janaína Thais Naiara Fantinato' WHERE nome='Acácia Claudiva Kauane';
UPDATE pessoa SET nome='Flávio Fraga Romulo Nicaelle' WHERE nome='Acácia Craveiro Cecília Silva';
UPDATE pessoa SET email='[email protected]' WHERE email='berneice.o"[email protected]';
UPDATE pessoa SET nome='Hariane Santos' WHERE nome='Acácia Farmácia Victoria';
UPDATE pessoa SET email='[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET nome='Marcello Reiter' WHERE nome='Acácia Mickaelle Maboni';
UPDATE pessoa SET email='aron.o"[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET nome='Kelcia Psico2 Arroyane' WHERE nome='Acácia Rogéria';
UPDATE pessoa SET email='[email protected]' WHERE email='[email protected]';
UPDATE pessoa SET nome='Yanca Sartori' WHERE nome='Acácia Vasco Panuce Fraporti';
```

## Building
Just as simples as:
```
go build .
```