mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* docs(P13e): reconcile drift for Administration Guide onboard/upgrade/comply pages Ports content changes made in the legacy Sphinx docs repo since the P13 migration fork point (2026-05-14) into the corresponding MDX pages: SAML/SSO Entra ID namespace-matching guidance, granular permissions updates, upgrade notes for v11.7/v11.8, OSS component list, and minor typo/link fixes across onboard, upgrade, and comply sections. * docs(P13e): fix MDX compile failure from blank lines inside <pre><code> blocks Blank lines inside JSX <pre><code> blocks are parsed as paragraph boundaries by MDX, breaking the enclosing tag matching. Remove the blank lines used for SQL readability while keeping each statement on its own line. * docs(P13e): fix insecure curl example and legacy absolute doc link - electronic-discovery.mdx: use https for the authenticated curl example, matching the other curl examples in the same page. - important-upgrade-notes.mdx: point the Deprecated Features reference at the local route instead of the legacy docs.mattermost.com URL. --------- Co-authored-by: Hanzo Dev <[email protected]>
114 lines
6.3 KiB
Plaintext
114 lines
6.3 KiB
Plaintext
---
|
|
title: "Electronic discovery"
|
|
---
|
|
<PlanAvailability slug="ent-plus" />
|
|
|
|
Electronic discovery (also known as eDiscovery) refers to a process where electronic data is searched with the intent to use it as evidence in a legal case.
|
|
|
|
This page describes how to extract data from Mattermost for eDiscovery. There are three primary methods that can be used to accomplish the goal of extracting user post data from Mattermost:
|
|
|
|
- [Mattermost Compliance Exports](/administration-guide/comply/compliance-export)
|
|
- [Mattermost RESTful API](/administration-guide/comply/electronic-discovery#mattermost-restful-api)
|
|
- [Mattermost database using standard SQL queries](/administration-guide/comply/electronic-discovery#mattermost-database)
|
|
|
|
Each of the options is discussed in detail below.
|
|
|
|
<Note>
|
|
|
|
Litigation hold (also known as legal hold) is an extension of eDiscovery where in addition to searching for records, no electronically stored information nor paper documents may be discarded if they may be deemed relevant for a present or future legal case.
|
|
|
|
</Note>
|
|
|
|
## Mattermost compliance exports
|
|
|
|
Mattermost Enterprise has compliance report export capabilities.
|
|
|
|
Mattermost can export compliance related data, including the content of messages and who might have seen those messages, in three formats: Actiance XML, Global Relay EML, and generic CSV. Reports can be configured to run on a delay basis and stored in a shared location.
|
|
|
|
For more information about the exports feature and how to set up reporting, see [our documentation](/administration-guide/comply/compliance-export).
|
|
|
|
## Mattermost RESTful API
|
|
|
|
The Mattermost API can be used to export a user's posts in CSV compliance format that is part of Mattermost Enterprise. The following section outlines how to use the API to create and retrieve a report for a specific user via the API. Please note that full documentation for the Mattermost API can be found at [https://api.mattermost.com](https://api.mattermost.com).
|
|
|
|
To use the API, you must first authenticate [as described here](https://api.mattermost.com/#tag/authentication). The account you are authenticating with must have `manage_system` permissions. If you are using curl, you can authenticate using the following command:
|
|
|
|
``` sh
|
|
curl -i -d '{"login_id": "username", "password": "password"}' https://yourmattermosturl/api/v4/users/login
|
|
```
|
|
|
|
Mattermost will return a response that looks like this:
|
|
|
|
``` text
|
|
HTTP/2 200
|
|
server: nginx/1.10.3 (Ubuntu)
|
|
date: Thu, 12 Jul 2018 14:43:45 GMT
|
|
content-type: application/json
|
|
content-length: 679
|
|
set-cookie: MMAUTHTOKEN=yi94pwci6ibjfc9phbikhqutbe; Path=/; Expires=Sat, 11 Aug 2018 14:43:45 GMT; Max-Age=2592000; HttpOnly; Secure
|
|
set-cookie: MMUSERID=qfjzamfg47bu9gsyyfbqjk4s6a; Path=/; Expires=Sat, 11 Aug 2018 14:43:45 GMT; Max-Age=2592000; Secure
|
|
token: yi94pwci6ibjfc9phbikhqutbe
|
|
x-request-id: 5y45pxyfxpb8updtge1zts39he
|
|
x-version-id: 5.0.0.5.0.1.18c0fbd759664a85fe95132bb7fc04cf.true
|
|
```
|
|
|
|
Include the `token` value sent in the response as part of the Authorization header on your future API requests with the Bearer method, e.g.:
|
|
|
|
``` sh
|
|
curl -i -H 'Authorization: Bearer yi94pwci6ibjfc9phbikhqutbe' https://yourmattermosturl/api/v4/users/me
|
|
```
|
|
|
|
Once you're authenticated into Mattermost, you can use the [Compliance API to create a new compliance report](https://api.mattermost.com/#tag/compliance%2Fpaths%2F~1compliance~1reports%2Fpost). The curl based example below demonstrates how to send a request that bases the authentication token and asks Mattermost to create a report that spans posts from Dec 31, 2017 - 8:15 PM to Dec 31, 2018 - 8:15 PM for a user with the email address [[email protected]](mailto:[email protected]):
|
|
|
|
<Note>
|
|
|
|
The data in the JSON payload must be formatted as Unix Epoch. A tool like [https://www.epochconverter.com/](https://www.epochconverter.com/) can be useful when converting to and from the required format.
|
|
|
|
</Note>
|
|
|
|
``` sh
|
|
curl --header "Content-Type: application/json" \
|
|
--request POST \
|
|
-H 'Authorization: Bearer yi94pwci6ibjfc9phbikhqutbe' \
|
|
--data '{"id":"","create_at":0,"user_id":"craig","status":"","count":0,"desc":" ","type":"","start_at":1514769359000,"end_at": 1546305359000,"keywords":"","emails":"[email protected]"}' \
|
|
https://yourmattermosturl/api/v4/compliance/reports
|
|
```
|
|
|
|
If the post is successful, Mattermost will return a message that looks like the following, indicating that the server is running the compliance export process:
|
|
|
|
``` json
|
|
{"id":"du6kektczifqxexeroywpz3nbc"," create_at":1531444617901, "user_id":"qfjzamfg47bu9gsyyfbqjk4s6a", "status":"running", "count":0, "desc":" ", "type":"adhoc", "start_at":1514769359000, "end_at":1546305359000, "keywords":"", "emails":"[email protected]"}
|
|
```
|
|
|
|
When the export process is complete (the execution time is based on the number of records to return and the current server load), you will need to send another HTTP Post request to Mattermost to retrieve and download a zip file containing the report that looks like the following curl request:
|
|
|
|
``` sh
|
|
curl --request GET \
|
|
-H 'Authorization: Bearer p9o1qx457fbc9gdrn39z9ah59o' \
|
|
--data '{"status_code":0,"id":"du6kektczifqxexeroywpz3nbc","message":"","requestion_id":""}' \
|
|
--output report-zip.zip \
|
|
https://yourmattermosturl/api/v4/compliance/reports/du6kektczifqxexeroywpz3nbc/download
|
|
```
|
|
|
|
When sending the request, you need to get the report ID from the response returned by Mattermost when the report was created. You also need to supply a name to save that file as. In the example above, the file will be saved as `report-zip.zip`.
|
|
|
|
## Mattermost database
|
|
|
|
Selecting messages from the Mattermost database using standard SQL is quite easy. If you know the username, the following query can be used to select all messages for the specified user:
|
|
|
|
``` sql
|
|
SELECT * FROM mattermost.Posts WHERE UserId = (SELECT Id FROM mattermost.Users WHERE Username = 'username');
|
|
```
|
|
|
|
If you want to limit the results of the query based on the date and time that the messages were posted, you can modify the above query to:
|
|
|
|
``` sql
|
|
SELECT * FROM mattermost.Posts WHERE UserId = (SELECT Id FROM mattermost.Users WHERE Username = 'username' AND CreateAt > 1530405832000 AND CreateAt < 1532997832000);
|
|
```
|
|
|
|
<Note>
|
|
|
|
The Mattermost database stores date and time stamps in the [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time) format. A tool like the [Epoch Converter](https://www.epochconverter.com/) can be useful in converting to and from the required format.
|
|
|
|
</Note>
|