Skip to content

Commit 1894fb2

Browse files
[O365] Add system benchmark (elastic#16120)
o365: add system benchmark for integration quality check
1 parent aeb18a1 commit 1894fb2

File tree

6 files changed

+299
-0
lines changed

6 files changed

+299
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
description: Benchmark 100000 audit events ingested
3+
input: cel
4+
data_stream:
5+
name: audit
6+
vars:
7+
url: http://svc-o365:8082
8+
token_url: http://svc-o365:8082
9+
client_id: test-cel-client-id
10+
client_secret: test-cel-client-secret
11+
azure_tenant_id: test-cel-tenant-id
12+
content_types: "Audit.SharePoint, Audit.General"
13+
initial_interval: 12h
14+
warmup_time_period: 2s
15+
corpora:
16+
input_service:
17+
name: o365
18+
generator:
19+
total_events: 100000
20+
template:
21+
path: ./audit-benchmark/template.ndjson
22+
type: gotext
23+
config:
24+
path: ./audit-benchmark/config.yml
25+
fields:
26+
path: ./audit-benchmark/fields.yml
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
fields:
2+
- name: ListItemUniqueId
3+
cardinality: 10000
4+
- name: Id
5+
range:
6+
min: 100000000000000000
7+
max: 999999999999999999
8+
cardinality: 1000000
9+
- name: ObjectId
10+
cardinality: 10000
11+
- name: Operation
12+
enum:
13+
- Add app role assignment to service principal.
14+
- Add OAuth2PermissionGrant.
15+
- Consent to application.
16+
- Add app role assignment grant to user.
17+
- Update application.
18+
- name: OrganizationId
19+
cardinality: 10000
20+
- name: RecordType
21+
range:
22+
min: 1
23+
max: 181
24+
cardinality: 100
25+
- name: UserId
26+
enum:
27+
- asr@testsiem.onmicrosoft.com
28+
- bsr@testsiem.onmicrosoft.com
29+
- name: UserKey
30+
enum:
31+
- 1003200096971F55@testsiem.onmicrosoft.com
32+
- 1003200096971F56@testsiem.onmicrosoft.com
33+
- name: UserType
34+
range:
35+
min: 1
36+
max: 9
37+
cardinality: 10
38+
- name: Version
39+
range:
40+
min: 1
41+
max: 5
42+
cardinality: 10
43+
- name: Workload
44+
enum:
45+
- ExchangeAdmin
46+
- ExchangeItem
47+
- ExchangeItemGroup
48+
- SharePoint
49+
- SharePointFileOperation
50+
- OneDrive
51+
- AzureActiveDirectory
52+
- AzureActiveDirectoryAccountLogon
53+
- DataCenterSecurityCmdlet
54+
- name: ItemType
55+
enum:
56+
- Page
57+
- File
58+
- Web
59+
- List
60+
- name: Site
61+
cardinality: 10000
62+
- name: WebId
63+
cardinality: 10000
64+
- name: CorrelationId
65+
cardinality: 10000
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
- name: ListItemUniqueId
2+
type: keyword
3+
- name: ItemType
4+
type: keyword
5+
- name: Workload
6+
type: keyword
7+
- name: OrganizationId
8+
type: keyword
9+
- name: UserId
10+
type: keyword
11+
- name: CreationTime
12+
type: date
13+
- name: Site
14+
type: keyword
15+
- name: WebId
16+
type: keyword
17+
- name: UserType
18+
type: integer
19+
- name: Version
20+
type: integer
21+
- name: UserAgent
22+
type: keyword
23+
- name: UserKey
24+
type: keyword
25+
- name: CustomUniqueId
26+
type: boolean
27+
- name: Operation
28+
type: keyword
29+
- name: ObjectId
30+
type: keyword
31+
- name: Id
32+
type: integer
33+
- name: CorrelationId
34+
type: keyword
35+
- name: RecordType
36+
type: integer
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- $ListItemUniqueId := generate "ListItemUniqueId" }}
2+
{{- $ItemType := generate "ItemType" }}
3+
{{- $Workload := generate "Workload" }}
4+
{{- $OrganizationId := generate "OrganizationId" }}
5+
{{- $UserId := generate "UserId" }}
6+
{{- $Site := generate "Site" }}
7+
{{- $WebId := generate "WebId" }}
8+
{{- $UserType := generate "UserType" }}
9+
{{- $Version := generate "Version" }}
10+
{{- $UserAgent := generate "UserAgent" }}
11+
{{- $UserKey := generate "UserKey" }}
12+
{{- $CustomUniqueId := generate "CustomUniqueId" }}
13+
{{- $Operation := generate "Operation" }}
14+
{{- $ObjectId := generate "ObjectId" }}
15+
{{- $Id := generate "Id" }}
16+
{{- $CorrelationId := generate "CorrelationId" }}
17+
{{- $RecordType := generate "RecordType" }}
18+
{ "ListItemUniqueId": "{{ $ListItemUniqueId }}", "ItemType": "{{ $ItemType }}", "Workload": "{{ $Workload }}", "OrganizationId": "{{ $OrganizationId }}", "UserId": "{{ $UserId }}", "Site": "{{ $Site }}", "WebId": "{{ $WebId }}", "UserType": {{ $UserType }}, "Version": {{ $Version }}, "UserAgent": "{{ $UserAgent }}", "UserKey": "{{ $UserKey }}", "CustomUniqueId": {{ $CustomUniqueId }}, "Operation": "{{ $Operation }}", "ObjectId": "{{ $ObjectId }}", "Id": "{{ $Id }}", "CorrelationId": "{{ $CorrelationId }}", "RecordType": {{ $RecordType }} },
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
services:
2+
o365:
3+
image: docker.elastic.co/observability/stream:v0.20.0
4+
hostname: o365
5+
ports:
6+
- 8082
7+
environment:
8+
PORT: "8082"
9+
volumes:
10+
- ./files:/files:ro
11+
- ${SERVICE_LOGS_DIR}:/var/log
12+
command:
13+
- http-server
14+
- --addr=:8082
15+
- --config=/files/config.yml
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
rules:
2+
- path: /test-cel-tenant-id/oauth2/v2.0/token
3+
methods: [POST]
4+
query_params:
5+
client_id: test-cel-client-id
6+
client_secret: test-cel-client-secret
7+
grant_type: client_credentials
8+
scope: https://manage.office.com/.default
9+
request_headers:
10+
Content-Type:
11+
- "application/x-www-form-urlencoded"
12+
responses:
13+
- status_code: 200
14+
headers:
15+
Content-Type:
16+
- "application/json"
17+
body: |-
18+
{{ minify_json `
19+
{
20+
"access_token": "CELtoken",
21+
"token_type": "Bearer",
22+
"expires_in": 3600,
23+
"ext_expires_in": 3600
24+
}
25+
`}}
26+
- path: /api/v1.0/test-cel-tenant-id/activity/feed/subscriptions/start
27+
methods: [POST]
28+
query_params:
29+
contentType: "Audit.SharePoint"
30+
PublisherIdentifier: test-cel-tenant-id
31+
request_headers:
32+
Authorization:
33+
- "Bearer CELtoken"
34+
responses:
35+
- status_code: 200
36+
headers:
37+
Content-Type:
38+
- "application/json"
39+
body: |-
40+
{{ minify_json `
41+
{
42+
"contentType": "Audit.SharePoint",
43+
"status": "enabled",
44+
"webhook": null
45+
}
46+
`}}
47+
- path: /api/v1.0/test-cel-tenant-id/activity/feed/subscriptions/start
48+
methods: [POST]
49+
query_params:
50+
contentType: "Audit.General"
51+
PublisherIdentifier: test-cel-tenant-id
52+
request_headers:
53+
Authorization:
54+
- "Bearer CELtoken"
55+
responses:
56+
- status_code: 200
57+
headers:
58+
Content-Type:
59+
- "application/json"
60+
body: |-
61+
{{ minify_json `
62+
{
63+
"contentType": "Audit.General",
64+
"status": "enabled",
65+
"webhook": null
66+
}
67+
`}}
68+
- path: /api/v1.0/test-cel-tenant-id/activity/feed/subscriptions/content
69+
methods: [GET]
70+
query_params:
71+
contentType: "Audit.SharePoint"
72+
startTime: "{startTime:.*}"
73+
endTime: "{endTime:.*}"
74+
PublisherIdentifier: test-cel-tenant-id
75+
request_headers:
76+
Authorization:
77+
- "Bearer CELtoken"
78+
responses:
79+
- status_code: 200
80+
headers:
81+
Content-Type:
82+
- "application/json"
83+
body: |-
84+
[{"contentType": "Audit.Sharepoint","contentId": "celid2a","contentUri": "http://svc-o365:8082/api/v1.0/celsp1/activity/feed/audit/celid2b","contentCreated": "{{ .request.vars.endTime }}","contentExpiration": "2023-03-30T17:35:00.000Z"}]
85+
- path: /api/v1.0/celsp1/activity/feed/audit/celid2b
86+
methods: [GET]
87+
request_headers:
88+
Authorization:
89+
- "Bearer CELtoken"
90+
responses:
91+
- status_code: 200
92+
headers:
93+
Content-Type:
94+
- "application/json"
95+
body: |-
96+
[
97+
{{- $g := glob "/var/log/corpus-*" -}}
98+
{{- range $g -}}
99+
{{- file . -}}
100+
{{- end -}}
101+
{{/* A last line of hard-coded data is required to avoid empty string from being sent to CEL program in the final line */}}
102+
{ "ListItemUniqueId": "longcondor", "ItemType": "lavendercurtain", "Workload": "eveningraven", "OrganizationId": "coconutkeeper", "UserId": "ribboneye", "Site": "blossomsalmon", "WebId": "bonemask", "UserType": 0, "Version": 9, "UserAgent": "cherryelk", "UserKey": "rhinestonehisser", "CustomUniqueId": false, "Operation": "daisytooth", "ObjectId": "rustthorn", "Id": "7", "CorrelationId": "runemind", "RecordType": 6 }
103+
]
104+
- path: /api/v1.0/test-cel-tenant-id/activity/feed/subscriptions/content
105+
methods: [GET]
106+
query_params:
107+
contentType: "Audit.General"
108+
startTime: "{startTime:.*}"
109+
endTime: "{endTime:.*}"
110+
PublisherIdentifier: test-cel-tenant-id
111+
request_headers:
112+
Authorization:
113+
- "Bearer CELtoken"
114+
responses:
115+
- status_code: 200
116+
headers:
117+
Content-Type:
118+
- "application/json"
119+
body: |-
120+
[{"contentType": "Audit.General","contentId": "celid3","contentUri": "http://svc-o365:8082/api/v1.0/celgen1/activity/feed/audit/celid3","contentCreated": "{{ .request.vars.endTime }}","contentExpiration": "2199-05-30T17:35:00.000Z"}]
121+
- path: /api/v1.0/celgen1/activity/feed/audit/celid3
122+
methods: [GET]
123+
request_headers:
124+
Authorization:
125+
- "Bearer CELtoken"
126+
responses:
127+
- status_code: 200
128+
headers:
129+
Content-Type:
130+
- "application/json"
131+
body: |
132+
[
133+
{{- $g := glob "/var/log/corpus-*" -}}
134+
{{- range $g -}}
135+
{{- file . -}}
136+
{{- end -}}
137+
{{/* A last line of hard-coded data is required to avoid empty string from being sent to CEL program in the final line */}}
138+
{ "ListItemUniqueId": "longcondor", "ItemType": "lavendercurtain", "Workload": "eveningraven", "OrganizationId": "coconutkeeper", "UserId": "ribboneye", "Site": "blossomsalmon", "WebId": "bonemask", "UserType": 0, "Version": 9, "UserAgent": "cherryelk", "UserKey": "rhinestonehisser", "CustomUniqueId": false, "Operation": "daisytooth", "ObjectId": "rustthorn", "Id": "6", "CorrelationId": "runemind", "RecordType": 6 }
139+
]

0 commit comments

Comments
 (0)