← Tous les utilitaires

NSAdaMask

Version 26.1 (build 393) Essai 30 jours

Cette documentation n’existe pas encore en français : affichage en anglais.

Sommaire

What NSAdaMask is

nsadamask is Nacarsoft’s deterministic multi-country masking utility for Adabas: it replaces personal data with fictitious values that are valid and format-preserving (DNI, CPF, RUT, SSN, passport, CIF, CUIT, IBAN, cards, IP, MAC, license plates…), so test and development environments comply with data protection rules without breaking application validation. It is deterministic: the same original value with the same seed (-seed) always produces the same replacement.

  • Build test environments with realistic but not real data.
  • Meet GDPR/local data-protection rules in development without rewriting validations.
  • Simulate before applying (-simulate, enabled by default) with a per-field report.

DBIDs, FNRs, fields and paths in the examples are fictitious; use your real values.

Use cases

1. Mask an employee file for the test environment

./nsadamask -dbid 50 -fnr 15 -fields "AA:DNI,AB:NAME" -country ES \
  -seed fictitious-key-01 -simulate -outfile report.csv

2. Apply masking after validating the simulation

./nsadamask -dbid 50 -fnr 15 -fields "AA:DNI,AB:NAME" -country ES \
  -seed fictitious-key-01 -apply -commit-every 2000

3. Mask only an ISN range with Adabas selection

./nsadamask -dbid 50 -fnr 15 -fields "AC:EMAIL" -country ES \
  -seed fictitious-key-01 -search "AA=[1000:1999]" -fromisn 1000 -toisn 1999 -simulate

4. Detect candidates with the heuristic before masking

./nsadamask -config fictitious-schema.json -ddmname FICTITIOUS-CUSTOMERS -analyze-config

5. Check per-field original-vs-replacement cardinality

./nsadamask -dbid 50 -fnr 15 -fields "AA:DNI" -country ES \
  -seed fictitious-key-01 -check -simulate

Command reference

Verified against ./nsadamask/build/nsadamask_rhel8 --help (39 parameters).

Connection and record selection

ParameterDescriptionRequired
-dbidAdabas database IDYes
-fnrFile number to mask (overridden by -ddmname with -config)Yes, unless -ddmname
-ddmnameLogical DDM file name from the -config JSONNo
-configJSON configuration file with the Adabas schemaYes, with -ddmname
-searchRecord selection using Adabas syntax (short or DDM names)No
-sortbyDescriptor/superdescriptor for logical read orderNo
-fromisnStarting ISN for sequential readNo
-toisnEnding ISN for sequential readNo
-etidETID (External Transaction ID) for the connectionNo
-partialreadPartial read mode (only queried fields)No
-blocksizeBlock size for Adabas reads (default 65536)No
-multifetchMultifetch size for Adabas reads (default 200)No
-recordbuffershiftRecord buffer shift for Adabas reads (default 100)No

What to mask

ParameterDescriptionRequired
-fieldsFields to mask: SHORT:TYPE[:COUNTRY] or DDM_NAME:TYPE[:COUNTRY], comma separated. E.g. -fields "AA:DNI,BB:NAME,CC:CPF". Per-field country overrides -country (ISO 3166-1 alpha-2)Yes
-countryDictionary/format-validation country: ES, AR, US, BR, CL, MX (default ES)No
-seedMaster seed for deterministic maskingYes, for -apply
-skip-emptySkip records whose masked fields are emptyNo
-skip-if-maskedSkip values that no longer match the type format (already anonymized; default true)No

Modes: simulation, apply and analysis

ParameterDescriptionRequired
-simulateSimulation mode (default true): report what would change, write nothingNo
-applyApply mode: write masked values back to Adabas (requires -seed and a valid license)No
-checkReport original-vs-replacement cardinality per fieldNo
-analyze-configAnalyze the -config JSON (DDMs) and suggest masking candidate files/fields (heuristic, no connection)No
-commit-everyCommit every N records in apply mode (default 5000)No

Simulation report

ParameterDescriptionRequired
-outfileSimulation log file (CSV: ISN,field,original,replacement)No
-outfile-max-mbAbort the simulation when the log exceeds this size in MB (0 = unlimited)No
-write-factorApply-time estimate multiplier over read time in simulate mode (default 2)No

Dictionaries

ParameterDescriptionRequired
-dictdirDirectory with anonymized CSV dictionaries (one file per type, TYPE_CC.csv; default dicts)No
-dictExplicit mapping TYPE=path.csv (repeatable)No
-dict-delimDictionary CSV delimiter (default auto-detect ; or ,)No
-dict-headerSkip the first line of each dictionary CSV (header)No
-gen-dictsWrite the dictionaries bundled in the binary into -dictdir and exitNo
-show-dictPrint the bundled dictionary values for TYPE (repeatable)No
-typesList supported masking types (English canonical + Spanish aliases) and exitNo

Diagnostics, license and miscellaneous

ParameterDescriptionRequired
-fdtShow FDT field definitions and exitNo
-debugEnable debug loggingNo
-silenceSilent mode (no banner)No
-licensePath to the signed license.key (default license.key in cwd or next to the binary)No
-license-fingerprintPrint this machine’s license fingerprint and exitNo
-versionShow version informationNo

Incompatibilities: -simulate and -apply are mutually exclusive (simulation is the default); -ddmname requires -config; -apply requires -seed.

Commented examples

# 1. Simulate first (recommended): report without writing anything
./nsadamask -dbid 50 -fnr 15 -fields "AA:DNI,AB:NAME" -country ES \
  -seed fictitious-key-01 -simulate -outfile report.csv

# 2. Apply after validating the simulation (requires a signed license)
./nsadamask -dbid 50 -fnr 15 -fields "AA:DNI,AB:NAME" -country ES \
  -seed fictitious-key-01 -apply

# 3. Brazilian field with per-field country (overrides -country for CC only)
./nsadamask -dbid 50 -fnr 15 -fields "AA:DNI,CC:CPF:BR" -country ES \
  -seed fictitious-key-01 -simulate

# 4. Partial read plus ISN range for a large subset
./nsadamask -dbid 50 -fnr 15 -fields "AC:EMAIL" -country ES \
  -seed fictitious-key-01 -partialread -fromisn 1000 -toisn 5000 -simulate

# 5. See which types exist and what a bundled dictionary holds
./nsadamask -types
./nsadamask -show-dict NAME -country ES

# 6. Suggest candidates from the schema without connecting to Adabas
./nsadamask -config fictitious-schema.json -ddmname FICTITIOUS-CUSTOMERS -analyze-config

Return codes

The manual documents no return-code table; observed binary behavior (informational 0 exits and 1 on parameter, license or connection errors, verified in the code and with --help0):

CodeMeaning
0Success (includes informational exits: -version, -types, -fdt, -gen-dicts, -analyze-config)
1Error (parameters, missing/invalid license for -apply, Adabas connection)

FAQ

Why should I simulate before applying? -simulate (the default) produces the per-field report — which values would be replaced — without writing to the database; only after validating it do you run -apply.

Why is -apply rejected on trial? Applying changes requires a signed license at /opt/ns/licenses/nsadamask.key; without one the utility runs in 30-day trial limited to simulation.

How do I repeat exactly the same masking? Reuse the same -seed: the same original value always yields the same replacement. Different seeds give non-repeatable results.

What if a field is not masked? Check the file definition (-fdt) and the type given in -fields (-types lists the supported ones); with -skip-if-masked, already-anonymized values are skipped by design.

Aussi disponible en : es