Skip to content

Security: Implement encryption for User PII (Zenvia tracking data) #2241

@LuizFNJ

Description

@LuizFNJ

Background Information

In compliance with LGPD and GDPR privacy regulations, we have identified the need to strengthen the security of our user tracking processes. Currently, sensitive data originating from Zenvia—such as usernames and WhatsApp numbers—is being stored in plain text.

To ensure the protection of Personally Identifiable Information (PII), we must implement an encryption layer at the database level. This ensures that sensitive information is not exposed in clear text, mitigating risks in the event of unauthorized infrastructure access.

How

  • Encryption Implementation: Utilize the native Node.js crypto module to encrypt sensitive strings before persistence.
    • Suggestion: Use the aes-256-gcm algorithm as it provides both data confidentiality and authentication.
  • Tracking Service Refactor: Update the tracking logic so that the username and phone number (WhatsApp) are encrypted before being saved to the database.
  • Key Management: Define a secure strategy for managing the encryption keys and Initialization Vectors (IV) using protected environment variables.
  • Controlled Decryption: Ensure that decryption only occurs at strict, authorized points within the application where viewing this data is absolutely necessary.

Expected Behavior

All sensitive end-user data collected via the chatbot (Zenvia) must be stored in an encrypted format. The system should maintain tracking integrity while ensuring that no PII is exposed in plain text within the database.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions