truthound-dashboard 1.2.1__py3-none-any.whl → 1.3.1__py3-none-any.whl
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.
- truthound_dashboard/api/deps.py +28 -0
- truthound_dashboard/api/drift.py +1 -0
- truthound_dashboard/api/mask.py +164 -0
- truthound_dashboard/api/profile.py +11 -3
- truthound_dashboard/api/router.py +22 -0
- truthound_dashboard/api/scan.py +168 -0
- truthound_dashboard/api/schemas.py +13 -4
- truthound_dashboard/api/validations.py +33 -1
- truthound_dashboard/api/validators.py +85 -0
- truthound_dashboard/core/__init__.py +8 -0
- truthound_dashboard/core/phase5/activity.py +1 -1
- truthound_dashboard/core/services.py +457 -7
- truthound_dashboard/core/truthound_adapter.py +441 -26
- truthound_dashboard/db/__init__.py +6 -0
- truthound_dashboard/db/models.py +250 -1
- truthound_dashboard/schemas/__init__.py +52 -1
- truthound_dashboard/schemas/collaboration.py +1 -1
- truthound_dashboard/schemas/drift.py +118 -3
- truthound_dashboard/schemas/mask.py +209 -0
- truthound_dashboard/schemas/profile.py +45 -2
- truthound_dashboard/schemas/scan.py +312 -0
- truthound_dashboard/schemas/schema.py +30 -2
- truthound_dashboard/schemas/validation.py +60 -3
- truthound_dashboard/schemas/validators/__init__.py +59 -0
- truthound_dashboard/schemas/validators/aggregate_validators.py +238 -0
- truthound_dashboard/schemas/validators/anomaly_validators.py +723 -0
- truthound_dashboard/schemas/validators/base.py +263 -0
- truthound_dashboard/schemas/validators/completeness_validators.py +269 -0
- truthound_dashboard/schemas/validators/cross_table_validators.py +375 -0
- truthound_dashboard/schemas/validators/datetime_validators.py +253 -0
- truthound_dashboard/schemas/validators/distribution_validators.py +422 -0
- truthound_dashboard/schemas/validators/drift_validators.py +615 -0
- truthound_dashboard/schemas/validators/geospatial_validators.py +486 -0
- truthound_dashboard/schemas/validators/multi_column_validators.py +706 -0
- truthound_dashboard/schemas/validators/privacy_validators.py +531 -0
- truthound_dashboard/schemas/validators/query_validators.py +510 -0
- truthound_dashboard/schemas/validators/registry.py +318 -0
- truthound_dashboard/schemas/validators/schema_validators.py +408 -0
- truthound_dashboard/schemas/validators/string_validators.py +396 -0
- truthound_dashboard/schemas/validators/table_validators.py +412 -0
- truthound_dashboard/schemas/validators/uniqueness_validators.py +355 -0
- truthound_dashboard/schemas/validators.py +59 -0
- truthound_dashboard/static/assets/index-BZG20KuF.js +586 -0
- truthound_dashboard/static/assets/index-D_HyZ3pb.css +1 -0
- truthound_dashboard/static/assets/unmerged_dictionaries-CtpqQBm0.js +1 -0
- truthound_dashboard/static/index.html +2 -2
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/METADATA +50 -11
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/RECORD +51 -27
- truthound_dashboard/static/assets/index-BqXVFyqj.js +0 -574
- truthound_dashboard/static/assets/index-o8qHVDte.css +0 -1
- truthound_dashboard/static/assets/unmerged_dictionaries-n_T3wZTf.js +0 -1
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/WHEEL +0 -0
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/entry_points.txt +0 -0
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
"""Privacy validators.
|
|
2
|
+
|
|
3
|
+
Validators for data privacy compliance (GDPR, CCPA, LGPD) and PII detection.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .base import (
|
|
7
|
+
ParameterDefinition,
|
|
8
|
+
ParameterType,
|
|
9
|
+
ValidatorCategory,
|
|
10
|
+
ValidatorDefinition,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
PRIVACY_VALIDATORS: list[ValidatorDefinition] = [
|
|
14
|
+
# PII Detection
|
|
15
|
+
ValidatorDefinition(
|
|
16
|
+
name="PIIDetection",
|
|
17
|
+
display_name="PII Detection",
|
|
18
|
+
category=ValidatorCategory.PRIVACY,
|
|
19
|
+
description="Detects Personally Identifiable Information (PII) in columns.",
|
|
20
|
+
parameters=[
|
|
21
|
+
ParameterDefinition(
|
|
22
|
+
name="columns",
|
|
23
|
+
label="Columns to Scan",
|
|
24
|
+
type=ParameterType.COLUMN_LIST,
|
|
25
|
+
description="Columns to scan (leave empty for all string columns)",
|
|
26
|
+
),
|
|
27
|
+
ParameterDefinition(
|
|
28
|
+
name="pii_types",
|
|
29
|
+
label="PII Types",
|
|
30
|
+
type=ParameterType.MULTI_SELECT,
|
|
31
|
+
description="Types of PII to detect",
|
|
32
|
+
options=[
|
|
33
|
+
{"value": "email", "label": "Email Address"},
|
|
34
|
+
{"value": "phone", "label": "Phone Number"},
|
|
35
|
+
{"value": "ssn", "label": "Social Security Number"},
|
|
36
|
+
{"value": "credit_card", "label": "Credit Card Number"},
|
|
37
|
+
{"value": "ip_address", "label": "IP Address"},
|
|
38
|
+
{"value": "name", "label": "Personal Name"},
|
|
39
|
+
{"value": "address", "label": "Physical Address"},
|
|
40
|
+
{"value": "date_of_birth", "label": "Date of Birth"},
|
|
41
|
+
{"value": "passport", "label": "Passport Number"},
|
|
42
|
+
{"value": "driver_license", "label": "Driver's License"},
|
|
43
|
+
],
|
|
44
|
+
),
|
|
45
|
+
ParameterDefinition(
|
|
46
|
+
name="sample_size",
|
|
47
|
+
label="Sample Size",
|
|
48
|
+
type=ParameterType.INTEGER,
|
|
49
|
+
description="Number of rows to sample (0 for all)",
|
|
50
|
+
default=1000,
|
|
51
|
+
min_value=0,
|
|
52
|
+
),
|
|
53
|
+
ParameterDefinition(
|
|
54
|
+
name="fail_on_detection",
|
|
55
|
+
label="Fail on Detection",
|
|
56
|
+
type=ParameterType.BOOLEAN,
|
|
57
|
+
description="Fail validation if PII is detected",
|
|
58
|
+
default=True,
|
|
59
|
+
),
|
|
60
|
+
],
|
|
61
|
+
tags=["privacy", "pii", "detection", "scan"],
|
|
62
|
+
severity_default="critical",
|
|
63
|
+
),
|
|
64
|
+
ValidatorDefinition(
|
|
65
|
+
name="EmailPII",
|
|
66
|
+
display_name="Email PII",
|
|
67
|
+
category=ValidatorCategory.PRIVACY,
|
|
68
|
+
description="Detects unprotected email addresses.",
|
|
69
|
+
parameters=[
|
|
70
|
+
ParameterDefinition(
|
|
71
|
+
name="columns",
|
|
72
|
+
label="Columns",
|
|
73
|
+
type=ParameterType.COLUMN_LIST,
|
|
74
|
+
description="Columns to check (leave empty for all)",
|
|
75
|
+
),
|
|
76
|
+
ParameterDefinition(
|
|
77
|
+
name="allow_hashed",
|
|
78
|
+
label="Allow Hashed",
|
|
79
|
+
type=ParameterType.BOOLEAN,
|
|
80
|
+
description="Allow hashed/masked email formats",
|
|
81
|
+
default=True,
|
|
82
|
+
),
|
|
83
|
+
ParameterDefinition(
|
|
84
|
+
name="allowed_domains",
|
|
85
|
+
label="Allowed Domains",
|
|
86
|
+
type=ParameterType.STRING_LIST,
|
|
87
|
+
description="Domains to whitelist (e.g., company.com)",
|
|
88
|
+
),
|
|
89
|
+
],
|
|
90
|
+
tags=["privacy", "pii", "email"],
|
|
91
|
+
severity_default="high",
|
|
92
|
+
),
|
|
93
|
+
ValidatorDefinition(
|
|
94
|
+
name="PhonePII",
|
|
95
|
+
display_name="Phone PII",
|
|
96
|
+
category=ValidatorCategory.PRIVACY,
|
|
97
|
+
description="Detects unprotected phone numbers.",
|
|
98
|
+
parameters=[
|
|
99
|
+
ParameterDefinition(
|
|
100
|
+
name="columns",
|
|
101
|
+
label="Columns",
|
|
102
|
+
type=ParameterType.COLUMN_LIST,
|
|
103
|
+
),
|
|
104
|
+
ParameterDefinition(
|
|
105
|
+
name="country_codes",
|
|
106
|
+
label="Country Codes",
|
|
107
|
+
type=ParameterType.STRING_LIST,
|
|
108
|
+
description="Country codes to detect (leave empty for all)",
|
|
109
|
+
),
|
|
110
|
+
ParameterDefinition(
|
|
111
|
+
name="allow_masked",
|
|
112
|
+
label="Allow Masked",
|
|
113
|
+
type=ParameterType.BOOLEAN,
|
|
114
|
+
description="Allow masked formats (XXX-XXX-1234)",
|
|
115
|
+
default=True,
|
|
116
|
+
),
|
|
117
|
+
],
|
|
118
|
+
tags=["privacy", "pii", "phone"],
|
|
119
|
+
severity_default="high",
|
|
120
|
+
),
|
|
121
|
+
ValidatorDefinition(
|
|
122
|
+
name="SSNDetection",
|
|
123
|
+
display_name="SSN Detection",
|
|
124
|
+
category=ValidatorCategory.PRIVACY,
|
|
125
|
+
description="Detects Social Security Numbers.",
|
|
126
|
+
parameters=[
|
|
127
|
+
ParameterDefinition(
|
|
128
|
+
name="columns",
|
|
129
|
+
label="Columns",
|
|
130
|
+
type=ParameterType.COLUMN_LIST,
|
|
131
|
+
),
|
|
132
|
+
ParameterDefinition(
|
|
133
|
+
name="allow_masked",
|
|
134
|
+
label="Allow Masked",
|
|
135
|
+
type=ParameterType.BOOLEAN,
|
|
136
|
+
description="Allow masked formats (XXX-XX-1234)",
|
|
137
|
+
default=True,
|
|
138
|
+
),
|
|
139
|
+
],
|
|
140
|
+
tags=["privacy", "pii", "ssn", "us"],
|
|
141
|
+
severity_default="critical",
|
|
142
|
+
),
|
|
143
|
+
ValidatorDefinition(
|
|
144
|
+
name="CreditCardDetection",
|
|
145
|
+
display_name="Credit Card Detection",
|
|
146
|
+
category=ValidatorCategory.PRIVACY,
|
|
147
|
+
description="Detects credit card numbers using Luhn algorithm.",
|
|
148
|
+
parameters=[
|
|
149
|
+
ParameterDefinition(
|
|
150
|
+
name="columns",
|
|
151
|
+
label="Columns",
|
|
152
|
+
type=ParameterType.COLUMN_LIST,
|
|
153
|
+
),
|
|
154
|
+
ParameterDefinition(
|
|
155
|
+
name="allow_masked",
|
|
156
|
+
label="Allow Masked",
|
|
157
|
+
type=ParameterType.BOOLEAN,
|
|
158
|
+
description="Allow last-4 digit formats",
|
|
159
|
+
default=True,
|
|
160
|
+
),
|
|
161
|
+
ParameterDefinition(
|
|
162
|
+
name="validate_luhn",
|
|
163
|
+
label="Validate Luhn",
|
|
164
|
+
type=ParameterType.BOOLEAN,
|
|
165
|
+
description="Use Luhn algorithm validation",
|
|
166
|
+
default=True,
|
|
167
|
+
),
|
|
168
|
+
],
|
|
169
|
+
tags=["privacy", "pii", "credit_card", "pci"],
|
|
170
|
+
severity_default="critical",
|
|
171
|
+
),
|
|
172
|
+
# Compliance Validators
|
|
173
|
+
ValidatorDefinition(
|
|
174
|
+
name="GDPRCompliance",
|
|
175
|
+
display_name="GDPR Compliance",
|
|
176
|
+
category=ValidatorCategory.PRIVACY,
|
|
177
|
+
description="Validates GDPR compliance requirements.",
|
|
178
|
+
parameters=[
|
|
179
|
+
ParameterDefinition(
|
|
180
|
+
name="check_pii",
|
|
181
|
+
label="Check PII",
|
|
182
|
+
type=ParameterType.BOOLEAN,
|
|
183
|
+
description="Scan for unprotected PII",
|
|
184
|
+
default=True,
|
|
185
|
+
),
|
|
186
|
+
ParameterDefinition(
|
|
187
|
+
name="check_consent",
|
|
188
|
+
label="Check Consent Column",
|
|
189
|
+
type=ParameterType.COLUMN,
|
|
190
|
+
description="Column containing consent flag",
|
|
191
|
+
),
|
|
192
|
+
ParameterDefinition(
|
|
193
|
+
name="check_retention",
|
|
194
|
+
label="Check Data Retention",
|
|
195
|
+
type=ParameterType.BOOLEAN,
|
|
196
|
+
description="Validate data retention policies",
|
|
197
|
+
default=False,
|
|
198
|
+
),
|
|
199
|
+
ParameterDefinition(
|
|
200
|
+
name="retention_date_column",
|
|
201
|
+
label="Retention Date Column",
|
|
202
|
+
type=ParameterType.COLUMN,
|
|
203
|
+
description="Column with data collection/update date",
|
|
204
|
+
depends_on="check_retention",
|
|
205
|
+
depends_value=True,
|
|
206
|
+
),
|
|
207
|
+
ParameterDefinition(
|
|
208
|
+
name="max_retention_days",
|
|
209
|
+
label="Max Retention Days",
|
|
210
|
+
type=ParameterType.INTEGER,
|
|
211
|
+
description="Maximum data retention period in days",
|
|
212
|
+
default=730,
|
|
213
|
+
min_value=1,
|
|
214
|
+
depends_on="check_retention",
|
|
215
|
+
depends_value=True,
|
|
216
|
+
),
|
|
217
|
+
ParameterDefinition(
|
|
218
|
+
name="sensitive_columns",
|
|
219
|
+
label="Sensitive Columns",
|
|
220
|
+
type=ParameterType.COLUMN_LIST,
|
|
221
|
+
description="Columns containing sensitive data (Art. 9)",
|
|
222
|
+
),
|
|
223
|
+
],
|
|
224
|
+
tags=["privacy", "gdpr", "compliance", "eu"],
|
|
225
|
+
severity_default="critical",
|
|
226
|
+
),
|
|
227
|
+
ValidatorDefinition(
|
|
228
|
+
name="CCPACompliance",
|
|
229
|
+
display_name="CCPA Compliance",
|
|
230
|
+
category=ValidatorCategory.PRIVACY,
|
|
231
|
+
description="Validates California Consumer Privacy Act compliance.",
|
|
232
|
+
parameters=[
|
|
233
|
+
ParameterDefinition(
|
|
234
|
+
name="check_pii",
|
|
235
|
+
label="Check PII",
|
|
236
|
+
type=ParameterType.BOOLEAN,
|
|
237
|
+
default=True,
|
|
238
|
+
),
|
|
239
|
+
ParameterDefinition(
|
|
240
|
+
name="check_opt_out",
|
|
241
|
+
label="Check Opt-Out Column",
|
|
242
|
+
type=ParameterType.COLUMN,
|
|
243
|
+
description="Column containing opt-out flag",
|
|
244
|
+
),
|
|
245
|
+
ParameterDefinition(
|
|
246
|
+
name="check_sale_flag",
|
|
247
|
+
label="Check Sale Flag",
|
|
248
|
+
type=ParameterType.COLUMN,
|
|
249
|
+
description="Column indicating data sale consent",
|
|
250
|
+
),
|
|
251
|
+
ParameterDefinition(
|
|
252
|
+
name="minor_age_column",
|
|
253
|
+
label="Minor Age Column",
|
|
254
|
+
type=ParameterType.COLUMN,
|
|
255
|
+
description="Column with age for minor protection",
|
|
256
|
+
),
|
|
257
|
+
],
|
|
258
|
+
tags=["privacy", "ccpa", "compliance", "california"],
|
|
259
|
+
severity_default="critical",
|
|
260
|
+
),
|
|
261
|
+
ValidatorDefinition(
|
|
262
|
+
name="LGPDCompliance",
|
|
263
|
+
display_name="LGPD Compliance",
|
|
264
|
+
category=ValidatorCategory.PRIVACY,
|
|
265
|
+
description="Validates Brazilian LGPD compliance requirements.",
|
|
266
|
+
parameters=[
|
|
267
|
+
ParameterDefinition(
|
|
268
|
+
name="check_pii",
|
|
269
|
+
label="Check PII",
|
|
270
|
+
type=ParameterType.BOOLEAN,
|
|
271
|
+
default=True,
|
|
272
|
+
),
|
|
273
|
+
ParameterDefinition(
|
|
274
|
+
name="check_cpf",
|
|
275
|
+
label="Check CPF",
|
|
276
|
+
type=ParameterType.BOOLEAN,
|
|
277
|
+
description="Detect Brazilian CPF numbers",
|
|
278
|
+
default=True,
|
|
279
|
+
),
|
|
280
|
+
ParameterDefinition(
|
|
281
|
+
name="check_consent",
|
|
282
|
+
label="Check Consent Column",
|
|
283
|
+
type=ParameterType.COLUMN,
|
|
284
|
+
),
|
|
285
|
+
ParameterDefinition(
|
|
286
|
+
name="purpose_column",
|
|
287
|
+
label="Purpose Column",
|
|
288
|
+
type=ParameterType.COLUMN,
|
|
289
|
+
description="Column documenting data processing purpose",
|
|
290
|
+
),
|
|
291
|
+
],
|
|
292
|
+
tags=["privacy", "lgpd", "compliance", "brazil"],
|
|
293
|
+
severity_default="critical",
|
|
294
|
+
),
|
|
295
|
+
# Data Retention
|
|
296
|
+
ValidatorDefinition(
|
|
297
|
+
name="DataRetention",
|
|
298
|
+
display_name="Data Retention",
|
|
299
|
+
category=ValidatorCategory.PRIVACY,
|
|
300
|
+
description="Validates data retention policies.",
|
|
301
|
+
parameters=[
|
|
302
|
+
ParameterDefinition(
|
|
303
|
+
name="date_column",
|
|
304
|
+
label="Date Column",
|
|
305
|
+
type=ParameterType.COLUMN,
|
|
306
|
+
description="Column with record creation/update date",
|
|
307
|
+
required=True,
|
|
308
|
+
),
|
|
309
|
+
ParameterDefinition(
|
|
310
|
+
name="max_age_days",
|
|
311
|
+
label="Max Age (Days)",
|
|
312
|
+
type=ParameterType.INTEGER,
|
|
313
|
+
description="Maximum allowed age in days",
|
|
314
|
+
required=True,
|
|
315
|
+
min_value=1,
|
|
316
|
+
),
|
|
317
|
+
ParameterDefinition(
|
|
318
|
+
name="category_column",
|
|
319
|
+
label="Category Column",
|
|
320
|
+
type=ParameterType.COLUMN,
|
|
321
|
+
description="Column for category-based retention",
|
|
322
|
+
),
|
|
323
|
+
ParameterDefinition(
|
|
324
|
+
name="category_retention",
|
|
325
|
+
label="Category Retention Rules",
|
|
326
|
+
type=ParameterType.SCHEMA,
|
|
327
|
+
description="JSON: {category: max_days}",
|
|
328
|
+
placeholder='{"financial": 2555, "marketing": 365}',
|
|
329
|
+
depends_on="category_column",
|
|
330
|
+
),
|
|
331
|
+
],
|
|
332
|
+
tags=["privacy", "retention", "policy"],
|
|
333
|
+
severity_default="high",
|
|
334
|
+
),
|
|
335
|
+
# Masking & Anonymization
|
|
336
|
+
ValidatorDefinition(
|
|
337
|
+
name="MaskingVerification",
|
|
338
|
+
display_name="Masking Verification",
|
|
339
|
+
category=ValidatorCategory.PRIVACY,
|
|
340
|
+
description="Verifies that sensitive columns are properly masked.",
|
|
341
|
+
parameters=[
|
|
342
|
+
ParameterDefinition(
|
|
343
|
+
name="column",
|
|
344
|
+
label="Column",
|
|
345
|
+
type=ParameterType.COLUMN,
|
|
346
|
+
required=True,
|
|
347
|
+
),
|
|
348
|
+
ParameterDefinition(
|
|
349
|
+
name="masking_type",
|
|
350
|
+
label="Masking Type",
|
|
351
|
+
type=ParameterType.SELECT,
|
|
352
|
+
required=True,
|
|
353
|
+
options=[
|
|
354
|
+
{"value": "full", "label": "Full Masking (******)"},
|
|
355
|
+
{"value": "partial", "label": "Partial Masking (***1234)"},
|
|
356
|
+
{"value": "hash", "label": "Hash (SHA256, MD5)"},
|
|
357
|
+
{"value": "tokenization", "label": "Tokenization (UUID)"},
|
|
358
|
+
{"value": "redacted", "label": "Redacted ([REDACTED])"},
|
|
359
|
+
],
|
|
360
|
+
),
|
|
361
|
+
ParameterDefinition(
|
|
362
|
+
name="visible_chars",
|
|
363
|
+
label="Visible Characters",
|
|
364
|
+
type=ParameterType.INTEGER,
|
|
365
|
+
description="Number of visible characters (for partial masking)",
|
|
366
|
+
default=4,
|
|
367
|
+
min_value=0,
|
|
368
|
+
depends_on="masking_type",
|
|
369
|
+
depends_value="partial",
|
|
370
|
+
),
|
|
371
|
+
],
|
|
372
|
+
tags=["privacy", "masking", "anonymization"],
|
|
373
|
+
severity_default="high",
|
|
374
|
+
),
|
|
375
|
+
ValidatorDefinition(
|
|
376
|
+
name="AnonymizationCheck",
|
|
377
|
+
display_name="Anonymization Check",
|
|
378
|
+
category=ValidatorCategory.PRIVACY,
|
|
379
|
+
description="Verifies k-anonymity and l-diversity requirements.",
|
|
380
|
+
parameters=[
|
|
381
|
+
ParameterDefinition(
|
|
382
|
+
name="quasi_identifiers",
|
|
383
|
+
label="Quasi-Identifiers",
|
|
384
|
+
type=ParameterType.COLUMN_LIST,
|
|
385
|
+
description="Columns that could identify individuals indirectly",
|
|
386
|
+
required=True,
|
|
387
|
+
),
|
|
388
|
+
ParameterDefinition(
|
|
389
|
+
name="k_anonymity",
|
|
390
|
+
label="K-Anonymity",
|
|
391
|
+
type=ParameterType.INTEGER,
|
|
392
|
+
description="Minimum group size for k-anonymity",
|
|
393
|
+
default=5,
|
|
394
|
+
min_value=2,
|
|
395
|
+
),
|
|
396
|
+
ParameterDefinition(
|
|
397
|
+
name="sensitive_column",
|
|
398
|
+
label="Sensitive Column",
|
|
399
|
+
type=ParameterType.COLUMN,
|
|
400
|
+
description="Column for l-diversity check",
|
|
401
|
+
),
|
|
402
|
+
ParameterDefinition(
|
|
403
|
+
name="l_diversity",
|
|
404
|
+
label="L-Diversity",
|
|
405
|
+
type=ParameterType.INTEGER,
|
|
406
|
+
description="Minimum distinct values for l-diversity",
|
|
407
|
+
default=3,
|
|
408
|
+
min_value=2,
|
|
409
|
+
depends_on="sensitive_column",
|
|
410
|
+
),
|
|
411
|
+
],
|
|
412
|
+
tags=["privacy", "anonymization", "k_anonymity", "l_diversity"],
|
|
413
|
+
severity_default="high",
|
|
414
|
+
),
|
|
415
|
+
# Sensitive Data Classification
|
|
416
|
+
ValidatorDefinition(
|
|
417
|
+
name="SensitiveDataClassification",
|
|
418
|
+
display_name="Sensitive Data Classification",
|
|
419
|
+
category=ValidatorCategory.PRIVACY,
|
|
420
|
+
description="Classifies and validates sensitive data handling.",
|
|
421
|
+
parameters=[
|
|
422
|
+
ParameterDefinition(
|
|
423
|
+
name="columns",
|
|
424
|
+
label="Columns to Classify",
|
|
425
|
+
type=ParameterType.COLUMN_LIST,
|
|
426
|
+
),
|
|
427
|
+
ParameterDefinition(
|
|
428
|
+
name="classification_levels",
|
|
429
|
+
label="Classification Levels",
|
|
430
|
+
type=ParameterType.MULTI_SELECT,
|
|
431
|
+
description="Expected classification levels",
|
|
432
|
+
options=[
|
|
433
|
+
{"value": "public", "label": "Public"},
|
|
434
|
+
{"value": "internal", "label": "Internal"},
|
|
435
|
+
{"value": "confidential", "label": "Confidential"},
|
|
436
|
+
{"value": "restricted", "label": "Restricted"},
|
|
437
|
+
{"value": "pii", "label": "PII"},
|
|
438
|
+
{"value": "phi", "label": "PHI (Health)"},
|
|
439
|
+
{"value": "pci", "label": "PCI (Payment)"},
|
|
440
|
+
],
|
|
441
|
+
),
|
|
442
|
+
ParameterDefinition(
|
|
443
|
+
name="max_allowed_level",
|
|
444
|
+
label="Max Allowed Level",
|
|
445
|
+
type=ParameterType.SELECT,
|
|
446
|
+
description="Maximum classification level allowed in dataset",
|
|
447
|
+
options=[
|
|
448
|
+
{"value": "public", "label": "Public Only"},
|
|
449
|
+
{"value": "internal", "label": "Up to Internal"},
|
|
450
|
+
{"value": "confidential", "label": "Up to Confidential"},
|
|
451
|
+
],
|
|
452
|
+
),
|
|
453
|
+
],
|
|
454
|
+
tags=["privacy", "classification", "sensitive"],
|
|
455
|
+
severity_default="high",
|
|
456
|
+
),
|
|
457
|
+
ValidatorDefinition(
|
|
458
|
+
name="AgeVerification",
|
|
459
|
+
display_name="Age Verification",
|
|
460
|
+
category=ValidatorCategory.PRIVACY,
|
|
461
|
+
description="Validates age-related privacy requirements (COPPA, etc.).",
|
|
462
|
+
parameters=[
|
|
463
|
+
ParameterDefinition(
|
|
464
|
+
name="age_column",
|
|
465
|
+
label="Age Column",
|
|
466
|
+
type=ParameterType.COLUMN,
|
|
467
|
+
description="Column containing age or birth date",
|
|
468
|
+
required=True,
|
|
469
|
+
),
|
|
470
|
+
ParameterDefinition(
|
|
471
|
+
name="min_age",
|
|
472
|
+
label="Minimum Age",
|
|
473
|
+
type=ParameterType.INTEGER,
|
|
474
|
+
description="Minimum required age",
|
|
475
|
+
default=13,
|
|
476
|
+
min_value=0,
|
|
477
|
+
),
|
|
478
|
+
ParameterDefinition(
|
|
479
|
+
name="consent_column",
|
|
480
|
+
label="Parental Consent Column",
|
|
481
|
+
type=ParameterType.COLUMN,
|
|
482
|
+
description="Column containing parental consent for minors",
|
|
483
|
+
),
|
|
484
|
+
ParameterDefinition(
|
|
485
|
+
name="minor_threshold",
|
|
486
|
+
label="Minor Threshold Age",
|
|
487
|
+
type=ParameterType.INTEGER,
|
|
488
|
+
description="Age threshold for minor classification",
|
|
489
|
+
default=18,
|
|
490
|
+
min_value=0,
|
|
491
|
+
),
|
|
492
|
+
],
|
|
493
|
+
tags=["privacy", "age", "coppa", "minor"],
|
|
494
|
+
severity_default="critical",
|
|
495
|
+
),
|
|
496
|
+
ValidatorDefinition(
|
|
497
|
+
name="CrossBorderDataTransfer",
|
|
498
|
+
display_name="Cross-Border Data Transfer",
|
|
499
|
+
category=ValidatorCategory.PRIVACY,
|
|
500
|
+
description="Validates cross-border data transfer compliance.",
|
|
501
|
+
parameters=[
|
|
502
|
+
ParameterDefinition(
|
|
503
|
+
name="country_column",
|
|
504
|
+
label="Country Column",
|
|
505
|
+
type=ParameterType.COLUMN,
|
|
506
|
+
description="Column containing destination country",
|
|
507
|
+
),
|
|
508
|
+
ParameterDefinition(
|
|
509
|
+
name="allowed_countries",
|
|
510
|
+
label="Allowed Countries",
|
|
511
|
+
type=ParameterType.STRING_LIST,
|
|
512
|
+
description="List of allowed destination countries",
|
|
513
|
+
),
|
|
514
|
+
ParameterDefinition(
|
|
515
|
+
name="restricted_countries",
|
|
516
|
+
label="Restricted Countries",
|
|
517
|
+
type=ParameterType.STRING_LIST,
|
|
518
|
+
description="List of restricted countries (embargoed, etc.)",
|
|
519
|
+
),
|
|
520
|
+
ParameterDefinition(
|
|
521
|
+
name="adequacy_countries",
|
|
522
|
+
label="Adequacy Countries",
|
|
523
|
+
type=ParameterType.STRING_LIST,
|
|
524
|
+
description="Countries with GDPR adequacy decisions",
|
|
525
|
+
default=["CA", "JP", "KR", "GB", "CH", "NZ", "IL", "AR", "UY"],
|
|
526
|
+
),
|
|
527
|
+
],
|
|
528
|
+
tags=["privacy", "cross_border", "transfer", "international"],
|
|
529
|
+
severity_default="high",
|
|
530
|
+
),
|
|
531
|
+
]
|