Skip to content
Projects

About

Sensitive Data Management: Data Discovery and Anonymization toolkit

Security & Privacy

How these counts are measured

What you can do

  • Identifies sensitive personal data.
  • Creates plan (XML document) to define what columns should be anonymized and how.
  • Anonymizes the data.
  • Platform-independent.

Measured star growth

in 24h
Collecting history
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

License Scrutinizer Code Quality Code Coverage

Data Discovery and Anonymization toolkit

Table of content

Purpose

While performing application development, testing, or maintenance, it is important to operate in an environment that is as close to the production environment as possible when it comes to the amount of data and close-to-real content. At the same time it is important to ensure that data privacy policies are not violated.

Database, column, and file discovery identify and analyze data risks and report on potentially identifiable and personal information stored. And the database anonymization process anonymizes sensitive data and transfer information between organizations, while reducing the risk of unintended disclosure.

The complete source code is available, so you can inspect it and perform security audits if necessary.

This implementation of Data Discovery program is using Apache OpenNLP

Features

  1. Identifies sensitive personal data.
  2. Creates plan (XML document) to define what columns should be anonymized and how.
  3. Anonymizes the data.
  4. Platform-independent.
  5. Supports Oracle, MariaDB/MySQL, MS SQL Server, and PostgreSQL. Work in progress for DB2.
  6. This tool can help you be GDPR-compliant.

Prerequisites

  1. Java 21+
  2. Maven 3.6.3+ (only to build from source)

Installation

Download DataDefender-<version>.zip or DataDefender-<version>.tar.gz from the releases page and unpack it anywhere. The install contains a bin directory with the datadefender and datadefender.bat launchers, and a lib directory with DataDefender.jar.

Add the bin directory to your PATH, or link the launcher from a directory that's already on it:

ln -s /path/to/DataDefender-3.0.0/bin/datadefender ~/.local/bin/datadefender

The launcher finds the install by following that link. If you copy the script somewhere instead, set the DATADEFENDER_HOME environment variable to the install directory.

Projects then only need their own files (argument files, requirement files and so on), and datadefender is run from the project's directory. See Extensions for project-specific extensions and lib directories.

Build from source

  1. Clone the repository, or download and unpack its source
  2. cd {dir}/DataDefender/
  3. mvn package
  4. The install is created at target/DataDefender-<version>/, with .zip and .tar.gz archives of it alongside. The install can be run in place or copied anywhere.

Including JDBC Drivers

The MariaDB, PostgreSQL and SQL Server drivers are always included, along with sqlite-jdbc for file discovery. The MariaDB driver also connects to most MySQL servers. The MySQL Connector/J and Oracle drivers aren't included in release downloads because of their licenses: download the driver's jar file and copy it into the install's lib directory to use it from every project, or into a lib directory in a project's directory to use it only there.

When building from source, the MySQL and Oracle drivers can instead be built into the jar by activating the mysql or oracle maven profiles, or both with the jdbc-drivers-all property:

mvn package -P mysql
mvn package -P oracle
mvn package -Djdbc-drivers-all

Extensions

The datadefender launcher adds two directories from the current working directory (normally a project's directory) to the classpath, so a project can carry its own code and libraries:

  • extensions: jar files and classes that extend DataDefender for the project, for example additional anonymization or discovery routines.
  • lib: additional jar files, such as a JDBC driver or libraries an extension needs.

Jar files in the install's own lib directory are available to every project.

See sample_projects/anonymizer/ for an example.

Contributing

We encourage you to contribute to DataDefender! Please check out the Contribution guidelines for this project.

How to run

The toolkit is implemented as a command line program. Once it's installed, you can get help by running 'datadefender' or 'datadefender.bat' in your shell/command prompt:

datadefender help

Usage: datadefender [-hvV] [--debug] COMMAND
Data detection and anonymization tool
      --debug     Enable debug logging in log file
  -h, --help      Show this help message and exit.
  -v, --verbose   Enable more verbose console output, specify two -v
                            for console debug logging
  -V, --version   Print version information and exit.
Commands:
  help       Displays help information about the specified command
  anonymize  Run anonymization utility
  extract    Run data extraction utility -- generates files out of table
               columns with the name 'table_columnName.txt' for each column
               requested.
  discover   Run data discovery utility
  test-requirement  Loads the requirement file without attempting to anonymize
                      or process anything to check for syntax issues

The toolkit can be run in anonymizer mode, data extraction mode (extract), and three different discovery modes (file, column, and database discovery).

Using argument files

DataDefender is using picocli as its framework for processing command-line input. The framework allows using argument files to set argument values when running the tool. The argument file contains a list of arguments to pass (more than one can be used), and when invoking DataDefender, the argument file can be specified with an "@". For example:

File: database.config

--url=jdbc:mariadb://localhost:3306/database?zeroDateTimeBehavior=convertToNull
--password
--user=root

Running with database.config:

datadefender @database.config

File Discovery

datadefender discover files

Usage: datadefender discover files ([-l=<limit>] [-e=<extensions>]
                                   [-e=<extensions>]...
                                   [--model-file=<fileModels>]
                                   [--model-file=<fileModels>]...
                                   [--token-model=<tokenModel>]
                                   [--probability-threshold=<probabilityThreshold>]
                                   [--[no-]score-calculation]
                                   [--threshold-count=<thresholdCount>]
                                   [--threshold-high=<thresholdHighRisk>]
                                   [-m=<models>] [-m=<models>]...) [-hvV]
                                   [--debug] -d=<directories>
                                   [-d=<directories>]... -x=<excludeExtensions>
                                   [-x=<excludeExtensions>]...
Run file discovery utility
  -d, --directory=<directories>
                         Adds a directory to list of directories to be scanned
      --debug            Enable debug logging in log file
  -h, --help             Show this help message and exit.
  -v, --verbose          Enable more verbose console output, specify two -v
                            for console debug logging
  -V, --version          Print version information and exit.
  -x, --exclude-extension=<excludeExtensions>
                         Adds an extension to exclude from data discovery
Model discovery settings
  -e, --extension=<extensions>
                         Adds a call to an extension method (e.g. com.strider.
                           datadefender.specialcase.SinDetector.detectSin)
  -l, --limit=<limit>    Limit discovery to a set number of rows in a table
  -m, --model=<models>   Adds a built-in configured opennlp TokenizerME model
                           for data discovery. Available models are: date,
                           location, money, organization, person, time
      --model-file=<fileModels>
                         Adds a custom made opennlp TokenizerME file for data
                           discovery.
      --[no-]score-calculation
                         If set, includes a column score
      --probability-threshold=<probabilityThreshold>
                         Minimum NLP match score to return results for
      --threshold-count=<thresholdCount>
                         Reports if number of rows found are greater than the
                           defined threshold
      --threshold-high=<thresholdHighRisk>
                         Reports if number of high risk columns found are
                           greater than the defined threshold
      --token-model=<tokenModel>
                         Override the default built-in token model (English
                           tokens, en-token.bin) with a custom token file for
                           use by opennlp's TokenizerModel

File discovery will attempt to find sensitive personal information in binary and text files located on the file system.

Sample project can be found here: sample_projects/file_discovery

Column Discovery

datadefender discover columns

Usage: datadefender discover columns [[-u=<username>] [-p[=<password>]]
                                     [--schema=<schema>]
                                     [--[no-]skip-empty-tables-metadata]
                                     [--include-table-pattern-metadata=<includeTablePatterns>]
                                     [--include-table-pattern-metadata=<includeTablePatterns>]...
                                     [--exclude-table-pattern-metadata=<excludeTablePatterns>]
                                     [--exclude-table-pattern-metadata=<excludeTablePatterns>]...
                                     [--vendor=<vendor>]
                                     [--url=<url>]] [-hvV] [--debug]
                                     [-o=<outputFile>]
                                     --column-pattern=<patterns>
                                     [--column-pattern=<patterns>]...
Run column discovery utility
      --column-pattern=<patterns>
                          Regex pattern(s) to match column names
      --debug             Enable debug logging in log file
  -h, --help              Show this help message and exit.
  -o, --output=<outputFile>
                          Generate a requirements xml file and write it out to
                            the specified file
  -v, --verbose           Enable more verbose console output, specify two -v
                            for console debug logging
  -V, --version           Print version information and exit.
Database connection settings
      --exclude-table-pattern-metadata=<excludeTablePatterns>
                          Pattern(s) matching table names to exclude for
                            metadata analysis
      --include-table-pattern-metadata=<includeTablePatterns>
                          Pattern(s) matching table names to include for
                            metadata analysis
  -p, --password[=<password>]
                          The password to connect with
      --schema=<schema>   The schema to connect to
      --[no-]skip-empty-tables-metadata
                          Include generating metadata for empty tables
                            (defaults to skipping)
  -u, --user=<username>   The username to connect with
      --url=<url>         The datasource URL
      --vendor=<vendor>   Database vendor, available options are: h2, mysql,
                            mariadb, postgresql, sqlserver, oracle. If not
                            specified, vendor will attempt to be extracted from
                            the datasource url for a jdbc scheme.

In this mode the tool attempts to query your database and identified columns that should be anonymized based on their names. When -o is provided a sample requirements file (which can be modified and used for the anonymizer stage) will be created based on the columns discovered.

Note that column and data discovery can be combined. The generated requirements file will combine both results.

Data Discovery

datadefender discover data

Usage: datadefender discover data ([-l=<limit>] [-e=<extensions>]
                                  [-e=<extensions>]...
                                  [--model-file=<fileModels>]
                                  [--model-file=<fileModels>]...
                                  [--token-model=<tokenModel>]
                                  [--probability-threshold=<probabilityThreshold
                                  >] [--[no-]score-calculation]
                                  [--threshold-count=<thresholdCount>]
                                  [--threshold-high=<thresholdHighRisk>]
                                  [-m=<models>] [-m=<models>]...)
                                  [[-u=<username>] [-p[=<password>]]
                                  [--schema=<schema>]
                                  [--[no-]skip-empty-tables-metadata]
                                  [--include-table-pattern-metadata=<includeTablePatterns>]
                                  [--include-table-pattern-metadata=<includeTablePatterns>]...
                                  [--exclude-table-pattern-metadata=<excludeTablePatterns>]
                                  [--exclude-table-pattern-metadata=<excludeTablePatterns>]...
                                  [--vendor=<vendor>]
                                  [--url=<url>]] [-hvV] [--debug]
                                  [-o=<outputFile>]
Run data discovery utility
      --debug             Enable debug logging in log file
  -h, --help              Show this help message and exit.
  -o, --output=<outputFile>
                          Generate a requirements xml file and write it out to
                            the specified file
  -v, --verbose           Enable more verbose console output, specify two -v
                            for console debug logging
  -V, --version           Print version information and exit.
Model discovery settings
  -e, --extension=<extensions>
                          Adds a call to an extension method (e.g. com.strider.
                            datadefender.specialcase.SinDetector.detectSin)
  -l, --limit=<limit>     Limit discovery to a set number of rows in a table
  -m, --model=<models>    Adds a built-in configured opennlp TokenizerME model
                            for data discovery. Available models are: date,
                            location, money, organization, person, time
      --model-file=<fileModels>
                          Adds a custom made opennlp TokenizerME file for data
                            discovery.
      --[no-]score-calculation
                          If set, includes a column score
      --probability-threshold=<probabilityThreshold>
                          Minimum NLP match score to return results for
      --threshold-count=<thresholdCount>
                          Reports if number of rows found are greater than the
                            defined threshold
      --threshold-high=<thresholdHighRisk>
                          Reports if number of high risk columns found are
                            greater than the defined threshold
      --token-model=<tokenModel>
                          Override the default built-in token model (English
                            tokens, en-token.bin) with a custom token file for
                            use by opennlp's TokenizerModel
Database connection settings
      --exclude-table-pattern-metadata=<excludeTablePatterns>
                          Pattern(s) matching table names to exclude for
                            metadata analysis
      --include-table-pattern-metadata=<includeTablePatterns>
                          Pattern(s) matching table names to include for
                            metadata analysis
  -p, --password[=<password>]
                          The password to connect with
      --schema=<schema>   The schema to connect to
      --[no-]skip-empty-tables-metadata
                          Include generating metadata for empty tables
                            (defaults to skipping)
  -u, --user=<username>   The username to connect with
      --url=<url>         The datasource URL
      --vendor=<vendor>   Database vendor, available options are: h2, mysql,
                            mariadb, postgresql, sqlserver, oracle. If not
                            specified, vendor will attempt to be extracted from
                            the datasource url for a jdbc scheme.

In data discovery mode, the tool will perform an NLP scan of data in the database and return columns that have a match score greater than the value of probability-threshold. When -o is provided a sample requirements file (which can be modified and used the anonymizer stage) will be created based on the columns discovered.

Note that column and data discovery can be combined. The generated requirements file will combine both results.

Data Extractor

datadefender extract

Usage: datadefender extract ([-u=<username>] [-p[=<password>]]
                            [--schema=<schema>] [--[no-]skip-empty-tables-metadata]
                            [--include-table-pattern-metadata=<includeTablePatterns>]
                            [--include-table-pattern-metadata=<includeTablePatterns>]...
                            [--exclude-table-pattern-metadata=<excludeTablePatterns>]
                            [--exclude-table-pattern-metadata=<excludeTablePatterns>]...
                            [--vendor=<vendor>] [--url=<url>]) [-hvV]
                            [--debug] [columns...]
Run data extraction utility -- generates files out of table columns with the
name 'table_columnName.txt' for each column requested.
      [columns...]        Generate data for the specified table.columName(s)
      --debug             Enable debug logging in log file
  -h, --help              Show this help message and exit.
  -v, --verbose           Enable more verbose console output, specify two -v
                            for console debug logging
  -V, --version           Print version information and exit.
Database connection settings
      --exclude-table-pattern-metadata=<excludeTablePatterns>
                          Pattern(s) matching table names to exclude for
                            metadata analysis
      --include-table-pattern-metadata=<includeTablePatterns>
                          Pattern(s) matching table names to include for
                            metadata analysis
  -p, --password[=<password>]
                          The password to connect with
      --schema=<schema>   The schema to connect to
      --[no-]skip-empty-tables-metadata
                          Include generating metadata for empty tables
                            (defaults to skipping)
  -u, --user=<username>   The username to connect with
      --url=<url>         The datasource URL
      --vendor=<vendor>   Database vendor, available options are: h2, mysql,
                            mariadb, postgresql, sqlserver, oracle. If not
                            specified, vendor will attempt to be extracted from
                            the datasource url for a jdbc scheme.

The Data Extractor is used to load table data into text files. The text files are useful to modify and then feed into the annoymizer as input data.

Anonymizer

datadefender anonymize

Usage: datadefender anonymize ([-u=<username>] [-p[=<password>]]
                              [--schema=<schema>]
                              [--[no-]skip-empty-tables-metadata]
                              [--include-table-pattern-metadata=<includeTablePatterns>]
                              [--include-table-pattern-metadata=<includeTablePatterns>]...
                              [--exclude-table-pattern-metadata=<excludeTablePatterns>]
                              [--exclude-table-pattern-metadata=<excludeTablePatterns>]...
                              [--vendor=<vendor>] [--url=<url>])
                              [-hvV] [--debug] [-b=<batchSize>]
                              -r=<requirementFile>
                              [--disable=<name>[,<name>...]]...
                              [--enable=<name>[,<name>...]]... [tables...]
Run anonymization utility
      [tables...]         Limit anonymization to specified tables
  -b, --batch-size=<batchSize>
                          Number of update queries to batch together
      --debug             Enable debug logging in log file
      --disable=<name>[,<name>...]
                          Skip elements whose disabled attribute lists the name
      --enable=<name>[,<name>...]
                          Run elements whose enabled attribute lists the name
  -h, --help              Show this help message and exit.
  -r, --requirement-file=<requirementFile>
                          Requirement XML file
  -v, --verbose           Enable more verbose console output, specify two -v
                            for console debug logging
  -V, --version           Print version information and exit.
Database connection settings
      --exclude-table-pattern-metadata=<excludeTablePatterns>
                          Pattern(s) matching table names to exclude for
                            metadata analysis
      --include-table-pattern-metadata=<includeTablePatterns>
                          Pattern(s) matching table names to include for
                            metadata analysis
  -p, --password[=<password>]
                          The password to connect with
      --schema=<schema>   The schema to connect to
      --[no-]skip-empty-tables-metadata
                          Include generating metadata for empty tables
                            (defaults to skipping)
  -u, --user=<username>   The username to connect with
      --url=<url>         The datasource URL
      --vendor=<vendor>   Database vendor, available options are: h2, mysql,
                            mariadb, postgresql, sqlserver, oracle. If not
                            specified, vendor will attempt to be extracted from
                            the datasource url for a jdbc scheme.

In this mode, data anonymization is performed on the database based on the requirements file. The requirements file is an XML-formatted file describing which tables and columns should be anonymized, and how. For an example, refer to sample_projects/anonymizer/requirement.xml.

Each <table> lists one or more operations, run in the order they appear:

  • <anonymize> anonymizes the <columns> under it, limited to rows matching its optional <where> and not matching its <exclusions>. A column is set by a <plan> or <plan-ref>, or to a literal with <value>text</value> (converted to the column's type), or to NULL with <value null="true"/>. When every column in an <anonymize> is a literal with skip-empty="false" and no column exclusions or inclusions, it runs as a single UPDATE statement, which is much faster on large tables and doesn't need a primary key.

    For a column holding JSON, a <json> element in place of the plan anonymizes values inside it. Each <path> selects values with a JSONPath expression, e.g. $.studentId, $..essay (at any depth) or $.contacts[*].email (in each element of an array), and replaces each one with a <plan>, <plan-ref> or literal <value>. The plan is passed the selected value as its current value, so pass-current-value works as it does for columns. Paths run in order; one that matches nothing in a row is skipped. A replacement keeps the original's JSON type where it can (digits for a number stay a number, "true"/"false" for a boolean stay a boolean), key order and untouched values are kept, and objects or arrays selected by a path are left as they are. skip-empty (default true) leaves null and empty values alone. Values that aren't valid JSON are left unchanged, and counted in a warning at the end of the table. JSON values aren't truncated to fit the column, since that would make them invalid.

    <column name="form_data">
      <json>
        <path select="$.studentId">
          <plan>
            <function name="Core#randomStringFromPattern">
              <argument name="pattern" value="[0-9]{8}"/>
            </function>
          </plan>
        </path>
        <path select="$..essay">
          <plan-ref ref-id="lipsum-similar"/>
        </path>
      </json>
    </column>
    

    For a column with a unique key, set unique="true" on the <column>. Every value the column holds is loaded first, and the plan is called again whenever it returns one of those or a value already given to another row, so the key never conflicts and no row ends up with another row's real value. Values are compared ignoring case and trailing spaces, as many databases' unique keys do. If the plan can't produce an unused value in 100 tries, the run stops with an error, so a plan with too few possible values fails instead of looping. unique can't be used with a literal <value>.

  • <delete> deletes the rows matching its <where> and not matching its <exclusions> (rows matching an exclusion are kept). An empty <delete/> is rejected; use <delete all="true"/> to delete every row.

  • <execute> runs the single SQL statement it contains, e.g. to disable triggers around other operations.

  • <truncate/> removes every row with TRUNCATE TABLE, which is much faster than <delete all="true"/> on large tables. Most databases refuse to truncate a table referenced by a foreign key, and some (e.g. MySQL and Oracle) commit a truncate immediately, so it can't be rolled back; use <delete all="true"/> in those cases.

  • <insert> inserts the <row> elements under it, in order and in one transaction that's rolled back if a row fails. Each <value column="name"> holds a literal value, converted by the JDBC driver to the column's type; <value column="name" null="true"/> inserts NULL, and columns left out of a row get their default. Put an <insert> after any <anonymize> to keep its rows from being anonymized.

    To make re-running the file safe, give the <insert> a match attribute naming the column(s) that identify an existing row (comma-separated), and an if-exists attribute saying what to do when one is found: skip leaves it alone, update sets its other columns to the row's values, and error (the default) stops with an error. Each row is looked up by its own values for the match columns, so every row needs a value for each of them. With skip or update and no match, rows are matched by the table's primary key.

Each <anonymize> and <delete> has its own <where>, <exclusions> and <inclusions>. Tables are processed in the order listed, so put tables referencing another by foreign key first when deleting.

<execute> can also be placed directly under <tables>, between <table> entries, for setup and teardown statements. These always run, even when the tables to anonymize are limited on the command line, while an <execute> under a <table> is skipped along with its table. Statements run on the same connection as the other operations, so session settings carry over:

<tables>
  <execute>SET FOREIGN_KEY_CHECKS = 0</execute>
  <table name="users">
    ...
  </table>
  <execute>SET FOREIGN_KEY_CHECKS = 1</execute>
</tables>

A <table>, <anonymize>, <delete>, <insert>, <truncate/>, <execute> or <column> can be switched on or off with an enabled or disabled attribute:

  • enabled="false" switches it off without having to comment it out.
  • enabled="student-id" switches it off unless --enable student-id is passed. Several space-separated names (enabled="student-id all-ids") switch it on if any one of them is passed.
  • disabled="keep-emails" runs it unless --disable keep-emails is passed, again with any number of space-separated names.

With both attributes, the element runs only if both allow it. --enable and --disable can be repeated or take comma-separated names (--enable student-id,test-accounts), and a name that no element in the file uses is rejected, so a misspelled name doesn't silently skip anything. An <anonymize> whose columns are all switched off is skipped.

<table name="users" primary-key="id">
  <anonymize>
    <columns>
      <column name="student_id" enabled="student-id">...</column>
      <column name="email" disabled="keep-emails">...</column>
    </columns>
  </anonymize>
  <insert enabled="test-accounts" match="username" if-exists="update">...</insert>
</table>
datadefender anonymize -r requirement.xml --enable student-id,test-accounts --disable keep-emails

Exclusions and inclusions can also be set on a single <column>, where they decide whether that column's value is anonymized, and name is optional (defaulting to the column). A row or value matching any <exclude> is skipped. If there are any <include> elements, it must also match at least one of them. Each element matches if any one of its attributes does:

  • equals="value": equal to the value (an empty value matches empty strings).
  • like="pattern": matches an SQL LIKE pattern.
  • in="a,b,c": one of the listed values, split on in-separator (default ,).
  • null="true": is NULL.
<exclusions>
  <exclude name="username" in="admin,root"/>
</exclusions>
<inclusions>
  <include name="status" equals="inactive"/>
  <include name="email" like="%@example.com"/>
</inclusions>
<table name="users" primary-key="id">
  <delete>
    <where>last_login &lt; '2020-01-01'</where>
    <exclusions>
      <exclude name="username" in="admin,root"/>
    </exclusions>
  </delete>
  <anonymize>
    <columns>
      ...
    </columns>
  </anonymize>
  <insert match="username" if-exists="update">
    <row>
      <value column="username">test-admin</value>
      <value column="role_id">1</value>
      <value column="deleted_at" null="true"/>
    </row>
  </insert>
</table>

Requirement Tester

datadefender test-requirement

Usage: datadefender test-requirement [-hVv] [--debug] -r=<requirementFile>
Loads the requirement file without attempting to anonymize or process anything
to check for syntax issues
      --debug     Enable debug logging in log file
  -h, --help      Show this help message and exit.
  -r, --requirement-file=<requirementFile>
                  Requirement XML file
  -v, --verbose   Enable more verbose console output, specify two -v for
                    console debug logging
  -V, --version   Print version information and exit.

In this mode the requirements file is tested for validation by attempting to load it. If a validation error occurs, a message is printed and datadefender is stopped. If it succeeds, a success message is printed.

Logging

DataDefender uses log4j2 to log output. The default configuration logs output to both the console at a WARN level, and to a file at INFO level. The default levels can be made more verbose by running with --debug or -v/--verbose. -v can be chained to log DEBUG level to console:

datadefender -vv --debug

would log at 'debug' level to both console and file.

The default file logged to is 'logs/datadefender.log'. Each new run of DataDefender creates a new log file, and rolls the previous log file to a dated file in the format:

'logs/datadefender-%d{yy-MM-dd-hh-mm-ss}.log'

To change the default loggers and format, creating a log4j2 configuration file (log4j2(.properties|.json|.xml) in the project's directory will override the default properties file. Please refer to the default file to build off of if desired: src/main/resources/log4j2.properties. Note the use of a ThresholdFilter in the default version, and the default logLevel of "all". The ThresholdFilters are how DataDefender controls the log levels based on command-line options. Setting the loglevel to something more specific, e.g. 'info', and/or not setting up the ThresholdFilters accordingly, will cause the command-line options to not work.

Database logging

Log4j2 includes a "JdbcAppender" that can be used to configure database logging. For convenience, the additional required lib can be included the DataDefender jar file by running maven with the following profile:

mvn package -P database-logging

Don't forget to include any additional drivers needed (in this case, both for logging and for DataDefender's operations), for example:

mvn package -P database-logging,oracle

The 'database-logging' maven profile will include org.apache.commons.commons-dbcp2 in the final shaded jar. Otherwise, the commons-dbcp2.jar file could also be manually downloaded and copied to the install's 'lib' directory, or to a 'lib' directory in the project's directory.

For log4j2 JdbcAppender configuration, please refer to the log4j2 documentation: https://logging.apache.org/log4j/2.0/manual/appenders.html#JDBCAppender.

Additionally, a sample with database logging configured is available here: sample_projects/database-logging with an example log4j2.properties file defined under it.

Requirement format 3.0

Requirement files with <anonymizer-version>3.0</anonymizer-version> group what happens to a table into operations (see Anonymizer). 2.0 files are still supported unchanged: the version in the file selects the schema it's validated against (requirement-2.0.xsd or requirement-3.0.xsd). Requirement files generated by discovery are written as 3.0.

To convert a 2.0 file:

  • Change <anonymizer-version> to 3.0.
  • Wrap each table's <where>, <exclusions> and <columns> in an <anonymize> element. <primary-key> stays directly under <table>.
  • A table listed more than once with different <where> clauses can become one <table> with several <anonymize> operations.
  • Move not-equals, not-like and not-in attributes off <exclude> into <include> elements under <inclusions>, as equals, like and in. In 2.0 these were already treated as inclusions (a match on any of them is required), so the behaviour doesn't change.

Features and issues

Please report issues or ask for future requests here: https://github.com/armenak/DataDefender/issues

Code quality

Two amazing tools - Empear http://empear.com/ and SonarQube http://www.sonarqube.org/ help contributors of DataDefender maintain decent quality of code. Many thanks to their creators!

Explore related projects

Loadingโ€ฆ