Skip to Content
dbmcp

Mattermost

Privacy rules for Mattermost 10.11 to 12.1 on PostgreSQL, and 10.11 on MySQL

Covers Mattermost users' e-mail addresses, names, usernames, IP addresses, password hashes, session, OAuth, and integration secrets, and message content.

Coverage

  • Versions: 10.11 ESR to 12.1.
  • Engines: PostgreSQL; MySQL on 10.11 only (11.0 removed it).
  • Table prefix: the template assumes unprefixed table names. Mattermost uses no table prefix.

Template

privacy:
  rules:
    emails:
      columns:
        - users.email
        - teams.email
        - compliances.emails
      entity: EMAIL_ADDRESS
      operator: hash
    names:
      columns:
        - users.username
        - users.firstname
        - users.lastname
        - users.nickname
        - outgoingoauthconnections.credentialsusername
      entity: PERSON
      operator: hash
    user-ids:
      columns:
        - users.authdata
        - sessions.deviceid
        - sessions.voipdeviceid
      entity: USER_ID
      operator: hash
    ip-addresses:
      columns:
        - audits.ipaddress
      entity: IP_ADDRESS
      operator: hash
    text:
      columns:
        # Message content (optional)
        - posts.message
        - posts.props
        - drafts.message
        - drafts.props
        - scheduledposts.message
        - scheduledposts.props
        - fileinfo.content
        - temporaryposts.message
        - translations.text
        - channeljoinrequests.message
      entity: FREE_TEXT
      operator: replace
    passwords:
      columns:
        - users.password
      entity: PASSWORD_HASH
      operator: redact
    plaintext-passwords:
      columns:
        - outgoingoauthconnections.credentialspassword
      entity: PASSWORD
      operator: redact
    tokens:
      columns:
        - sessions.token
        - tokens.token
        - desktoptokens.token
        - teams.inviteid
      entity: AUTH_TOKEN
      operator: redact
    otp-secrets:
      columns:
        - users.mfasecret
      entity: OTP_SECRET
      operator: redact
    secrets:
      columns:
        - useraccesstokens.token
        - oauthaccessdata.token
        - oauthaccessdata.refreshtoken
        - oauthauthdata.code
        - oauthapps.clientsecret
        - outgoingoauthconnections.clientsecret
        - remoteclusters.token
        - remoteclusters.remotetoken
        - commands.token
        - outgoingwebhooks.token
      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:
        - users.props
        - users.notifyprops
        - users.timezone
        - sessions.props
        - tokens.extra
        - audits.extrainfo
        - pluginkeyvaluestore.pvalue
      entity: MIXED_CONTENT
      operator: replace

Choices

  • users.authdata is the user's id at the SSO provider, often the e-mail address under SAML.
  • teams.inviteid makes up the team invite link; sessions.deviceid (and voipdeviceid, 11.9+) holds the mobile push device id.
  • pluginkeyvaluestore.pvalue can hold per-user plugin credentials; dropping mixed-content exposes them.
  • Optional parts: delete the commented message-content columns if the assistant should read posts, and the mixed-content rule if it needs those columns readable.

Trade-offs

  • Indexed ruled columns: users.email, username, authdata, nickname, firstname, lastname; useraccesstokens.token; tokens.token; desktoptokens.token; oauthaccessdata.token, refreshtoken; oauthauthdata.code; sessions.token; teams.inviteid; posts.message, fileinfo.content (message content).
  • Lookups that stop working: users by e-mail, username, or name; audit rows by IP; sessions, access tokens, or invites by token; with message content, post search by text.
  • Join keys that stay unruled: users.id and every userid, audits.sessionid, oauthaccessdata.clientid, remoteclusters.remoteid.

Not covered

  • incomingwebhooks.id: the webhook URL's secret, and the table's key.
  • channels.displayname, publicchannels.displayname of group messages: members' usernames.
  • propertyvalues.value, recentsearches.query: custom profile attributes and users' search terms.
  • preferences.value, channelmembers.notifyprops, jobs.data, linkmetadata.data, views.props: settings, job parameters, link previews.
  • fileinfo.name, path, uploadsessions.filename: file names that name people.
  • Plugin tables (Playbooks ir_*, Boards, Calls): created by each plugin.

Sources

On this page