dsh-data-scan: Sensitive Data Discovery with Checksums

Introduction

In DSH or regular repositories, test data, sample configurations, and log fragments can easily get mixed with real personal information. relying solely on visual inspection or a “quick regex scan” often leads to order numbers, timestamps, and hash fragments being mistaken for ID card numbers or bank card numbers. When false positives become too frequent, tools are often abandoned. Below is an introduction to the dsh-data-scan plugin (npm package name @deepwhale-cn/dsh-data-scan) maintained by feely0208 for DSH: it detects ID cards, bank cards, mobile phone numbers, etc., in code and configuration text, and filters them using national standard check digits or Luhn rules to reduce false positives; the report does not output the complete original value, but only provides the file location, type, and a masked fragment.

What is this

dsh-data-scan is categorized under admin-security and positioned as “Sensitive Data Discovery”—scanning for ID cards, bank cards, and mobile phone numbers in code and configurations with check digit validation, aiming for zero false positives. Repository: https://github.com/feely0208/dsh-data-scan. Community directory page: https://www.skillhub.cn/plugins/feely0208/dsh-data-scan. The current package version is 0.1.1, license is MIT, requires Node >=18, and the DSH engine requires >=0.1.0-rc.6.

It does not overlap with the same maintainer’s key-based scanning (such as capabilities involved in dsh-bundle-cn-skills): the latter checks for keys, while this one checks for Personally Identifiable Information (PII).

Detection Scope and Validation Methods

The README uses a table to illustrate the levels, types, and validation logic. The core is as follows:

Level Type Validation
High ID Card Number GB 11643-1999 Weighted Check Digit
High Bank Card Number Luhn Algorithm
Medium Mobile Phone Number Number Segment + Boundary Assertion
Low Email Structural Match (Indicative)

The implementation approach is “structure + check digit” dual verification, rather than pure regex. Comparison examples in the documentation: 18-digit ID cards with correct check digits and bank card numbers passing Luhn will be reported; changing one digit causing check failure will not be reported; 18-digit strings that do not look like mobile numbers based on length or boundaries will not be reported.

Output and Security Design

Scan results never contain the original value, reporting only “File:Line + Type + Masked Fragment”. The README explicitly states: if full sensitive values were written into the report, the scanning tool itself would become a source of leakage, hence the output side is desensitized.

Installation

In the DSH environment, it can be installed via the Web configuration profile; you can also use the CLI directly without installing the plugin.

dsh plugin --profile web add @deepwhale-cn/dsh-data-scan
# Or pure CLI
npx @deepwhale-cn/dsh-data-scan

Before installation or running, it is recommended to review the repository source code and the MIT license yourself. The plugin accesses workspace files with the permissions of the current dsh process, with a permission scope consistent with running DSH locally.

Typical Usage

After installation, the command-line entry point is dsh-data-scan (see the bin field in package.json). The usage provided in the README is as follows:

dsh-data-scan                 # Scan current directory
dsh-data-scan --demo          # See detection effects
dsh-data-scan --html r.html   # Generate HTML report

--demo is suitable for confirming rules and output formats before integrating into CI or team standards; --html facilitates archiving results for compliance or code review processes. The official README includes screenshots of reports, demo mode, and rule descriptions (deepwhale.org.cn plugin resource path).

Boundaries and Applicable Scenarios

Who it is for: Teams that need to quickly check if PII has been mixed into workspace text before committing or open-sourcing; when combined with key scanning, environment auditing, and other plugins, it serves as a link in the “Data and Credentials” chain (the maintainer lists it as a sensitive data item in the Deep Whale Cybersecurity Guard series).

Capabilities explicitly not supported (subject to README):

  1. No binary/image scanning — Cannot scan ID cards in screenshots, tables embedded in PDFs, etc.
  2. No .git history check — Only the current workspace; sensitive data already committed in history requires separate history cleaning or specialized tools.

The README also emphasizes: This plugin is a tool; users must comply with the laws and regulations of their region and bear responsibility for the consequences of its use.

Summary

dsh-data-scan uses check digits and boundary rules to find PII such as ID cards, bank cards, and mobile phone numbers in text repositories, and avoids echoing full original values in reports. The installation command is based on @deepwhale-cn/dsh-data-scan; from daily scanning of the current directory to HTML reports, the three commands in the README are sufficient for reproduction.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye