All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Every log statement follows the same pattern where the "USER_NAME" keyword is followed by an actual username (in this example it is "Sam"). The regex pattern of this log statement will be as shown below. The Forget-Me Tool will use the below regex pattern to anonymize the username. 

    This pattern should be added to the ei-patterns.xml file (stored in the <EI_HOME>/wso2/tools/forget-me/conf/log-config/ directory).

    Code Block
    <pattern key="pattern3">
           <detectPattern>(.)*(USER_NAME)(.)*${username}(.)*</detectPattern>
           <replacePattern>${username}</replacePattern>
    </pattern>
  2. Update the config.json file (stored in the <EI_HOME>/wso2/tools/forget-me/conf/directory) as shown below. This file contains references to all the log files (except any service-specific log file) in the system that store the above user information. If you have enabled a service-specific log file, you need to add that file name (see the element descriptions given below).

    Code Block
    {
     "processors" : [ 
       "log-file"
     ],
     "directories": [
       {
         "dir": "log-config",
         "type": "log-file",
         "processor" : "log-file",
         "log-file-path" : "<EI_HOME>/repository/logs",
         "log-file-name-regex" : "(audit.log|warn.log|wso2carbon.log)(.)*"
       }
     ]
    }

    The elements in the above configuration are explained below.

    • "processors": The processors listed for this element specifies whether the tool will on log files, RDBMSs, or analytics streams. In the case of the ESB profile, we only need to remove PII from log files, and therefore, the processor is set to "log-file".
    • "directories": This element lists the directories that correspond to the processors. In the case of the ESB profile, we need to specify the directories that store log files.
    • "log-file-path": This specifies the directory path to the log files. Note that all the relevant log files are stored in the <EI_HOME>/repository/logs/ directory.

      Note

      Be sure to replace the "log-file-path" value with the correct absolute path to the location where the log files are stored. If you are on Windows, be sure to use the forward slash ("/") instead of the back slash ("\"). For example: C:/\Users/\Administrator/\Desktop/\wso2ei-6.2.0/\repository/\log.

    • "log-file-name-regex": This gives the list of log files (stored in the log-file-path) that will persist the user's PII. Note that the above log-file-name-regex includes the audit.log, warn.log, and wso2carbon.log files, as well as the archived files of the same logs. If you have enabled a service-specific log file, be sure to add the file name to this list.

  3. Open a command prompt and navigate to the <EI_HOME>/bin directory.

  4. Execute the following command to anonymize the user information that was added to the ei-patterns.xml file.
    • On Linux:

      Code Block
      ./forgetme.sh -U Sam
    • On Windows:

      Code Block
      forgetme.bat -U

    This will result in the following:

    1. Copies will be created of all the log files specified in the config.json file. The following is the format of the log copyanon-<time_stamp>-<original_log_name>.log. For exampleanon-1520946791793-warn.log.

    2. The PII will be anonymized in the copies. The log files will display the user information as a pseudonym.

      Code Block
      [EI-Core]  INFO - LogMediator USER_NAME = 86c3bfd9-f97c-4b08-9f15-772dcb0c1c
    Note

    For the list of commands you can run using the Forget-Me tool, see this link.

...

  1. Add the relevant drivers for your BPMN-specific database to the <EI_HOME>/wso2/tools/forget-me/lib directory. For example, if you have changed your BPMN database from the default H2 database to MySQL, copy the MySQL driver to this given directory.
  2. Open the activiti-datasources.xml file (stored in the <EI_HOME>/wso2/tools/forget-me/conf/datasources/ directory), and specify the details of the RDBMS that stores the metadata from BPMN workflows.
  3. Update the config.json file ( stored in the <EI_HOME>/wso2/tools/forget-me/conf/ directory) as shown below. This file contains references to all the log files in the system, and the RDBMS that stores the user information form BPMN workflows.

    Code Block
    {
     "processors" : [
       "log-file", "rdbms"
     ],
     "directories": [
       {
         "dir": "log-config",
         "type": "log-file",
         "processor" : "log-file",
         "log-file-path" : "<EI_HOME>/wso2/business-process/repository/logs",
         "log-file-name-regex" : "(audit.log|warn.log|wso2carbon.log)(.)*"
       },
       {
        "dir": "sql",
        "type": "rdbms",
        "processor" : "rdbms"
        }
     ],
     "extensions": [
       {
         "dir": "datasources",
         "type": "datasource",
         "processor" : "rdbms"
       }
     ]
    }

    The elements in the above configuration are explained below.

    • "processors": The processors listed for this element specifies whether the tool will run for log files, RDBMSs, or analytics streams. In the case of the BPMN component of the BPS profile, we need to remove PII from log files, as well as the BPMN-specific database. Therefore, the processor is set to "log-file","rdbms".
    • "directories": This element lists the directories that correspond to the processors. In the case of the BPMN component, we need to specify the directories that store log files, as well as the directory of the SQL scripts for the BPMN database. Therefore, the above configuration contains two directories: "log-config" and "sql".
    • "log-file-path": This specifies the directory path to the logs. In this example, all the relevant log files for BPS are stored in the <EI_HOME>/wso2/business-process/repository/logs/ directory. 

      Note

      Be sure to replace the "log-file-path" value with the correct absolute path to the location where the log files are stored. If you are on Windows, be sure to use the forward slash ("/") instead of the back slash ("\"). For example: C:/\Users/\Administrator/\Desktop/\wso2ei-6.2.0/\repository/\log.

    • "log-file-name-regex": This gives the list of log files (stored in the log-file-path) that will persist the user's PII. Note that the above log-file-name-regex includes the audit.log, warn.log, and wso2carbon.log files, as well as the archived files of the same logs.

  4. Open a command prompt and navigate to the <EI_HOME>/bin directory.

  5. Run the tool using the following command:

    • On Linux:

      Code Block
      ./forgetme.sh -U <USERNAME>
    • On Windows:

      Code Block
      forgetme.bat -U <USERNAME>

    This will result in the following:

    1. Copies will be created of all the log files specified in the config.json file. The following is the format of the log copyanon-<time_stamp>-<original_log_name>.log. For exampleanon-1520946791793-warn.log.

    2. The PII will be anonymized in the copies. The log files will display the user information as a pseudonym.

    3. The user's PII will be removed from the BPMN database.
    Note

    For the list of commands you can run using the Forget-Me tool, see this link.

...