Find private data in files and folders: terms of a list, email addresses, phone numbers, coordinates
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/privacy-scan/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["privacyScan","files"], { paths: [] });
console.log(JSON.stringify(result));From the command line
$ mark privacyScan files --paths <string[]>
As data, in a program
{ "$proc": ["privacyScan", "files"], "input": { "paths": [] } }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"paths": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "The files and folders to scan. A folder gives all its files."
},
"terms": {
"description": "The private terms (names, places, accounts). The match ignores case and finds only whole words.",
"type": "array",
"items": {
"type": "string"
}
},
"allow": {
"description": "The values that are not private. The match ignores case.",
"type": "array",
"items": {
"type": "string"
}
},
"kinds": {
"description": "The kinds to find: term, email, phone, coordinate (default: all)",
"type": "array",
"items": {
"type": "string",
"enum": [
"term",
"email",
"phone",
"coordinate"
]
}
},
"mask": {
"description": "Show only the first character of each match (default: false)",
"type": "boolean"
},
"termsFile": {
"description": "A file with more terms, one on each line. A line that starts with # is a comment.",
"type": "string",
"minLength": 1
},
"allowFile": {
"description": "A file with more allowed values, in the format of termsFile",
"type": "string",
"minLength": 1
}
},
"required": [
"paths"
]
},
"output": {
"type": "object",
"properties": {
"findings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"term",
"email",
"phone",
"coordinate"
]
},
"line": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"column": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"match": {
"type": "string"
}
},
"required": [
"file",
"kind",
"line",
"column",
"match"
],
"additionalProperties": false
}
},
"files": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"skipped": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"findings",
"files",
"skipped"
],
"additionalProperties": false
}
}