Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 248dabb

Browse files
authored
slack: add audit.context.session_id (#6193)
1 parent 1d655f8 commit 248dabb

7 files changed

Lines changed: 104 additions & 3 deletions

File tree

packages/slack/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.3.0"
3+
changes:
4+
- description: Add `slack.audit.context.session_id` field.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/6193
27
- version: "1.2.0"
38
changes:
49
- description: Add a new flag to enable request tracing
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
{"id":"0123a45b-6c7d-8900-e12f-3456789gh0i1","date_create":1521214343,"action":"user_login","actor":{"type":"user","user":{"id":"W123AB456","name":"Charlie Parker","email":"[email protected]"}},"entity":{"type":"user","user":{"id":"W123AB456","name":"Charlie Parker","email":"[email protected]"}},"context":{"location":{"type":"enterprise","id":"E1701NCCA","name":"Birdland","domain":"birdland"},"ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36","ip_address":"81.2.69.143"}}
2-
{"id":"bdcb13e3-28a3-41f0-9ace-a20952def3a0","date_create":1566215192,"action":"user_created","actor":{"type":"user","user":{"id":"e65b0f5c","name":"roy","email":"[email protected]"}},"entity":{"type":"user","user":{"id":"asdfasdf","name":"Joe Bob","email":"[email protected]","team":"T234SAH2"}},"context":{"location":{"type":"workspace","id":"e65b11aa","name":"Docker","domain":"Docker"},"ua":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20131011 Firefox/23.0","ip_address":"81.2.69.143"}}
2+
{"id":"bdcb13e3-28a3-41f0-9ace-a20952def3a0","date_create":1566215192,"action":"user_created","actor":{"type":"user","user":{"id":"e65b0f5c","name":"roy","email":"[email protected]"}},"entity":{"type":"user","user":{"id":"asdfasdf","name":"Joe Bob","email":"[email protected]","team":"T234SAH2"}},"context":{"location":{"type":"workspace","id":"e65b11aa","name":"Docker","domain":"Docker"},"ua":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20131011 Firefox/23.0","ip_address":"81.2.69.143"}}
3+
{"action":"file_downloaded","actor":{"type":"user","user":{"email":"[email protected]","id":"2f52269c-4f38-4f08-b56d-c2b968681dbd","name":"User McUser","team":"user-team"}},"context":{"ip_address":"81.2.69.144","location":{"domain":"domain.tld","id":"eedd1a7d-1a92-418d-8b01-51a4c809d0fb","name":"The Place","type":"workspace"},"session_id":913888259765,"ua":"com.tinyspeck.chatlyio/23.04.40 (iPhone; iOS 1.4.1; Scale/3.00)"},"date_create":1683836275,"details":{"url_private":"https://example.com/"},"entity":{"file":{"filetype":"image/png","id":"7edc4c42-f925-47af-979a-22c10e1fefed","name":"image.png","title":"image.png"},"type":"file"},"id":"2db28060-1659-4b27-ad55-fdba12e3a7b1"}

packages/slack/data_stream/audit/_dev/test/pipeline/test-audit.log-expected.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,87 @@
164164
},
165165
"version": "23.0."
166166
}
167+
},
168+
{
169+
"@timestamp": "2023-05-11T20:17:55.000Z",
170+
"ecs": {
171+
"version": "8.7.0"
172+
},
173+
"event": {
174+
"action": "file_downloaded",
175+
"category": [
176+
"file"
177+
],
178+
"id": "2db28060-1659-4b27-ad55-fdba12e3a7b1",
179+
"kind": "event",
180+
"original": "{\"action\":\"file_downloaded\",\"actor\":{\"type\":\"user\",\"user\":{\"email\":\"[email protected]\",\"id\":\"2f52269c-4f38-4f08-b56d-c2b968681dbd\",\"name\":\"User McUser\",\"team\":\"user-team\"}},\"context\":{\"ip_address\":\"81.2.69.144\",\"location\":{\"domain\":\"domain.tld\",\"id\":\"eedd1a7d-1a92-418d-8b01-51a4c809d0fb\",\"name\":\"The Place\",\"type\":\"workspace\"},\"session_id\":913888259765,\"ua\":\"com.tinyspeck.chatlyio/23.04.40 (iPhone; iOS 1.4.1; Scale/3.00)\"},\"date_create\":1683836275,\"details\":{\"url_private\":\"https://example.com/\"},\"entity\":{\"file\":{\"filetype\":\"image/png\",\"id\":\"7edc4c42-f925-47af-979a-22c10e1fefed\",\"name\":\"image.png\",\"title\":\"image.png\"},\"type\":\"file\"},\"id\":\"2db28060-1659-4b27-ad55-fdba12e3a7b1\"}",
181+
"type": [
182+
"allowed"
183+
]
184+
},
185+
"related": {
186+
"ip": [
187+
"81.2.69.144"
188+
],
189+
"user": [
190+
"2f52269c-4f38-4f08-b56d-c2b968681dbd",
191+
192+
]
193+
},
194+
"slack": {
195+
"audit": {
196+
"context": {
197+
"domain": "domain.tld",
198+
"id": "eedd1a7d-1a92-418d-8b01-51a4c809d0fb",
199+
"name": "The Place",
200+
"session_id": "913888259765",
201+
"type": "workspace"
202+
},
203+
"entity": {
204+
"entity_type": "file",
205+
"filetype": "image/png",
206+
"id": "7edc4c42-f925-47af-979a-22c10e1fefed",
207+
"name": "image.png",
208+
"title": "image.png"
209+
}
210+
}
211+
},
212+
"source": {
213+
"address": "81.2.69.144",
214+
"geo": {
215+
"city_name": "London",
216+
"continent_name": "Europe",
217+
"country_iso_code": "GB",
218+
"country_name": "United Kingdom",
219+
"location": {
220+
"lat": 51.5142,
221+
"lon": -0.0931
222+
},
223+
"region_iso_code": "GB-ENG",
224+
"region_name": "England"
225+
},
226+
"ip": "81.2.69.144"
227+
},
228+
"tags": [
229+
"preserve_original_event"
230+
],
231+
"user": {
232+
"email": "[email protected]",
233+
"full_name": "User McUser",
234+
"id": "2f52269c-4f38-4f08-b56d-c2b968681dbd"
235+
},
236+
"user_agent": {
237+
"device": {
238+
"name": "iPhone"
239+
},
240+
"name": "Mobile Safari UI/WKWebView",
241+
"original": "com.tinyspeck.chatlyio/23.04.40 (iPhone; iOS 1.4.1; Scale/3.00)",
242+
"os": {
243+
"full": "iOS 1.4.1",
244+
"name": "iOS",
245+
"version": "1.4.1"
246+
}
247+
}
167248
}
168249
]
169250
}

packages/slack/data_stream/audit/elasticsearch/ingest_pipeline/default.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ processors:
149149
field: json.context.location
150150
target_field: slack.audit.context
151151
ignore_missing: true
152+
- rename:
153+
field: json.context.session_id
154+
target_field: slack.audit.context.session_id
155+
ignore_missing: true
156+
- convert:
157+
field: slack.audit.context.session_id
158+
type: string
159+
ignore_missing: true
152160
- append:
153161
field: related.user
154162
value: "{{user.id}}"

packages/slack/data_stream/audit/fields/fields.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- name: slack.audit
22
type: group
33
description: >
4-
Fields for Cloudflare Audit Logs
4+
Fields for Slack Audit Logs
55
66
fields:
77
- name: context.domain
@@ -24,6 +24,11 @@
2424
description: >
2525
The type of account. Either `Workspace` or `Enterprise`
2626
27+
- name: context.session_id
28+
type: keyword
29+
description: >
30+
The identifier that is unique to each authenticated session.
31+
2732
- name: entity
2833
type: group
2934
description: >

packages/slack/docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Audit logs summarize the history of changes made within the Slack Enterprise.
9393
| slack.audit.context.domain | The domain of the Workspace or Enterprise | keyword |
9494
| slack.audit.context.id | The ID of the workspace or enterprise | keyword |
9595
| slack.audit.context.name | The name of the workspace or enterprise | keyword |
96+
| slack.audit.context.session_id | The identifier that is unique to each authenticated session. | keyword |
9697
| slack.audit.context.type | The type of account. Either `Workspace` or `Enterprise` | keyword |
9798
| slack.audit.entity.barriered_from_usergroup | The user group barrier when entity_type is barrier | keyword |
9899
| slack.audit.entity.channel | The channel the entity is within when entity_type is message | keyword |

packages/slack/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: 1.0.0
22
name: slack
33
title: "Slack Logs"
4-
version: "1.2.0"
4+
version: "1.3.0"
55
license: basic
66
release: ga
77
description: "Slack Logs Integration"

0 commit comments

Comments
 (0)