Skip to content

Commit a4d90bf

Browse files
authored
Merge pull request #24 from tareq-halaby/feat/configurable-masking
feat: add configurable masking patterns
2 parents dba6bbd + ffdd21a commit a4d90bf

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

config/masking.php

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
/**
4+
* Masking Configuration
5+
*
6+
* Define custom column patterns for sensitive data masking.
7+
* Columns matching any of these patterns will have their values
8+
* replaced with masked equivalents during database cloning.
9+
*/
10+
11+
return [
12+
/*
13+
|--------------------------------------------------------------------------
14+
| Sensitive Column Patterns
15+
|--------------------------------------------------------------------------
16+
|
17+
| List of column name patterns (case-insensitive substring match) that
18+
| should be masked. Add your custom patterns here.
19+
|
20+
*/
21+
'sensitive_patterns' => [
22+
// Identity & credentials
23+
'password',
24+
'passwd',
25+
'secret',
26+
'token',
27+
'api_key',
28+
'auth_key',
29+
30+
// Personal identifiers
31+
'ssn',
32+
'national_id',
33+
'passport',
34+
'tax_id',
35+
'tax_reference',
36+
'fiscal_id',
37+
38+
// Financial
39+
'credit_card',
40+
'card_number',
41+
'iban',
42+
'bank_account',
43+
'routing_number',
44+
45+
// Contact information
46+
'email',
47+
'phone',
48+
'mobile',
49+
'address',
50+
51+
// Health & sensitive data
52+
'medical',
53+
'health',
54+
'diagnosis',
55+
'dob',
56+
'date_of_birth',
57+
],
58+
59+
/*
60+
|--------------------------------------------------------------------------
61+
| Mask Replacement Values
62+
|--------------------------------------------------------------------------
63+
|
64+
| Define how masked values should look for different column types.
65+
|
66+
*/
67+
'mask_values' => [
68+
'email' => 'masked@example.com',
69+
'phone' => '+49-000-000-0000',
70+
'password' => '$2y$10$MASKED_HASH_PLACEHOLDER_ONLY',
71+
'default' => '*** MASKED ***',
72+
],
73+
];

0 commit comments

Comments
 (0)