Skip to Content
dbmcp

PrestaShop

Privacy rules for PrestaShop 1.7.8, 8.2, and 9.0 on MySQL and MariaDB

Covers customers, addresses, employees, customer-service messages, sessions, API credentials, visitor logs, and four common modules; orders point to address rows instead of copying them.

Coverage

  • Versions: 1.7.8, 8.2, and 9.0; version-only keys carry a comment.
  • Engines: MySQL, MariaDB.
  • Table prefix: the template assumes unprefixed table names. PrestaShop prefixes every table with ps_ by default (database_prefix in app/config/parameters.php); prepend yours to every key.

Template

privacy:
  rules:
    emails:
      columns:
        - customer.email
        - employee.email
        - customer_thread.email
        - mail.recipient
        # Newsletter subscription (ps_emailsubscription) (optional)
        - emailsubscription.email
        # Stock alerts (ps_emailalerts) (optional)
        - mailalert_customer_oos.customer_email
      entity: EMAIL_ADDRESS
      operator: hash
    names:
      columns:
        - customer.firstname
        - customer.lastname
        - address.firstname
        - address.lastname
        - employee.firstname
        - employee.lastname
        - stock_mvt.employee_firstname
        - stock_mvt.employee_lastname
        - supply_order_history.employee_firstname
        - supply_order_history.employee_lastname
        - supply_order_receipt_history.employee_firstname
        - supply_order_receipt_history.employee_lastname
        # Product reviews (productcomments) (optional)
        - product_comment.customer_name
      entity: PERSON
      operator: hash
    phones:
      columns:
        - address.phone
        - address.phone_mobile
      entity: PHONE_NUMBER
      operator: hash
    addresses:
      columns:
        - address.address1
        - address.address2
        - address.city
      entity: LOCATION
      operator: hash
    postcodes:
      columns:
        - address.postcode
      entity: POSTCODE
      operator: hash
    companies:
      columns:
        - customer.company
        - address.company
      entity: ORGANIZATION
      operator: hash
    vat-numbers:
      columns:
        - address.vat_number
      entity: VAT_NUMBER
      operator: hash
    registry-numbers:
      columns:
        - customer.siret
      entity: COMMERCIAL_REGISTER
      operator: hash
    id-cards:
      columns:
        - address.dni
      entity: NATIONAL_ID
      operator: replace
    birth-dates:
      columns:
        - customer.birthday
      entity: DATE_OF_BIRTH
      operator: replace
    urls:
      columns:
        - customer.website
        - connections.http_referer
        - connections_source.http_referer
        - connections_source.request_uri
        # Newsletter subscription (ps_emailsubscription) (optional)
        - emailsubscription.http_referer
        # 404 log (pagesnotfound) (optional)
        - pagenotfound.request_uri
        - pagenotfound.http_referer
      entity: URL
      operator: replace
    ip-addresses:
      columns:
        - connections.ip_address
        - customer.ip_registration_newsletter
        - customer_message.ip_address
        # Newsletter subscription (ps_emailsubscription) (optional)
        - emailsubscription.ip_registration_newsletter
      entity: IP_ADDRESS
      operator: hash
    user-agents:
      columns:
        - customer_message.user_agent
      entity: USER_AGENT
      operator: hash
    text:
      columns:
        - customer.note
        - address.other
        - customer_message.message
        - message.message
        - cart.gift_message
        - orders.gift_message
        - orders.note
        - order_invoice.note
        - order_return.question
        # Product reviews (productcomments) (optional)
        - product_comment.title
        - product_comment.content
      entity: FREE_TEXT
      operator: replace
    passwords:
      columns:
        - customer.passwd
        - employee.passwd
        - referrer.passwd             # 1.7 only
      entity: PASSWORD_HASH
      operator: redact
    tokens:
      columns:
        - customer.secure_key
        - cart.secure_key
        - orders.secure_key
        - customer.reset_password_token
        - employee.reset_password_token
        - customer_session.token
        - employee_session.token
        - customer_thread.token
        - order_detail.download_hash
      entity: AUTH_TOKEN
      operator: redact
    secrets:
      columns:
        - webservice_account.key
        - api_access.client_secret    # 8.1–8.2
        - api_client.client_secret    # 9.0+
      entity: API_KEY
      operator: redact
    # Optional: mixed-content columns. Ruling them hides their non-personal content too; remove to keep it readable.
    mixed-content:
      columns:
        - cart.checkout_session_data
        - log.message
      entity: MIXED_CONTENT
      operator: replace

Choices

  • secure_key on customer, cart, and orders is a random key carried in order-confirmation and guest-tracking links.
  • webservice_account.key and customer_message.read are reserved words: the assistant's SQL must quote them with backticks.
  • Optional parts: delete the commented module columns you do not run and the mixed-content rule if the assistant needs those columns readable.
  • emailsubscription holds newsletter sign-ups without a customer account; account holders' sign-ups are in customer.

Trade-offs

  • Indexed ruled columns: customer.email, customer.passwd, employee.email, employee.passwd, webservice_account.key, mail.recipient, connections_source.http_referer, connections_source.request_uri, mailalert_customer_oos.customer_email.
  • Lookups that stop working: a customer, employee, subscriber, or sent mail by e-mail; a webservice account by key; visits grouped by IP or referrer.
  • Join keys that stay unruled: id_* columns, such as id_customer, id_address, and orders.id_address_delivery; also orders.reference.
  • IP formats differ: connections.ip_address is a BIGINT (ip2long), the other IP columns dotted text, so one address gets two tokens.

Not covered

  • customer.ape, last_passwd_gen, *.reset_password_validity: activity code and timestamps.
  • customer_message.file_name, the guest table: device details.
  • connections_source.keywords: the referring search engine's search terms.
  • mail.subject: template subjects.
  • contact, store, supplier, manufacturer, warehouse: the shop's own contact data.
  • mutation.mutator_identifier (9.0): who changed a record.

Sources

On this page