Is data privacy your priority? Get a data-breach proof CRM system! Data Anonymizer is a tool designed to quickly encode data on your CRM instance, while preserving their diversity and relations between records. It allows you to quickly prepare a realistic instance for tests and demonstrations without the risk of leaking someone’s personal information.
#3115 - Can't create configuration file for our instance
When running the php vendor/bin/robo anonymization:gen-def command, I get the following error message:
ERROR: Undefined variable: name in /suitecrm/custom/include/DataAnonymizer/ConfigGenerator.php:152
It seems to finish reading most (possibly all) modules, up as far as a custom developed module. It pulls down three of the four text fields correctly, but stops just before the field, 'vendor varchar(100) utf8_general_ci'.
Please advise on how to overcome this.
4 years ago
Hello,
What version of Mautic and SuiteCRM you use? What version of PHP?
Best regards, Maciej Jankiewicz eVolpe Support Team
4 years ago
I mean what version of Data Anonymizer and SuiteCRM of course.
4 years ago
We are using SuiteCRM 7.11.15 and PHP Version 7.4.10.
4 years ago
Hello,
Thanks for information. Below you will find part of documentation. I think it should help. Let me know.
3. Create your own configuration After correct installation of Data Anonymizer package in the instance directory
custom/include/DataAnonymizer/config/default
there are files with default package configuration.
modules.php The main configuration file containing the CRM database data structure in the $ modules array, where each module represents a separate array with field information. Each field is assigned a parameter for the Anonymizer. e.g. $modules = array( 'Accounts' => array( //nazwa modułu do zanonimizowania 'name' => array( //nazwa pola "class_name" => "AccountNameAnonymizer", //nazwa klasy zmieniającej dane [1] "priority" => true, //parametr kolejności nadpisywania pól [2] "fill_if_empty" => true, //parametr pozwalający na wypełnienie pustych pól [3] ), ), ); [1] required, provide the name of the class that will change the data (list of classes) [2] optional, takes the value true or false (default); fields with assigned value true will be anonymized first [3] optional, takes the value true or false (default); fields assigned the value true will be populated with random data, even if they are empty in the input
By default modules.php file contains selected fields from the 'Contractors', 'Contacts', 'Leads', 'Positions of Opportunity' (SugarCRM) modules. Running Anonymizer without the --config parameter will randomly overwrite only the selected data.
truncate_patterns.php The file contains an array of the names of the database tables to be cleared by Anonymizer. It is possible to specify exact table names as well as use SQL patterns (e.g.% _audit)
descriptions.php The file contains an array of text strings used by the LoremIpsumAnonymizer class
tickers.php The file contains an array of numbers used by the NIPAnonymizer class
demoData.php The file contains tables with a list of countries and abbreviations of state names used by the CountryAddressAnonymizer and StateAddressAnonymizer classes
short_texts.txt The file contains random words used by the ShortTextAnonymizer class
module_save_params.php The file contains a list of parameters for saving records in an anonymized database, allowing e.g. to disable auditing, add records to favorites, etc.
Each CRM instance, especially prepared and adapted to the client's needs, has its own specific database structure. In order for anonymization not to omit such records, it is necessary to prepare an individual configuration of the Data Anonymizer package.
3.1 Create your own configuration directory The directory name is the configuration name for the --config parameter on the command that invokes the anonymization. Create a directory for the configuration:
sudo -u www-data mkdir custom/include/DataAnonymizer/config/
e.g.
sudo -u www-data mkdir custom/include/DataAnonymizer/config/MyConfig
3.2 Reading data structure and writing to modules.php
In the directory with our configuration, you need to create the modules.php file with the structure of the anonymized CRM database read by DataAnonymizer (commands in the root directory of the instance):
sudo -u www-data php vendor/bin/robo anonymization:gen-def > custom/include/DataAnonymizer/config//modules.php
In our example:
sudo -u www-data php vendor/bin/robo anonymization:gen-def > custom/include/DataAnonymizer/config/MyConfig/modules.php
In order for the created configuration file to be read by DataAnonymizer, it must be completed with the php header and ended with a semicolon. In any editor, e.g. vim, nano, edit the file
custom/include/DataAnonymizer/config//modules.php
Creating Anonymizer configuration //zmiana nagłówka array ( 'Calls' => array ( 'name' => array ( 'class_name' => 'ShortTextAnonymizer', 'priority' => true, 'lbl' => 'Temat:',
<...ZAWARTOŚĆ PLIKU...>
), ) //dodanie średnika
gdzie zmieniamy:
<?php $modules = array ( 'Calls' => array ( 'name' => array ( 'class_name' => 'ShortTextAnonymizer', 'priority' => true, 'lbl' => 'Temat:',
<...ZAWARTOŚĆ PLIKU...>
), );
3.3 Editing anonymization parameters
DataAnonymizer will use the sample (default) patterns in the /config/default _directory. To use your own anonymization patterns, you can put _truncate_patterns.php, descriptions.php, tickers.php, demoData.php, short_texts.txt, module_save_params.php files modified as needed in the directory with our configuration.
Best regards, Maciej Jankiewicz
4 years ago
Where can I get the full documentation? The information you sent me is not available on the 'Docs' tab on this site.
Following your (partial) instructions above, I created the modules.php file in my configuration folder; however, the file starts with 42 instances of the following error message: :Notice: Undefined variable: name in /suitecrm/custom/include/DataAnonymizer/ConfigGenerator.php on line 152:" Then it has ~1,600 lines of configuration information. Followed by, "ERROR: Undefined variable: name 1664 in /suitecrm/custom/include/DataAnonymizer/ConfigGenerator.php:152"
Maybe I'm not completing a requirement outlined in steps 1 and 2 of your documentation (which, again, I don't have)?
Thank you. Feargal
4 years ago
Feargal,
I sent you this documentation by e-mail. It is still being developed, therefore it is not yet available to the public. Let me know if it will be helpful.
Regards, Maciej Jankiewicz