@dataparade/cli 0.0.34 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/package.json +4 -4
- package/dist/src/ai-enrichment/pii-signal-rules.d.ts +5 -0
- package/dist/src/ai-enrichment/pii-signal-rules.js +2 -3
- package/dist/src/ai-enrichment/third-party-data-flow.js +5 -4
- package/dist/src/cli.js +9 -3
- package/dist/src/facts/build-facts.d.ts +2 -0
- package/dist/src/facts/build-facts.js +14 -0
- package/dist/src/facts/layout.d.ts +4 -0
- package/dist/src/facts/layout.js +5 -1
- package/dist/src/facts/scan-stamps.d.ts +7 -0
- package/dist/src/facts/scan-stamps.js +30 -0
- package/dist/src/facts/schema.d.ts +74 -0
- package/dist/src/facts/schema.js +32 -1
- package/dist/src/output/scan-output-excludes.js +2 -0
- package/dist/src/output/write-scan-knowledge.d.ts +5 -1
- package/dist/src/output/write-scan-knowledge.js +21 -0
- package/dist/src/threat-model/build-threat-model.d.ts +3 -0
- package/dist/src/threat-model/build-threat-model.js +71 -0
- package/dist/src/threat-model/carry-forward-person-set-statuses.d.ts +8 -0
- package/dist/src/threat-model/carry-forward-person-set-statuses.js +87 -0
- package/dist/src/threat-model/io.d.ts +19 -0
- package/dist/src/threat-model/io.js +63 -0
- package/dist/src/threat-model/schema.d.ts +214 -0
- package/dist/src/threat-model/schema.js +75 -0
- package/dist/src/ui/scan-progress-renderer.d.ts +8 -1
- package/dist/src/ui/scan-progress-renderer.js +20 -1
- package/dist/src/upload/collect-scan-sidecars.d.ts +2 -1
- package/dist/src/upload/collect-scan-sidecars.js +3 -1
- package/dist/tests/cli/cli.spec.js +10 -1
- package/dist/tests/helpers/facts-fixture.js +16 -16
- package/dist/tests/schema/scan-result.schema.spec.js +1 -1
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.js +5 -5
- package/dist/tests/unit/core/graph-mapping.spec.js +4 -3
- package/dist/tests/unit/discoveries/write-ocsf-discoveries-long-ids.spec.js +3 -3
- package/dist/tests/unit/export/export-ocsf.spec.js +4 -4
- package/dist/tests/unit/facts/apply-answers.spec.js +20 -20
- package/dist/tests/unit/facts/build-facts.spec.js +126 -45
- package/dist/tests/unit/facts/identity.spec.js +13 -0
- package/dist/tests/unit/facts/scan-stamps.spec.js +32 -0
- package/dist/tests/unit/facts/slug.spec.js +2 -0
- package/dist/tests/unit/kb/answer-fingerprint.spec.js +9 -9
- package/dist/tests/unit/kb/kb-interview-loop.spec.js +3 -3
- package/dist/tests/unit/output/scan-output-excludes.spec.js +1 -1
- package/dist/tests/unit/threat-model/build-threat-model.spec.d.ts +1 -0
- package/dist/tests/unit/threat-model/build-threat-model.spec.js +184 -0
- package/dist/tests/unit/threat-model/carry-forward-person-set-statuses.spec.d.ts +1 -0
- package/dist/tests/unit/threat-model/carry-forward-person-set-statuses.spec.js +163 -0
- package/dist/tests/unit/threat-model/io.spec.d.ts +1 -0
- package/dist/tests/unit/threat-model/io.spec.js +103 -0
- package/dist/tests/unit/threat-model/schema.spec.d.ts +1 -0
- package/dist/tests/unit/threat-model/schema.spec.js +42 -0
- package/dist/tests/unit/ui/scan-progress-renderer.spec.js +58 -0
- package/dist/tests/unit/upload/collect-scan-sidecars.spec.js +8 -5
- package/dist/vendor/scanner/dist/src/analyze/code-navigator.d.ts +1 -1
- package/dist/vendor/scanner/dist/src/analyze/code-navigator.js +4 -0
- package/dist/vendor/scanner/dist/src/analyze/column-catalog.d.ts +1 -1
- package/dist/vendor/scanner/dist/src/analyze/column-catalog.js +2 -2
- package/dist/vendor/scanner/dist/src/analyze/concept-profile.d.ts +2 -2
- package/dist/vendor/scanner/dist/src/analyze/concept-profile.js +5 -3
- package/dist/vendor/scanner/dist/src/classifier/component-factory.js +20 -0
- package/dist/vendor/scanner/dist/src/core/pipeline/build-scan-personal-data-layers.js +1 -1
- package/dist/vendor/scanner/dist/src/core/pipeline/deterministic-scan.js +43 -0
- package/dist/vendor/scanner/dist/src/core/pipeline/graph-mapping.js +23 -2
- package/dist/vendor/scanner/dist/src/core/pipeline/mixed-app-terraform-scan.js +1 -0
- package/dist/vendor/scanner/dist/src/core/pipeline/orchestrator-result.d.ts +2 -2
- package/dist/vendor/scanner/dist/src/core/pipeline/terraform-minimal-services.js +1 -0
- package/dist/vendor/scanner/dist/src/core/schema/scan-result.schema.d.ts +160 -2
- package/dist/vendor/scanner/dist/src/core/schema/scan-result.schema.js +24 -0
- package/dist/vendor/scanner/dist/src/core/types/data-flow.d.ts +48 -0
- package/dist/vendor/scanner/dist/src/core/types/data-flow.js +53 -0
- package/dist/vendor/scanner/dist/src/data-flow/detect.js +1 -0
- package/dist/vendor/scanner/dist/src/data-flow/ensure-hub-linked-assets.js +1 -0
- package/dist/vendor/scanner/dist/src/data-flow/ensure-manifest-declared-flows.js +1 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-authentication.d.ts +30 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-authentication.js +277 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-builder.js +6 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-controls.d.ts +24 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-controls.js +238 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-data-categories.d.ts +22 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-data-categories.js +69 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-interaction-description.d.ts +13 -0
- package/dist/vendor/scanner/dist/src/data-flow/flow-interaction-description.js +263 -0
- package/dist/vendor/scanner/dist/src/data-flow/hub-link-policy.d.ts +2 -1
- package/dist/vendor/scanner/dist/src/data-flow/hub-link-policy.js +3 -0
- package/dist/vendor/scanner/dist/src/data-flow/human-interaction-channels.d.ts +37 -0
- package/dist/vendor/scanner/dist/src/data-flow/human-interaction-channels.js +483 -0
- package/dist/vendor/scanner/dist/src/data-flow/intra-component-lineage.d.ts +3 -0
- package/dist/vendor/scanner/dist/src/data-flow/intra-component-lineage.js +12 -17
- package/dist/vendor/scanner/dist/src/data-flow/terraform-flows.js +5 -1
- package/dist/vendor/scanner/dist/src/data-flow/transformation-patterns.d.ts +5 -1
- package/dist/vendor/scanner/dist/src/data-flow/transformation-patterns.js +17 -37
- package/dist/vendor/scanner/dist/src/eval/canonical/concept-map.d.ts +36 -5
- package/dist/vendor/scanner/dist/src/eval/canonical/concept-map.js +53 -60
- package/dist/vendor/scanner/dist/src/eval/canonical/graph/endpoints.js +2 -9
- package/dist/vendor/scanner/dist/src/eval/canonical/scanner/personal-data.js +10 -7
- package/dist/vendor/scanner/dist/src/graph/build-dataparade-graph.js +3 -1
- package/dist/vendor/scanner/dist/src/index.d.ts +6 -0
- package/dist/vendor/scanner/dist/src/index.js +16 -1
- package/dist/vendor/scanner/dist/src/patterns/detectors/python.js +11 -1
- package/dist/vendor/scanner/dist/src/patterns/engine.js +1 -0
- package/dist/vendor/scanner/dist/src/pii-signals/match-pii-signals.d.ts +1 -1
- package/dist/vendor/scanner/dist/src/pii-signals/match-pii-signals.js +2 -2
- package/dist/vendor/scanner/dist/src/pii-signals/occurrence-group.d.ts +3 -3
- package/dist/vendor/scanner/dist/src/pii-signals/occurrence-group.js +12 -11
- package/dist/vendor/scanner/dist/src/pii-signals/personal-data-taxonomy.d.ts +44 -0
- package/dist/vendor/scanner/dist/src/pii-signals/personal-data-taxonomy.js +167 -0
- package/dist/vendor/scanner/dist/src/pii-signals/pii-signal-aliases.js +43 -43
- package/dist/vendor/scanner/dist/src/pii-signals/pii-signal-rules.d.ts +12 -1
- package/dist/vendor/scanner/dist/src/pii-signals/pii-signal-rules.js +28 -7
- package/dist/vendor/scanner/dist/src/pii-signals/signal-token.js +1 -1
- package/dist/vendor/scanner/dist/src/threats/stride.d.ts +98 -0
- package/dist/vendor/scanner/dist/src/threats/stride.js +179 -0
- package/dist/vendor/scanner/package.json +2 -2
- package/dist/vendor/scanner/patterns/concept-profiles.yaml +2 -2
- package/dist/vendor/scanner/patterns/flow-authentication.rules.yaml +75 -0
- package/dist/vendor/scanner/patterns/flow-controls.rules.yaml +68 -0
- package/dist/vendor/scanner/patterns/personal-data-taxonomy.yaml +155 -0
- package/dist/vendor/scanner/patterns/pii-signals.rules.yaml +38 -49
- package/dist/vendor/scanner/patterns/python.patterns.yaml +2 -2
- package/dist/vendor/scanner/patterns/stride.rules.yaml +86 -0
- package/package.json +4 -4
- package/dist/vendor/scanner/dist/src/eval/canonical/concept-map.validate.d.ts +0 -17
- package/dist/vendor/scanner/dist/src/eval/canonical/concept-map.validate.js +0 -108
- package/dist/vendor/scanner/patterns/personal-data-concept-map.yaml +0 -76
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# STRIDE per element (DATAP-914).
|
|
2
|
+
#
|
|
3
|
+
# Which STRIDE threat categories apply to each kind of diagram element. This table only
|
|
4
|
+
# says which categories apply; it never says a threat is present. Every category starts
|
|
5
|
+
# with status "unknown". The status rules below (DATAP-915) set "mitigated" or "open"
|
|
6
|
+
# from control evidence.
|
|
7
|
+
#
|
|
8
|
+
# Categories: S spoofing, T tampering, R repudiation, I information disclosure,
|
|
9
|
+
# D denial of service, E elevation of privilege.
|
|
10
|
+
#
|
|
11
|
+
# Rule ids carry the version (stride/v<version>/...). Bump it whenever a change here
|
|
12
|
+
# changes which threats or statuses a scan reports, so results from different tables
|
|
13
|
+
# are never compared as if they were the same.
|
|
14
|
+
version: 3
|
|
15
|
+
framework: stride
|
|
16
|
+
|
|
17
|
+
categories:
|
|
18
|
+
- id: S
|
|
19
|
+
name: Spoofing
|
|
20
|
+
- id: T
|
|
21
|
+
name: Tampering
|
|
22
|
+
- id: R
|
|
23
|
+
name: Repudiation
|
|
24
|
+
- id: I
|
|
25
|
+
name: Information disclosure
|
|
26
|
+
- id: D
|
|
27
|
+
name: Denial of service
|
|
28
|
+
- id: E
|
|
29
|
+
name: Elevation of privilege
|
|
30
|
+
|
|
31
|
+
# Element kinds and the categories that apply to each.
|
|
32
|
+
elements:
|
|
33
|
+
external_entity:
|
|
34
|
+
categories: [S, R]
|
|
35
|
+
process:
|
|
36
|
+
categories: [S, T, R, I, D, E]
|
|
37
|
+
data_store:
|
|
38
|
+
categories: [T, R, I, D]
|
|
39
|
+
data_flow:
|
|
40
|
+
categories: [T, I, D]
|
|
41
|
+
|
|
42
|
+
# Flow relationships that describe structure rather than data crossing between elements.
|
|
43
|
+
# A flow with one of these relationships is not a data_flow element: it gets no threats,
|
|
44
|
+
# and it is not read when deciding the status of the components at its ends.
|
|
45
|
+
structural_flow_relationships: [uses_in_process, exposes, depends_on, provisions]
|
|
46
|
+
|
|
47
|
+
# How a component maps to an element kind. Data flows are always data_flow.
|
|
48
|
+
# The first matching rule wins.
|
|
49
|
+
component_kinds:
|
|
50
|
+
- when: { type: actor }
|
|
51
|
+
kind: external_entity
|
|
52
|
+
- when: { type: third_party }
|
|
53
|
+
kind: external_entity
|
|
54
|
+
- when: { type: asset, subType: [database, cache, storage, config] }
|
|
55
|
+
kind: data_store
|
|
56
|
+
- when: { type: asset }
|
|
57
|
+
kind: process
|
|
58
|
+
|
|
59
|
+
# Status rules (DATAP-915). For each element kind and category:
|
|
60
|
+
# opened_by: a control with effect "weakens" (patterns/flow-controls.rules.yaml) sets "open".
|
|
61
|
+
# mitigated_by: a control with effect "mitigates", or an authentication kind written
|
|
62
|
+
# "auth:<kind>" (patterns/flow-authentication.rules.yaml), sets "mitigated".
|
|
63
|
+
# "open" wins over "mitigated". With no matching evidence the status stays "unknown":
|
|
64
|
+
# no evidence never sets "open".
|
|
65
|
+
#
|
|
66
|
+
# A data flow reads its own evidence. An external entity reads the flows to and from it:
|
|
67
|
+
# "open" when one flow has a weakening control; "mitigated" only when every checked flow
|
|
68
|
+
# has a mitigating control.
|
|
69
|
+
#
|
|
70
|
+
# Not covered yet, so these stay "unknown": route authorization, rate limits, audit logs,
|
|
71
|
+
# data-store encryption, and every process and data-store category.
|
|
72
|
+
status_rules:
|
|
73
|
+
data_flow:
|
|
74
|
+
T:
|
|
75
|
+
mitigated_by: [tls, "auth:signed_request", "auth:webhook_signature"]
|
|
76
|
+
opened_by: [plaintext_http, tls_verify_disabled]
|
|
77
|
+
I:
|
|
78
|
+
mitigated_by: [tls]
|
|
79
|
+
opened_by: [plaintext_http, tls_verify_disabled]
|
|
80
|
+
D:
|
|
81
|
+
mitigated_by: [timeout]
|
|
82
|
+
opened_by: [timeout_disabled]
|
|
83
|
+
external_entity:
|
|
84
|
+
S:
|
|
85
|
+
mitigated_by: [tls, "auth:signed_request", "auth:webhook_signature"]
|
|
86
|
+
opened_by: [plaintext_http, tls_verify_disabled]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataparade/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "dataPARADE CLI — scan codebases for privacy and security data flows",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"eval:models": "pnpm exec node dist/src/evals/run-model-matrix.js"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@clack/prompts": "^1.
|
|
58
|
+
"@clack/prompts": "^1.9.0",
|
|
59
59
|
"@sentry/node": "^10.75.2",
|
|
60
60
|
"commander": "^14.0.3",
|
|
61
61
|
"dotenv": "^16.4.7",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"zod": "^4.3.5"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@dataparade/scanner": "github:DataParade-io/scanner#
|
|
70
|
+
"@dataparade/scanner": "github:DataParade-io/scanner#798ba353eff174ae0210df166c55ea6aef351b97",
|
|
71
71
|
"@eslint/js": "^9.18.0",
|
|
72
72
|
"@types/jest": "^30.0.0",
|
|
73
73
|
"@types/node": "^22.0.0",
|
|
74
74
|
"eslint": "^9.18.0",
|
|
75
75
|
"globals": "^15.14.0",
|
|
76
76
|
"jest": "^30.5.2",
|
|
77
|
-
"ts-jest": "^29.4.
|
|
77
|
+
"ts-jest": "^29.4.15",
|
|
78
78
|
"typescript-eslint": "^8.20.0"
|
|
79
79
|
},
|
|
80
80
|
"files": [
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Gold taxonomy parent keys — never valid as concept_leaf (KDATAP-326fdd). */
|
|
2
|
-
export declare const FORBIDDEN_CATEGORY_LEAVES: readonly string[];
|
|
3
|
-
export interface PersonalDataConceptMapEntry {
|
|
4
|
-
ruleId: string;
|
|
5
|
-
conceptLeaf: string;
|
|
6
|
-
conceptAncestry: readonly string[];
|
|
7
|
-
}
|
|
8
|
-
export interface PersonalDataConceptMap {
|
|
9
|
-
version: string;
|
|
10
|
-
entries: readonly PersonalDataConceptMapEntry[];
|
|
11
|
-
}
|
|
12
|
-
export declare function normalizeConceptToken(token: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Validate a parsed YAML document against the closed PII rule-id inventory.
|
|
15
|
-
* Throws on any group-shaped, duplicate-leaf, category-as-leaf, or coverage mismatch.
|
|
16
|
-
*/
|
|
17
|
-
export declare function validatePersonalDataConceptMapDocument(parsed: unknown, expectedRuleIds: readonly string[]): PersonalDataConceptMap;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FORBIDDEN_CATEGORY_LEAVES = void 0;
|
|
4
|
-
exports.normalizeConceptToken = normalizeConceptToken;
|
|
5
|
-
exports.validatePersonalDataConceptMapDocument = validatePersonalDataConceptMapDocument;
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
/** Gold taxonomy parent keys — never valid as concept_leaf (KDATAP-326fdd). */
|
|
8
|
-
exports.FORBIDDEN_CATEGORY_LEAVES = [
|
|
9
|
-
"person_name",
|
|
10
|
-
"national_identifier",
|
|
11
|
-
"user_identifier",
|
|
12
|
-
"street_address",
|
|
13
|
-
"credential_secret",
|
|
14
|
-
"password_verifier",
|
|
15
|
-
"employment_information",
|
|
16
|
-
"residence_information",
|
|
17
|
-
];
|
|
18
|
-
const FORBIDDEN_CATEGORY_LEAF_SET = new Set(exports.FORBIDDEN_CATEGORY_LEAVES.map(normalizeConceptToken));
|
|
19
|
-
const FORBIDDEN_ENTRY_KEYS = ["aliases", "equivalent_to", "group"];
|
|
20
|
-
const entrySchema = zod_1.z
|
|
21
|
-
.object({
|
|
22
|
-
rule_id: zod_1.z.string().min(1),
|
|
23
|
-
concept_leaf: zod_1.z.string().min(1),
|
|
24
|
-
concept_ancestry: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
25
|
-
})
|
|
26
|
-
.strict();
|
|
27
|
-
const documentSchema = zod_1.z
|
|
28
|
-
.object({
|
|
29
|
-
version: zod_1.z.string().min(1),
|
|
30
|
-
personal_data_concept_map: zod_1.z.array(entrySchema).min(1),
|
|
31
|
-
})
|
|
32
|
-
.strict();
|
|
33
|
-
function normalizeConceptToken(token) {
|
|
34
|
-
return token.trim().toLowerCase().replace(/-/g, "_");
|
|
35
|
-
}
|
|
36
|
-
function rejectForbiddenEntryKeys(rawEntry, index) {
|
|
37
|
-
for (const key of FORBIDDEN_ENTRY_KEYS) {
|
|
38
|
-
if (key in rawEntry) {
|
|
39
|
-
throw new Error(`personal_data_concept_map[${index}]: forbidden key '${key}' — map must not be group-shaped`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function rejectForbiddenDocumentKeys(raw) {
|
|
44
|
-
for (const key of FORBIDDEN_ENTRY_KEYS) {
|
|
45
|
-
if (key in raw) {
|
|
46
|
-
throw new Error(`personal-data-concept-map: forbidden key '${key}' at document root — map must not be group-shaped`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Validate a parsed YAML document against the closed PII rule-id inventory.
|
|
52
|
-
* Throws on any group-shaped, duplicate-leaf, category-as-leaf, or coverage mismatch.
|
|
53
|
-
*/
|
|
54
|
-
function validatePersonalDataConceptMapDocument(parsed, expectedRuleIds) {
|
|
55
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
56
|
-
throw new Error("personal-data-concept-map: expected YAML object at document root");
|
|
57
|
-
}
|
|
58
|
-
const raw = parsed;
|
|
59
|
-
rejectForbiddenDocumentKeys(raw);
|
|
60
|
-
const normalized = documentSchema.parse(parsed);
|
|
61
|
-
const expectedSet = new Set(expectedRuleIds.map(normalizeConceptToken));
|
|
62
|
-
const seenRuleIds = new Set();
|
|
63
|
-
const seenLeaves = new Set();
|
|
64
|
-
const entries = [];
|
|
65
|
-
for (let index = 0; index < normalized.personal_data_concept_map.length; index += 1) {
|
|
66
|
-
const row = normalized.personal_data_concept_map[index];
|
|
67
|
-
const rawRow = raw.personal_data_concept_map[index];
|
|
68
|
-
if (typeof rawRow === "object" && rawRow !== null && !Array.isArray(rawRow)) {
|
|
69
|
-
rejectForbiddenEntryKeys(rawRow, index);
|
|
70
|
-
}
|
|
71
|
-
const ruleId = normalizeConceptToken(row.rule_id);
|
|
72
|
-
const conceptLeaf = normalizeConceptToken(row.concept_leaf);
|
|
73
|
-
if (seenRuleIds.has(ruleId)) {
|
|
74
|
-
throw new Error(`personal_data_concept_map[${index}]: duplicate rule_id '${row.rule_id}'`);
|
|
75
|
-
}
|
|
76
|
-
seenRuleIds.add(ruleId);
|
|
77
|
-
if (!expectedSet.has(ruleId)) {
|
|
78
|
-
throw new Error(`personal_data_concept_map[${index}]: orphan rule_id '${row.rule_id}' not in patterns/pii-signals.rules.yaml`);
|
|
79
|
-
}
|
|
80
|
-
if (FORBIDDEN_CATEGORY_LEAF_SET.has(conceptLeaf)) {
|
|
81
|
-
throw new Error(`personal_data_concept_map[${index}]: concept_leaf '${row.concept_leaf}' is a forbidden gold category key`);
|
|
82
|
-
}
|
|
83
|
-
if (seenLeaves.has(conceptLeaf)) {
|
|
84
|
-
throw new Error(`personal_data_concept_map[${index}]: duplicate concept_leaf '${row.concept_leaf}' — map must be one-to-one at the leaf`);
|
|
85
|
-
}
|
|
86
|
-
seenLeaves.add(conceptLeaf);
|
|
87
|
-
const ancestryRaw = row.concept_ancestry ?? [row.concept_leaf];
|
|
88
|
-
const conceptAncestry = ancestryRaw.map((token) => normalizeConceptToken(token));
|
|
89
|
-
const terminal = conceptAncestry[conceptAncestry.length - 1];
|
|
90
|
-
if (terminal !== conceptLeaf) {
|
|
91
|
-
throw new Error(`personal_data_concept_map[${index}]: concept_ancestry terminal '${terminal}' must equal concept_leaf '${row.concept_leaf}'`);
|
|
92
|
-
}
|
|
93
|
-
entries.push({
|
|
94
|
-
ruleId,
|
|
95
|
-
conceptLeaf,
|
|
96
|
-
conceptAncestry,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
for (const expectedId of expectedSet) {
|
|
100
|
-
if (!seenRuleIds.has(expectedId)) {
|
|
101
|
-
throw new Error(`personal-data-concept-map: missing rule_id '${expectedId}' from patterns/pii-signals.rules.yaml`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
version: normalized.version.trim(),
|
|
106
|
-
entries,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Closed one-to-one map: detector rule id → canonical concept leaf (KDATAP-326fdd).
|
|
2
|
-
# Separate from the scanner capability manifest — do not merge with adapterMapVersion.
|
|
3
|
-
# Map version bumps on semantic remap; CANONICAL_CONTRACT_VERSION bumps only when
|
|
4
|
-
# canonicalization meaning changes beyond this artifact.
|
|
5
|
-
version: "1.0.0"
|
|
6
|
-
personal_data_concept_map:
|
|
7
|
-
- rule_id: first_name
|
|
8
|
-
concept_leaf: first_name
|
|
9
|
-
concept_ancestry:
|
|
10
|
-
- person_name
|
|
11
|
-
- first_name
|
|
12
|
-
- rule_id: last_name
|
|
13
|
-
concept_leaf: last_name
|
|
14
|
-
concept_ancestry:
|
|
15
|
-
- person_name
|
|
16
|
-
- last_name
|
|
17
|
-
- rule_id: full_name
|
|
18
|
-
concept_leaf: full_name
|
|
19
|
-
concept_ancestry:
|
|
20
|
-
- person_name
|
|
21
|
-
- full_name
|
|
22
|
-
- rule_id: date_of_birth
|
|
23
|
-
concept_leaf: date_of_birth
|
|
24
|
-
concept_ancestry:
|
|
25
|
-
- date_of_birth
|
|
26
|
-
- rule_id: phone_number
|
|
27
|
-
concept_leaf: phone_number
|
|
28
|
-
concept_ancestry:
|
|
29
|
-
- phone_number
|
|
30
|
-
- rule_id: address
|
|
31
|
-
concept_leaf: address
|
|
32
|
-
concept_ancestry:
|
|
33
|
-
- street_address
|
|
34
|
-
- address
|
|
35
|
-
- rule_id: ssn
|
|
36
|
-
concept_leaf: social_security_number
|
|
37
|
-
concept_ancestry:
|
|
38
|
-
- national_identifier
|
|
39
|
-
- social_security_number
|
|
40
|
-
- rule_id: passport
|
|
41
|
-
concept_leaf: passport_number
|
|
42
|
-
concept_ancestry:
|
|
43
|
-
- national_identifier
|
|
44
|
-
- passport_number
|
|
45
|
-
- rule_id: national_id
|
|
46
|
-
concept_leaf: national_id
|
|
47
|
-
concept_ancestry:
|
|
48
|
-
- national_identifier
|
|
49
|
-
- national_id
|
|
50
|
-
- rule_id: drivers_license
|
|
51
|
-
concept_leaf: drivers_license_number
|
|
52
|
-
concept_ancestry:
|
|
53
|
-
- national_identifier
|
|
54
|
-
- drivers_license_number
|
|
55
|
-
- rule_id: tax_id
|
|
56
|
-
concept_leaf: tax_identifier
|
|
57
|
-
concept_ancestry:
|
|
58
|
-
- national_identifier
|
|
59
|
-
- tax_identifier
|
|
60
|
-
- rule_id: account_number
|
|
61
|
-
concept_leaf: account_number
|
|
62
|
-
concept_ancestry:
|
|
63
|
-
- account_number
|
|
64
|
-
- rule_id: username
|
|
65
|
-
concept_leaf: username
|
|
66
|
-
concept_ancestry:
|
|
67
|
-
- user_identifier
|
|
68
|
-
- username
|
|
69
|
-
- rule_id: email
|
|
70
|
-
concept_leaf: email_address
|
|
71
|
-
concept_ancestry:
|
|
72
|
-
- email_address
|
|
73
|
-
- rule_id: password
|
|
74
|
-
concept_leaf: password
|
|
75
|
-
concept_ancestry:
|
|
76
|
-
- password
|