| name | awcms-micro-sensitive-data |
| description | Tangani data sensitif AWCMS-Micro (email, phone, WhatsApp, NPWP, NIK, NITKU, receipt token) dengan normalize, hash lookup, dan masking. Gunakan saat menyimpan/menampilkan identifier, membuat profile identifier, atau menyusun DTO/response/log. Sesuai doc 04. |
AWCMS-Micro — Sensitive Data Handling
Ikuti docs/awcms-micro/04_erd_data_dictionary.md (klasifikasi & masking).
Pipeline identifier
flowchart LR
In[Raw identifier] --> Norm[Normalisasi] --> Hash[value_hash - lookup/dedup unik]
Norm --> Mask[masked_value - tampilan]
Hash & Mask --> DB[(Simpan)]
DB -. tidak pernah .-> Raw[Response/log/audit mentah]
Aturan
- Simpan
normalized_value, value_hash, masked_value. Unik (tenant_id, identifier_type, value_hash).
- Response umum hanya tampilkan
masked_value; nilai penuh hanya untuk role berwenang lewat awcms-micro-abac-guard.
- Jangan kirim raw value ke response/log/audit/event.
- Gunakan
normalizeIdentifier/hashIdentifier/maskIdentifier
(src/modules/profile-identity/domain/identifier.ts) untuk mengubah
raw value → safe DTO — dipanggil langsung dari caller (mis.
identity-access/application/password-reset.ts,
email/application/suppression-directory.ts), tidak ada layer
mapper terpisah (infrastructure/mappers.ts tidak pernah dibangun;
sebagian besar modul bahkan tidak punya folder infrastructure/).
- Receipt token: non-sequential, tidak mudah ditebak.
- Password hanya hash modern;
password_hash tidak pernah keluar.
Klasifikasi
| Data | Level | Kontrol |
|---|
| Password hash, API key/token | Critical | Never expose / env only |
| NPWP/NIK/NITKU | High | Mask + ABAC tax role |
| Phone/WhatsApp/email | High | Mask + hash lookup |
| Address | Medium/High | Need-to-know |
| Tax invoice/XML | High | Tax role, audit, checksum |
Verifikasi
- Response/log tidak memuat nilai sensitif penuh.
- Duplicate identifier tidak membuat profile baru (dedup via hash).
- Konsisten dengan redaction logger &
awcms-micro-audit-log.