Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>MaskItNew to Visual Studio Code? Get it now.
MaskIt

MaskIt

Donald Chan

|
1 install
| (0) | Free
Protect sensitive data instantly - mask PII in CSV, JSON, and XML files with customizable rules before sharing or distributing
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MaskIt - Data Masking Extension for VS Code

Protect sensitive data instantly - mask PII in CSV, JSON, and XML files with customizable rules before sharing or distributing.

Features

  • Multiple File Formats: Support for CSV, JSON, and XML files
  • Flexible Rules: Define masking rules based on column headers or XML/JSON tags
  • Value Pattern Rules: Use regex patterns to mask values regardless of field names
  • Multiple Masking Types: Full, partial, hash, or random-based masking
  • Wildcard Patterns: Use * wildcards to match multiple field names
  • Field Exclusions: Exclude specific fields from masking (e.g., IDs, timestamps)
  • Preview Mode: Preview masked data before applying changes
  • Auto-detect Delimiters: Automatically detects CSV delimiters
  • Context Menu Support: Right-click access from both editor and file explorer

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "MaskIt"
  4. Click Install

From Source

  1. Clone this repository
  2. Run npm install
  3. Run npm run compile
  4. Press F5 to launch the extension in debug mode

Quick Start

  1. Open a data file (CSV, JSON, or XML)
  2. Run command: MaskIt: Edit Masking Rules
  3. Add rules for fields you want to mask
  4. Run command: MaskIt: Mask Data in Current File

Commands

  • MaskIt: Mask Data in Current File - Apply masking rules to the active file
  • MaskIt: Mask Data and Save As... - Mask and save to a new file
  • MaskIt: Edit Masking Rules - Add, edit, or remove masking rules
  • MaskIt: Preview Masked Data - Preview without modifying the file

Masking Types

Type Description Example
Full Replace all characters John Smith → **********
Partial Show first/last N characters john@email.com → jo***om
Hash SHA-256 hash (first 8 chars) SSN-123 → a3f8b2c1
Random Random alphanumeric (preserves structure) 555-1234 → 382-9471

Field Exclusions

Prevent specific fields from being masked, even if they match other rules:

  • Case-insensitive: id matches ID, Id, iD
  • Substring matching: id excludes user_id, customer_id, record_id
  • Normalized matching: Ignores underscores, spaces, and dashes

Common Use Cases

  • Exclude identifier fields: id, uuid, key
  • Exclude timestamps: timestamp, created, updated
  • Exclude system fields: version, status, type

To manage exclusions, run MaskIt: Edit Masking Rules and select "Add Excluded Field" or "Remove Excluded Field".

Value Patterns (Regex)

Mask values based on their content using regular expressions, regardless of field names. This is useful for masking data where the field names are inconsistent or unknown.

Example Patterns

Pattern Name Regex Matches
Email [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} user@example.com
SSN \d{3}-\d{2}-\d{4} 123-45-6789
Credit Card \d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4} 4111-1111-1111-1111
Phone \d{3}[-.)\s]?\d{3}[-.\s]?\d{4} 555-123-4567

How It Works

  1. Value patterns are checked after field-based rules
  2. If no field name or pattern rule matches, value patterns are applied
  3. Any value matching the regex will be masked according to the pattern's settings
  4. Works across all file types (CSV, JSON, XML)

To add a value pattern, run MaskIt: Edit Masking Rules and select "Add Value Pattern (Regex)".

Documentation

  • User Guide - Detailed usage instructions
  • Configuration Guide - Settings and configuration options
  • Examples - Usage examples for different file types

Repository

  • GitHub: https://github.com/dwmchan/data-masking-extension
  • Issues: https://github.com/dwmchan/data-masking-extension/issues

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft