You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: you must use the `source` command so that the env variables are set properly.
@@ -109,22 +109,45 @@ You should see a response similar to the following (note the result below has be
109
109
DEBUG:slack_discovery_sdk.base_client:Rate limit metrics: DEBUG:slack_discovery_sdk.base_client:Received the following response - status: 200, headers: {'date': 'Wed, 13 Oct 2021 22:09:57 GMT',..., body: {"ok":true,"enterprise":{"id":"T027****D2R","name":"Enterprise-****-Sandbox","domain":"test-****","email_domain":"","icon":...,"image_default":true},"is_verified":false,"teams":[{"id":"****","name":"Enterprise-****-Sandbox","domain":"test-****","email_domain":"","icon":{"image_102":"https:\/\/a...avatars-teams\/ava_0021-88.png","image_default":true},"is_verified":false,"enterprise_id":"E**","is_enterprise":0,"created":1625594757,"archived":false,"deleted":false,"discoverable":"unlisted"}]}}
110
110
```
111
111
112
-
There are various other scripts in the `slack_discovery_sdk/examples` folder, with each script serving to solve a different use case. Below you can find some basic information about each script:
112
+
If you want to run all of the examples at once, you can use the `run_all.sh` script.
113
+
114
+
> Note: before you can run this script, you will need to mark the file as executable with the following command:
115
+
116
+
```bash
117
+
chmod +x scripts/run_all.sh
118
+
```
119
+
120
+
Then, run the script:
121
+
122
+
```
123
+
./scripts/run_all.sh
124
+
```
125
+
126
+
This will run all of the examples in the `slack_discovery_sdk/examples` folder, and
127
+
you should see debug output in your terminal once the script has finished running.
128
+
129
+
Continue reading below to learn what each example does:
113
130
114
131
💳 <b>`DLP_call_pattern.py`</b> 💳
115
132
* This script involves using the tombstoning capabilities of the Discovery SDK to check for messages that contain sensitive information. If sensitive information is detected by our script (for example a credit card number), the message is tombstoned, and the user is notified that their message is being reviewed.
116
133
* Once you run this script, you should see that one of your
117
134
messages in the channel which you setin your env variable (SLACK_DISCOVERY_SDK_TEST_CHANNEL_ID) should have been tombstoned. The message should now say `This message is being scanned to make sure it complies with your team’s data security policies.`
* This script retrieves all of the conversations (channels) and messages a particular user is in. It then outputs those
121
-
conversations to a file, and stores them in the following format: `YYYY/MM/DD/user_id/channel_id/discovery_conversations_history.json`.
138
+
conversations to a file, and stores them in the following format: `YYYY/MM/DD/user_id/channel_id/discovery_conversations.json`. If the `has_edits` flag is true
139
+
fora certain conversation, all edited messages will be foundin the `edits` field.
140
+
122
141
123
142
👩🏻🏫 <b>`audit_logs_pattern.py`</b> 👩🏻🏫
124
143
* This script will use the [Audit Logs API](https://api.slack.com/admins/audit-logs) to find all of the
125
144
channels that a particular user has created. As is the
126
145
case with the `user_based_eDiscovery` script, it will only
127
-
be useful if you have a paricular user which you want to see details about. This script will output the channel creation events associated with a particular user_id to in the following format: `YYYY/MM/DD/user_id/audit_logs/public_channel_created.json`.
146
+
be useful if you have a paricular user which you want to see details about. This script will output the channel creation events associated with a particular user_id to in the following format: `YYYY/MM/DD/user_id/audit_logs/public_channel_created.json`.
* This is the same as the `user_based_eDiscovery_with_edits.py` script, except it
150
+
doesn't capture edits.
128
151
129
152
## Considerations
130
153
The SDK and examples are to aid in your development process. Please feel free to use this as a learning exercise, and to build on top of these examples, but the examples shown above are by no means a complete solution.
0 commit comments