@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,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadStrideRules = loadStrideRules;
|
|
7
|
+
exports.strideComponentKind = strideComponentKind;
|
|
8
|
+
exports.strideThreatsForKind = strideThreatsForKind;
|
|
9
|
+
exports.isStructuralFlowForStride = isStructuralFlowForStride;
|
|
10
|
+
exports.strideThreatsForComponent = strideThreatsForComponent;
|
|
11
|
+
exports.strideThreatsForFlow = strideThreatsForFlow;
|
|
12
|
+
/**
|
|
13
|
+
* STRIDE per element (DATAP-914): which threat categories apply to a component or flow.
|
|
14
|
+
* The table is patterns/stride.rules.yaml. Every category starts as "unknown". The status
|
|
15
|
+
* rules in the same file (DATAP-915) set "mitigated" or "open" from flow control and
|
|
16
|
+
* authentication evidence. No evidence never sets "open".
|
|
17
|
+
*/
|
|
18
|
+
const fs_1 = __importDefault(require("fs"));
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
21
|
+
const zod_1 = require("zod");
|
|
22
|
+
const data_flow_1 = require("../core/types/data-flow");
|
|
23
|
+
const MAX_THREAT_EVIDENCE = 6;
|
|
24
|
+
const stringOrList = zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]);
|
|
25
|
+
const rulesSchema = zod_1.z.object({
|
|
26
|
+
version: zod_1.z.number().int().positive(),
|
|
27
|
+
framework: zod_1.z.string().min(1),
|
|
28
|
+
categories: zod_1.z.array(zod_1.z.object({ id: zod_1.z.string().min(1), name: zod_1.z.string().min(1) })).min(1),
|
|
29
|
+
elements: zod_1.z.record(zod_1.z.enum(["external_entity", "process", "data_store", "data_flow"]), zod_1.z.object({ categories: zod_1.z.array(zod_1.z.string().min(1)) })),
|
|
30
|
+
status_rules: zod_1.z
|
|
31
|
+
.partialRecord(zod_1.z.enum(["external_entity", "process", "data_store", "data_flow"]), zod_1.z.record(zod_1.z.string(), zod_1.z.object({
|
|
32
|
+
mitigated_by: zod_1.z.array(zod_1.z.string().min(1)).default([]),
|
|
33
|
+
opened_by: zod_1.z.array(zod_1.z.string().min(1)).default([]),
|
|
34
|
+
})))
|
|
35
|
+
.default({}),
|
|
36
|
+
structural_flow_relationships: zod_1.z.array(zod_1.z.enum(data_flow_1.FLOW_RELATIONSHIPS)).default([]),
|
|
37
|
+
component_kinds: zod_1.z.array(zod_1.z.object({
|
|
38
|
+
when: zod_1.z.object({ type: stringOrList.optional(), subType: stringOrList.optional() }),
|
|
39
|
+
kind: zod_1.z.enum(["external_entity", "process", "data_store"]),
|
|
40
|
+
})),
|
|
41
|
+
});
|
|
42
|
+
let cached;
|
|
43
|
+
function rulesPath() {
|
|
44
|
+
const parts = __dirname.split(path_1.default.sep);
|
|
45
|
+
const distIndex = parts.lastIndexOf("dist");
|
|
46
|
+
const root = distIndex !== -1 ? parts.slice(0, distIndex).join(path_1.default.sep) : path_1.default.resolve(__dirname, "..", "..");
|
|
47
|
+
return path_1.default.join(root, "patterns", "stride.rules.yaml");
|
|
48
|
+
}
|
|
49
|
+
function loadStrideRules() {
|
|
50
|
+
if (cached)
|
|
51
|
+
return cached;
|
|
52
|
+
const rules = rulesSchema.parse(yaml_1.default.parse(fs_1.default.readFileSync(rulesPath(), "utf8")));
|
|
53
|
+
const known = new Set(rules.categories.map((c) => c.id));
|
|
54
|
+
for (const [kind, row] of Object.entries(rules.elements)) {
|
|
55
|
+
for (const c of row.categories) {
|
|
56
|
+
if (!known.has(c))
|
|
57
|
+
throw new Error(`stride.rules.yaml: ${kind} uses unknown category ${c}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const [kind, byCategory] of Object.entries(rules.status_rules)) {
|
|
61
|
+
const applies = new Set(rules.elements[kind]?.categories ?? []);
|
|
62
|
+
for (const c of Object.keys(byCategory ?? {})) {
|
|
63
|
+
if (!applies.has(c))
|
|
64
|
+
throw new Error(`stride.rules.yaml: status rule ${kind}/${c} is for a category that does not apply`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
cached = rules;
|
|
68
|
+
return cached;
|
|
69
|
+
}
|
|
70
|
+
function matches(value, expected) {
|
|
71
|
+
if (expected === undefined)
|
|
72
|
+
return true;
|
|
73
|
+
if (value === undefined)
|
|
74
|
+
return false;
|
|
75
|
+
return Array.isArray(expected) ? expected.includes(value) : expected === value;
|
|
76
|
+
}
|
|
77
|
+
/** The element kind of a component; undefined when no rule matches. */
|
|
78
|
+
function strideComponentKind(component, rules = loadStrideRules()) {
|
|
79
|
+
for (const rule of rules.component_kinds) {
|
|
80
|
+
if (matches(component.type, rule.when.type) && matches(component.subType, rule.when.subType))
|
|
81
|
+
return rule.kind;
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
function strideThreatsForKind(kind, rules = loadStrideRules()) {
|
|
86
|
+
const row = rules.elements[kind];
|
|
87
|
+
if (!row)
|
|
88
|
+
return [];
|
|
89
|
+
const order = new Map(rules.categories.map((c, i) => [c.id, i]));
|
|
90
|
+
return [...row.categories]
|
|
91
|
+
.sort((a, b) => (order.get(a) ?? 0) - (order.get(b) ?? 0))
|
|
92
|
+
.map((category) => ({
|
|
93
|
+
framework: rules.framework,
|
|
94
|
+
category,
|
|
95
|
+
status: "unknown",
|
|
96
|
+
ruleId: `${rules.framework}/v${rules.version}/${kind}`,
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
function isStructuralFlowForStride(flow, rules = loadStrideRules()) {
|
|
100
|
+
return flow.relationship !== undefined && rules.structural_flow_relationships.includes(flow.relationship);
|
|
101
|
+
}
|
|
102
|
+
/** Control and authentication evidence of one flow, as threat evidence with its effect. */
|
|
103
|
+
function flowEvidence(flow) {
|
|
104
|
+
const out = [];
|
|
105
|
+
for (const c of flow.controls ?? []) {
|
|
106
|
+
out.push({ control: c.control, filePath: c.filePath, line: c.line, weakens: c.effect === "weakens" });
|
|
107
|
+
}
|
|
108
|
+
for (const a of flow.authentication?.evidence ?? []) {
|
|
109
|
+
out.push({ control: `auth:${a.kind}`, filePath: a.filePath, line: a.line, weakens: false });
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
function isChecked(flow) {
|
|
114
|
+
return flow.controls !== undefined || flow.authentication !== undefined;
|
|
115
|
+
}
|
|
116
|
+
function strip(e) {
|
|
117
|
+
return { control: e.control, filePath: e.filePath, line: e.line };
|
|
118
|
+
}
|
|
119
|
+
function withStatus(threat, status, kind, evidence, rules) {
|
|
120
|
+
if (status === "unknown")
|
|
121
|
+
return threat;
|
|
122
|
+
return {
|
|
123
|
+
...threat,
|
|
124
|
+
status,
|
|
125
|
+
statusRuleId: `${rules.framework}/v${rules.version}/${kind}/${threat.category}`,
|
|
126
|
+
evidence: evidence.slice(0, MAX_THREAT_EVIDENCE),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/** Status of one category from one flow's evidence. */
|
|
130
|
+
function flowStatus(flow, rule) {
|
|
131
|
+
const evidence = flowEvidence(flow);
|
|
132
|
+
const open = evidence.filter((e) => e.weakens && rule.opened_by.includes(e.control));
|
|
133
|
+
if (open.length > 0)
|
|
134
|
+
return { status: "open", evidence: open.map(strip) };
|
|
135
|
+
const mitigated = evidence.filter((e) => !e.weakens && rule.mitigated_by.includes(e.control));
|
|
136
|
+
if (mitigated.length > 0)
|
|
137
|
+
return { status: "mitigated", evidence: mitigated.map(strip) };
|
|
138
|
+
return { status: "unknown", evidence: [] };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Threats of a component. For an external entity, `flows` are the flows to and from it:
|
|
142
|
+
* one "open" flow makes the category open; it is mitigated only when every checked flow
|
|
143
|
+
* is mitigated.
|
|
144
|
+
*/
|
|
145
|
+
function strideThreatsForComponent(component, flows = [], rules = loadStrideRules()) {
|
|
146
|
+
const kind = strideComponentKind(component, rules);
|
|
147
|
+
if (!kind)
|
|
148
|
+
return [];
|
|
149
|
+
const statusRules = rules.status_rules[kind] ?? {};
|
|
150
|
+
const checked = flows.filter((flow) => isChecked(flow) && !isStructuralFlowForStride(flow, rules));
|
|
151
|
+
return strideThreatsForKind(kind, rules).map((threat) => {
|
|
152
|
+
const rule = statusRules[threat.category];
|
|
153
|
+
if (!rule || checked.length === 0)
|
|
154
|
+
return threat;
|
|
155
|
+
const results = checked.map((f) => flowStatus(f, rule));
|
|
156
|
+
const open = results.filter((r) => r.status === "open");
|
|
157
|
+
if (open.length > 0)
|
|
158
|
+
return withStatus(threat, "open", kind, open.flatMap((r) => r.evidence), rules);
|
|
159
|
+
if (results.every((r) => r.status === "mitigated")) {
|
|
160
|
+
// One line per flow first, so the evidence covers as many flows as the cap allows.
|
|
161
|
+
const first = results.map((r) => r.evidence[0]);
|
|
162
|
+
return withStatus(threat, "mitigated", kind, first, rules);
|
|
163
|
+
}
|
|
164
|
+
return threat;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/** Threats of a data flow, with statuses from its control and authentication evidence. */
|
|
168
|
+
function strideThreatsForFlow(flow = {}, rules = loadStrideRules()) {
|
|
169
|
+
if (isStructuralFlowForStride(flow, rules))
|
|
170
|
+
return [];
|
|
171
|
+
const statusRules = rules.status_rules.data_flow ?? {};
|
|
172
|
+
return strideThreatsForKind("data_flow", rules).map((threat) => {
|
|
173
|
+
const rule = statusRules[threat.category];
|
|
174
|
+
if (!rule)
|
|
175
|
+
return threat;
|
|
176
|
+
const { status, evidence } = flowStatus(flow, rule);
|
|
177
|
+
return withStatus(threat, status, "data_flow", evidence, rules);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Vendored build of @dataparade/scanner bundled into @dataparade/cli",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
|
-
"gitHead": "
|
|
8
|
-
"catalogHash": "sha256:
|
|
7
|
+
"gitHead": "798ba353eff174ae0210df166c55ea6aef351b97",
|
|
8
|
+
"catalogHash": "sha256:e719c413f7c8a6d8"
|
|
9
9
|
}
|
|
@@ -42,14 +42,14 @@ negative_words:
|
|
|
42
42
|
- flag
|
|
43
43
|
|
|
44
44
|
concept_profiles:
|
|
45
|
-
- id:
|
|
45
|
+
- id: pd:EmailAddress
|
|
46
46
|
type_hints: [email, emailfield]
|
|
47
47
|
role_words: [from, sender, support, noreply]
|
|
48
48
|
role_runs: [replyto, mailfrom, defaultfrom, noreply]
|
|
49
49
|
tail_words: [from, to, reply, address, addresses, sender, recipient, recipients, cc, bcc]
|
|
50
50
|
role_words_suffice: true
|
|
51
51
|
|
|
52
|
-
- id:
|
|
52
|
+
- id: pd:TelephoneNumber
|
|
53
53
|
type_hints: [phonenumberfield, possiblephonenumberfield, phonenumber, phone, telephone]
|
|
54
54
|
role_words: [sender, from, support, contact, sms, twilio]
|
|
55
55
|
tail_words: [number, no, num, from, to, sender, support, contact, sms]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Authentication evidence on data flows (DATAP-912).
|
|
2
|
+
#
|
|
3
|
+
# For each evidence location of a flow, the scanner reads the code around the request:
|
|
4
|
+
# the enclosing function up to a few lines after the call, plus any helper function or
|
|
5
|
+
# constant that the call passes as `headers=`, `auth=` or similar. It then applies these
|
|
6
|
+
# patterns. A match records the kind and the line. No match gives "none_seen", which
|
|
7
|
+
# means no evidence was found, not that the flow has no authentication.
|
|
8
|
+
#
|
|
9
|
+
# Flows of the types in `skip_flow_types` are not checked (database credentials are in
|
|
10
|
+
# connection settings, which this rule set does not read yet).
|
|
11
|
+
#
|
|
12
|
+
# The scan stamps hash this file (catalogHash).
|
|
13
|
+
version: 1
|
|
14
|
+
|
|
15
|
+
window:
|
|
16
|
+
# Lines before the evidence line to search for the start of the enclosing function.
|
|
17
|
+
max_lines_before: 40
|
|
18
|
+
# Lines after the evidence line that still belong to the request call. The window
|
|
19
|
+
# never runs past the end of the enclosing function.
|
|
20
|
+
lines_after: 8
|
|
21
|
+
# Lines to read from a referenced helper function or constant.
|
|
22
|
+
helper_lines: 25
|
|
23
|
+
|
|
24
|
+
skip_flow_types: [database_query]
|
|
25
|
+
|
|
26
|
+
# Arguments that pass credentials or headers to a request. The value, when it is a name
|
|
27
|
+
# or a call of a name defined in the same file, is followed to its definition.
|
|
28
|
+
credential_arguments: [headers, auth, credentials, session, client_kwargs]
|
|
29
|
+
|
|
30
|
+
kinds:
|
|
31
|
+
- id: bearer
|
|
32
|
+
patterns:
|
|
33
|
+
- "Authorization[\"']?\\s*[:=,]\\s*f?[\"'`]Bearer\\b"
|
|
34
|
+
- "[\"'`]Bearer [\"'`$\\{]"
|
|
35
|
+
- "\\bBearer \\{"
|
|
36
|
+
- "\\bBearer \\$\\{"
|
|
37
|
+
- id: basic
|
|
38
|
+
patterns:
|
|
39
|
+
- "Authorization[\"']?\\s*[:=,]\\s*f?[\"'`]Basic\\b"
|
|
40
|
+
- "\\b(HTTPBasicAuth|BasicAuth)\\s*\\("
|
|
41
|
+
- "\\bauth\\s*=\\s*\\("
|
|
42
|
+
- id: api_key
|
|
43
|
+
patterns:
|
|
44
|
+
- "Authorization[\"']?\\s*[:=,]\\s*f?[\"'`](Bot|Token|token|Key|ApiKey)\\b"
|
|
45
|
+
- "[\"'`][Xx]-[A-Za-z0-9-]*(Api-Key|API-Key|api-key|Access-Token|Auth-Token|Token|Key)[\"'`]"
|
|
46
|
+
- "[\"'`](api[-_]?key|apikey|x-api-key)[\"'`]\\s*:"
|
|
47
|
+
- "\\bapi_?[Kk]ey\\s*[=:]"
|
|
48
|
+
- "[?&](api_key|apikey|key|access_token|token)="
|
|
49
|
+
# Token in the URL path (Telegram Bot API).
|
|
50
|
+
- "/bot\\{|/bot\\$\\{"
|
|
51
|
+
# SDK client or helper given a token from configuration or a constant.
|
|
52
|
+
- "\\b(token|bot_token|app_token|access_token|auth_token)\\s*=\\s*(config|settings|os\\.environ|os\\.getenv|process\\.env|self\\.|[A-Z][A-Z0-9_]{2,}\\b)"
|
|
53
|
+
- "\\b\\w+_api_key\\b"
|
|
54
|
+
# Error-tracking DSNs carry the project key (Sentry).
|
|
55
|
+
- "\\bdsn\\s*[:=]"
|
|
56
|
+
- id: oauth
|
|
57
|
+
patterns:
|
|
58
|
+
- "\\bgoogle\\.oauth2\\b"
|
|
59
|
+
- "\\bservice_account\\.Credentials\\b"
|
|
60
|
+
- "\\bgoogle_auth_oauthlib\\b"
|
|
61
|
+
- "\\bOAuth2Session\\b"
|
|
62
|
+
- "/oauth2?/(access_)?token"
|
|
63
|
+
- "[\"']grant_type[\"']"
|
|
64
|
+
- "\\bclient_credentials\\b"
|
|
65
|
+
- id: signed_request
|
|
66
|
+
patterns:
|
|
67
|
+
- "\\b(SigV4Auth|AWS4Auth|aws4)\\b"
|
|
68
|
+
- "\\bsignRequest\\s*\\("
|
|
69
|
+
- id: webhook_signature
|
|
70
|
+
patterns:
|
|
71
|
+
- "\\bhmac\\.compare_digest\\s*\\("
|
|
72
|
+
- "\\btimingSafeEqual\\s*\\("
|
|
73
|
+
- "[\"'`][Xx]-(Hub-Signature(-256)?|Shopify-Hmac-Sha256|Slack-Signature|Signature|Twilio-Signature)[\"'`]"
|
|
74
|
+
- "\\bWebhook\\.construct_event\\s*\\("
|
|
75
|
+
- "\\bverify_?[Ss]ignature\\s*\\("
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Control evidence on data flows (DATAP-915).
|
|
2
|
+
#
|
|
3
|
+
# Each control is a code signal near a request. effect "mitigates" means the signal is a
|
|
4
|
+
# control (TLS, a timeout). effect "weakens" means the signal removes a control (plain
|
|
5
|
+
# HTTP, certificate checks turned off). patterns/stride.rules.yaml maps controls to
|
|
6
|
+
# threat statuses.
|
|
7
|
+
#
|
|
8
|
+
# The scan reads the same window as flow-authentication.rules.yaml: the enclosing
|
|
9
|
+
# function, a few lines after the call, and top-level URL constants the window names.
|
|
10
|
+
# When a flow cites an SDK import, the scan reads the whole file but keeps only the
|
|
11
|
+
# controls marked sdk: true (a client constructor takes them).
|
|
12
|
+
#
|
|
13
|
+
# No match gives no evidence. It never means the control is missing.
|
|
14
|
+
version: 1
|
|
15
|
+
|
|
16
|
+
skip_flow_types: [database_query]
|
|
17
|
+
|
|
18
|
+
# Top-level constants that hold a URL, such as CRISP_API_BASE or GITHUB_API_URL.
|
|
19
|
+
url_constant: '\b([A-Z][A-Z0-9_]*(?:URL|URI|BASE|API|ENDPOINT|HOST)[A-Z0-9_]*)\b'
|
|
20
|
+
|
|
21
|
+
# Lines that are comments are not read. Python docstrings are not read either.
|
|
22
|
+
comment_line: '^\s*(?:#|//|\*|/\*)'
|
|
23
|
+
|
|
24
|
+
controls:
|
|
25
|
+
- id: tls
|
|
26
|
+
effect: mitigates
|
|
27
|
+
patterns:
|
|
28
|
+
# Documentation links are not requests.
|
|
29
|
+
- 'https://(?!docs\.|developers?\.|help\.|support\.|github\.com/[\w.-]+/[\w.-]+/(?:blob|tree)/)'
|
|
30
|
+
- 'wss://'
|
|
31
|
+
|
|
32
|
+
- id: plaintext_http
|
|
33
|
+
effect: weakens
|
|
34
|
+
patterns:
|
|
35
|
+
# http:// to a remote host. Local and documentation hosts are not counted.
|
|
36
|
+
- 'http://(?!localhost\b|127\.0\.0\.1|0\.0\.0\.0|\[::1\]|host\.docker\.internal|[\w.-]*\.local\b|[\w.-]*\.internal\b|[\w.-]*\.svc\b|example\.(?:com|org)|www\.w3\.org|schemas\.|json-schema\.org|\{|\$\{)[\w.-]+'
|
|
37
|
+
- 'ws://(?!localhost\b|127\.0\.0\.1|0\.0\.0\.0)[\w.-]+'
|
|
38
|
+
|
|
39
|
+
- id: tls_verify_disabled
|
|
40
|
+
effect: weakens
|
|
41
|
+
sdk: true
|
|
42
|
+
patterns:
|
|
43
|
+
- '\bverify\s*=\s*False\b'
|
|
44
|
+
- '\bssl\s*=\s*False\b'
|
|
45
|
+
- 'rejectUnauthorized\s*:\s*false'
|
|
46
|
+
- 'InsecureSkipVerify\s*:\s*true'
|
|
47
|
+
- '\bCERT_NONE\b'
|
|
48
|
+
- 'NODE_TLS_REJECT_UNAUTHORIZED'
|
|
49
|
+
|
|
50
|
+
- id: timeout
|
|
51
|
+
effect: mitigates
|
|
52
|
+
sdk: true
|
|
53
|
+
patterns:
|
|
54
|
+
- '\btimeout\s*[=:]\s*(?:[1-9]|0\.\d|httpx\.Timeout|aiohttp\.ClientTimeout|ClientTimeout|[A-Z][A-Z0-9_]*TIMEOUT)'
|
|
55
|
+
- 'AbortSignal\.timeout\('
|
|
56
|
+
- 'context\.WithTimeout\('
|
|
57
|
+
- '\bTimeout:\s*\d'
|
|
58
|
+
- '\.timeout\(\s*\d'
|
|
59
|
+
# Ruby Net::HTTP, Faraday and HTTParty.
|
|
60
|
+
- '\b(?:open|read|write)_timeout\s*[=:]\s*\d'
|
|
61
|
+
|
|
62
|
+
- id: timeout_disabled
|
|
63
|
+
effect: weakens
|
|
64
|
+
sdk: true
|
|
65
|
+
patterns:
|
|
66
|
+
- '\btimeout\s*=\s*None\b'
|
|
67
|
+
# axios, node-fetch and others read 0 as "no timeout".
|
|
68
|
+
- '\btimeout\s*[=:]\s*0\s*(?:[,)}]|$)'
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Personal-data taxonomy (DATAP-947), built on the W3C Data Privacy Vocabulary (DPV 2.3).
|
|
2
|
+
#
|
|
3
|
+
# Every personal-data type the scanner names is a concept here, written as a compact IRI
|
|
4
|
+
# (CURIE): the prefix names the namespace below. DPV's personal-data extension (`pd:`)
|
|
5
|
+
# gives the top of the hierarchy; our more specific types (`dpx:`) sit beneath a DPV
|
|
6
|
+
# concept. `broader` is the direct parent; `dpv:PersonalData` is the root and is not
|
|
7
|
+
# listed. Ancestry, IRIs and validation come from this file only (see
|
|
8
|
+
# src/pii-signals/personal-data-taxonomy.ts and docs/dpv-taxonomy.md).
|
|
9
|
+
#
|
|
10
|
+
# Rules:
|
|
11
|
+
# - `pd:` concepts use DPV's own term name and parent. Add one only if DPV defines it.
|
|
12
|
+
# - `dpx:` concepts are ours. Each has a `broader` concept and a `definition`, and its
|
|
13
|
+
# local name never repeats a DPV term.
|
|
14
|
+
# - Detector rules (pii-signals.rules.yaml) and data-flow categories name concepts from
|
|
15
|
+
# this file; a name that is not here fails validation.
|
|
16
|
+
version: "2.0.0"
|
|
17
|
+
dpv_version: "2.3"
|
|
18
|
+
namespaces:
|
|
19
|
+
dpv: "https://w3id.org/dpv#"
|
|
20
|
+
pd: "https://w3id.org/dpv/pd#"
|
|
21
|
+
dpx: "https://dataparade.io/ns/dpx#"
|
|
22
|
+
concepts:
|
|
23
|
+
# External: characteristics that can be observed.
|
|
24
|
+
- id: pd:External
|
|
25
|
+
broader: dpv:PersonalData
|
|
26
|
+
- id: pd:Identifying
|
|
27
|
+
broader: pd:External
|
|
28
|
+
- id: pd:Name
|
|
29
|
+
broader: pd:Identifying
|
|
30
|
+
- id: dpx:FirstName
|
|
31
|
+
broader: pd:Name
|
|
32
|
+
definition: Given name or forename.
|
|
33
|
+
- id: dpx:LastName
|
|
34
|
+
broader: pd:Name
|
|
35
|
+
definition: Family name or surname.
|
|
36
|
+
- id: dpx:FullName
|
|
37
|
+
broader: pd:Name
|
|
38
|
+
definition: Whole name as one value, such as a display or legal name.
|
|
39
|
+
- id: pd:Username
|
|
40
|
+
broader: pd:Identifying
|
|
41
|
+
- id: pd:UID
|
|
42
|
+
broader: pd:Identifying
|
|
43
|
+
- id: pd:OfficialID
|
|
44
|
+
broader: pd:Identifying
|
|
45
|
+
- id: pd:Passport
|
|
46
|
+
broader: pd:OfficialID
|
|
47
|
+
- id: dpx:SocialSecurityNumber
|
|
48
|
+
broader: pd:OfficialID
|
|
49
|
+
definition: Social security or national insurance number.
|
|
50
|
+
- id: dpx:NationalIdentityNumber
|
|
51
|
+
broader: pd:OfficialID
|
|
52
|
+
definition: Number of a national identity card or other government-issued identifier.
|
|
53
|
+
- id: dpx:DriversLicenseNumber
|
|
54
|
+
broader: pd:OfficialID
|
|
55
|
+
definition: Number of a driving licence.
|
|
56
|
+
- id: dpx:TaxIdentificationNumber
|
|
57
|
+
broader: pd:OfficialID
|
|
58
|
+
definition: Tax or VAT identification number.
|
|
59
|
+
- id: pd:PhysicalCharacteristic
|
|
60
|
+
broader: pd:External
|
|
61
|
+
- id: pd:Age
|
|
62
|
+
broader: pd:PhysicalCharacteristic
|
|
63
|
+
- id: pd:BirthDate
|
|
64
|
+
broader: pd:Age
|
|
65
|
+
- id: pd:MedicalHealth
|
|
66
|
+
broader: pd:External
|
|
67
|
+
|
|
68
|
+
# Tracking: information used to track or contact an individual.
|
|
69
|
+
- id: pd:Tracking
|
|
70
|
+
broader: dpv:PersonalData
|
|
71
|
+
- id: pd:Contact
|
|
72
|
+
broader: pd:Tracking
|
|
73
|
+
- id: pd:EmailAddress
|
|
74
|
+
broader: pd:Contact
|
|
75
|
+
- id: pd:TelephoneNumber
|
|
76
|
+
broader: pd:Contact
|
|
77
|
+
- id: pd:Location
|
|
78
|
+
broader: pd:Tracking
|
|
79
|
+
- id: pd:PhysicalAddress
|
|
80
|
+
broader: pd:Location
|
|
81
|
+
- id: pd:Street
|
|
82
|
+
broader: pd:PhysicalAddress
|
|
83
|
+
- id: pd:PostalCode
|
|
84
|
+
broader: pd:PhysicalAddress
|
|
85
|
+
- id: pd:City
|
|
86
|
+
broader: pd:PhysicalAddress
|
|
87
|
+
- id: pd:Region
|
|
88
|
+
broader: pd:PhysicalAddress
|
|
89
|
+
- id: pd:Residency
|
|
90
|
+
broader: pd:Location
|
|
91
|
+
- id: pd:DeviceBased
|
|
92
|
+
broader: pd:Tracking
|
|
93
|
+
- id: pd:IPAddress
|
|
94
|
+
broader: pd:DeviceBased
|
|
95
|
+
|
|
96
|
+
# Internal: characteristics that cannot be observed, including authentication.
|
|
97
|
+
- id: pd:Internal
|
|
98
|
+
broader: dpv:PersonalData
|
|
99
|
+
- id: pd:Authenticating
|
|
100
|
+
broader: pd:Internal
|
|
101
|
+
- id: pd:Password
|
|
102
|
+
broader: pd:Authenticating
|
|
103
|
+
- id: dpx:PasswordVerifier
|
|
104
|
+
broader: pd:Authenticating
|
|
105
|
+
definition: Value derived from a password to check it, such as a hash, salt or verifier.
|
|
106
|
+
- id: pd:SecretText
|
|
107
|
+
broader: pd:Authenticating
|
|
108
|
+
- id: dpx:ClientSecret
|
|
109
|
+
broader: pd:SecretText
|
|
110
|
+
definition: Secret an application uses to authenticate itself, such as an OAuth client secret.
|
|
111
|
+
- id: dpx:AccessToken
|
|
112
|
+
broader: pd:Authenticating
|
|
113
|
+
definition: Bearer, API or refresh token that grants access on an individual's behalf.
|
|
114
|
+
- id: dpx:SessionToken
|
|
115
|
+
broader: pd:Authenticating
|
|
116
|
+
definition: Session identifier or session cookie that keeps an individual signed in.
|
|
117
|
+
|
|
118
|
+
# Financial.
|
|
119
|
+
- id: pd:Financial
|
|
120
|
+
broader: dpv:PersonalData
|
|
121
|
+
- id: pd:FinancialAccount
|
|
122
|
+
broader: pd:Financial
|
|
123
|
+
- id: pd:AccountIdentifier
|
|
124
|
+
broader: pd:FinancialAccount
|
|
125
|
+
- id: pd:FinancialAccountNumber
|
|
126
|
+
broader: pd:AccountIdentifier
|
|
127
|
+
- id: pd:BankAccount
|
|
128
|
+
broader: pd:FinancialAccount
|
|
129
|
+
- id: pd:PaymentCard
|
|
130
|
+
broader: pd:FinancialAccount
|
|
131
|
+
- id: pd:PaymentCardNumber
|
|
132
|
+
broader: pd:PaymentCard
|
|
133
|
+
- id: pd:PaymentCardExpiry
|
|
134
|
+
broader: pd:PaymentCard
|
|
135
|
+
- id: dpx:CardholderName
|
|
136
|
+
broader: pd:PaymentCard
|
|
137
|
+
definition: Name printed on a payment card.
|
|
138
|
+
- id: pd:Transactional
|
|
139
|
+
broader: pd:Financial
|
|
140
|
+
- id: pd:Transaction
|
|
141
|
+
broader: pd:Transactional
|
|
142
|
+
- id: pd:Purchase
|
|
143
|
+
broader: pd:Transactional
|
|
144
|
+
|
|
145
|
+
# Social.
|
|
146
|
+
- id: pd:Social
|
|
147
|
+
broader: dpv:PersonalData
|
|
148
|
+
- id: pd:Communication
|
|
149
|
+
broader: pd:Social
|
|
150
|
+
- id: pd:SocialMediaCommunication
|
|
151
|
+
broader: pd:Communication
|
|
152
|
+
- id: pd:Professional
|
|
153
|
+
broader: pd:Social
|
|
154
|
+
- id: pd:Salary
|
|
155
|
+
broader: pd:Professional
|
|
@@ -1,118 +1,107 @@
|
|
|
1
1
|
# PII signal rules consumed by `src/ai-enrichment/pii-signal-rules.ts`.
|
|
2
2
|
# Rule schema:
|
|
3
|
-
# - id:
|
|
4
|
-
# -
|
|
5
|
-
#
|
|
3
|
+
# - id: the personal-data type the rule detects, a concept CURIE from
|
|
4
|
+
# personal-data-taxonomy.yaml (DPV-based, DATAP-947). It is the data item id, the
|
|
5
|
+
# occurrence label and the label in thirdPartyDataFlow.dataShared. One rule per type.
|
|
6
|
+
# - category: report bucket for thirdPartyDataFlow.dataShared, one of
|
|
7
|
+
# [identifiers, profile_data, credentials]; not a data type
|
|
8
|
+
# - name_words: the words a source identifier uses for the type, in order (`email`;
|
|
9
|
+
# `phone`, `number`). Grouping and column matching find compound names by them
|
|
10
|
+
# (`customer_email`, `billingPhoneNumber`).
|
|
6
11
|
# - patterns: regex strings (compiled case-insensitive)
|
|
7
12
|
# Matching notes:
|
|
8
13
|
# - Rules are evaluated per source line.
|
|
9
14
|
# - A match still requires operation-context gating in the data-flow pass.
|
|
10
|
-
# - Prefer snake_case labels for consistency.
|
|
11
15
|
pii_signal_rules:
|
|
12
|
-
- id:
|
|
16
|
+
- id: dpx:FirstName
|
|
13
17
|
category: profile_data
|
|
14
|
-
|
|
15
|
-
- first_name
|
|
18
|
+
name_words: [first, name]
|
|
16
19
|
patterns:
|
|
17
20
|
- "\\b(first[_-]?name|firstname|given[_-]?name|forename|f[_-]?name|fname)\\b"
|
|
18
21
|
|
|
19
|
-
- id:
|
|
22
|
+
- id: dpx:LastName
|
|
20
23
|
category: profile_data
|
|
21
|
-
|
|
22
|
-
- last_name
|
|
24
|
+
name_words: [last, name]
|
|
23
25
|
patterns:
|
|
24
26
|
- "\\b(last[_-]?name|lastname|family[_-]?name|surname|l[_-]?name|lname)\\b"
|
|
25
27
|
|
|
26
|
-
- id:
|
|
28
|
+
- id: dpx:FullName
|
|
27
29
|
category: profile_data
|
|
28
|
-
|
|
29
|
-
- full_name
|
|
30
|
+
name_words: [full, name]
|
|
30
31
|
patterns:
|
|
31
32
|
- "\\b(full[_-]?name|fullname|display[_-]?name|legal[_-]?name|person[_-]?name)\\b"
|
|
32
33
|
|
|
33
|
-
- id:
|
|
34
|
+
- id: pd:BirthDate
|
|
34
35
|
category: profile_data
|
|
35
|
-
|
|
36
|
-
- date_of_birth
|
|
36
|
+
name_words: [date, of, birth]
|
|
37
37
|
patterns:
|
|
38
38
|
- "\\b(date[_-]?of[_-]?birth|dob|d\\.o\\.b|birth[_-]?date|birthdate|bday)\\b"
|
|
39
39
|
|
|
40
|
-
- id:
|
|
40
|
+
- id: pd:TelephoneNumber
|
|
41
41
|
category: profile_data
|
|
42
|
-
|
|
43
|
-
- phone_number
|
|
42
|
+
name_words: [phone, number]
|
|
44
43
|
patterns:
|
|
45
44
|
- "\\b(phone|phone[_-]?number|telephone|tel|mobile|mobile[_-]?number|cell|msisdn)\\b"
|
|
46
45
|
|
|
47
|
-
- id:
|
|
46
|
+
- id: pd:PhysicalAddress
|
|
48
47
|
category: profile_data
|
|
49
|
-
|
|
50
|
-
- address
|
|
48
|
+
name_words: [address]
|
|
51
49
|
patterns:
|
|
52
50
|
- "\\b(street[_-]?address|mailing[_-]?address|home[_-]?address|billing[_-]?address|shipping[_-]?address|postal[_-]?address|zip[_-]?code|postal[_-]?code|postcode)\\b"
|
|
53
51
|
|
|
54
|
-
- id:
|
|
52
|
+
- id: dpx:SocialSecurityNumber
|
|
55
53
|
category: identifiers
|
|
56
|
-
|
|
57
|
-
- social_security_number
|
|
54
|
+
name_words: [ssn]
|
|
58
55
|
patterns:
|
|
59
56
|
- "\\b(ssn|social[_-]?security[_-]?number|socialsecuritynumber|nin|national[_-]?insurance[_-]?number)\\b"
|
|
60
57
|
|
|
61
|
-
- id:
|
|
58
|
+
- id: pd:Passport
|
|
62
59
|
category: identifiers
|
|
63
|
-
|
|
64
|
-
- passport_number
|
|
60
|
+
name_words: [passport]
|
|
65
61
|
patterns:
|
|
66
62
|
- "\\b(passport[_-]?number|passport[_-]?no|pp[_-]?number|travel[_-]?document[_-]?number)\\b"
|
|
67
63
|
|
|
68
|
-
- id:
|
|
64
|
+
- id: dpx:NationalIdentityNumber
|
|
69
65
|
category: identifiers
|
|
70
|
-
|
|
71
|
-
- national_id
|
|
66
|
+
name_words: [national, id]
|
|
72
67
|
patterns:
|
|
73
68
|
- "\\b(national[_-]?id|national[_-]?identifier|nid|id[_-]?number|government[_-]?id|gov[_-]?id)\\b"
|
|
74
69
|
|
|
75
|
-
- id:
|
|
70
|
+
- id: dpx:DriversLicenseNumber
|
|
76
71
|
category: identifiers
|
|
77
|
-
|
|
78
|
-
- drivers_license_number
|
|
72
|
+
name_words: [drivers, license]
|
|
79
73
|
patterns:
|
|
80
74
|
- "\\b(driver['’]?s?[_-]?license|driverslicense|driving[_-]?license|driver[_-]?licence|dl[_-]?number|license[_-]?number|licence[_-]?number)\\b"
|
|
81
75
|
|
|
82
|
-
- id:
|
|
76
|
+
- id: dpx:TaxIdentificationNumber
|
|
83
77
|
category: identifiers
|
|
84
|
-
|
|
85
|
-
- tax_identifier
|
|
78
|
+
name_words: [tax, id]
|
|
86
79
|
patterns:
|
|
87
80
|
- "\\b(tax[_-]?id|taxid|tin|ein|vat[_-]?number|fiscal[_-]?code)\\b"
|
|
88
81
|
|
|
89
|
-
- id:
|
|
82
|
+
- id: pd:FinancialAccountNumber
|
|
90
83
|
category: identifiers
|
|
91
|
-
|
|
92
|
-
- account_number
|
|
84
|
+
name_words: [account, number]
|
|
93
85
|
patterns:
|
|
94
86
|
- "\\b(account[_-]?number|acct[_-]?number|iban|routing[_-]?number|sort[_-]?code|swift|bic)\\b"
|
|
95
87
|
|
|
96
|
-
- id:
|
|
88
|
+
- id: pd:Username
|
|
97
89
|
category: credentials
|
|
98
|
-
|
|
99
|
-
- username
|
|
90
|
+
name_words: [username]
|
|
100
91
|
patterns:
|
|
101
92
|
- "\\b(username|user[_-]?name|login|login[_-]?id|userid|user[_-]?id)\\b"
|
|
102
93
|
|
|
103
|
-
- id:
|
|
94
|
+
- id: pd:EmailAddress
|
|
104
95
|
category: credentials
|
|
105
|
-
|
|
106
|
-
- user_email
|
|
96
|
+
name_words: [email]
|
|
107
97
|
patterns:
|
|
108
98
|
- "\\b(email|email[_-]?address)\\b"
|
|
109
99
|
# A bare `mail` is an address unless it is used as a constant, a call, or an object
|
|
110
100
|
# whose member is not an address list (`Mail::Field`, `mail.subject`, `mail(`).
|
|
111
101
|
- "\\bmail\\b(?!\\s*(?:::|\\(|\\.(?!(?:to|from|cc|bcc|reply_to|sender|recipients)\\b)))"
|
|
112
102
|
|
|
113
|
-
- id:
|
|
103
|
+
- id: pd:Password
|
|
114
104
|
category: credentials
|
|
115
|
-
|
|
116
|
-
- user_password
|
|
105
|
+
name_words: [password]
|
|
117
106
|
patterns:
|
|
118
107
|
- "\\b(password|passwd|pass|pwd|passphrase|secret)\\b"
|
|
@@ -192,11 +192,11 @@ auth:
|
|
|
192
192
|
|
|
193
193
|
- id: oauth2
|
|
194
194
|
patternId: auth_middleware
|
|
195
|
+
# google.oauth2 and google_auth_oauthlib are client credentials for calling Google
|
|
196
|
+
# APIs, not an auth service in this application.
|
|
195
197
|
importModules:
|
|
196
198
|
- oauthlib
|
|
197
199
|
- authlib
|
|
198
|
-
- google.oauth2
|
|
199
|
-
- google_auth_oauthlib
|
|
200
200
|
strategy: oauth2
|
|
201
201
|
confidence: 0.85
|
|
202
202
|
|