Personally Identifiable Information (PII) such as customer names, emails, phone numbers, and addresses
should never be stored in configuration files. Magento configs (like app/etc/env.php or .env)
are often shared between environments or stored in repositories. If PII is embedded there, it can leak
through backups, version control, or deployment pipelines.
Minimizing PII in configuration ensures sensitive customer data is only kept in the database with proper access controls, not scattered in configs where it may be exposed to unauthorized users.
# Check for PII in env.php or .env
grep -Ei "(email|name|phone|address)" app/etc/env.php
grep -Ei "(email|name|phone|address)" .env
# Expected: no PII values present
# Scan Git history for leaked PII
trufflehog git file://. --regex --entropy=False
test@example.com) for testing environments.# app/etc/env.php
'admin' => [
'email' => 'jane.doe@customer.com', // PII in config → FAIL
]
# app/etc/env.php
'admin' => [
'email' => 'test@example.com', // Placeholder only, no PII
]